DUNE-FUNCTIONS (unstable)

sizeinfo.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
9
10#warning The header dune/functions/functionspacebases/sizeinfo.hh is deprecated and will be removed after release 2.10.
11
12#include <array>
13
14namespace Dune {
15namespace Functions {
16
17
18
31template<class B>
32class
33[[deprecated("SizeInfo is deprecated and will be removed after release 2.10.")]]
35{
36public:
37 using Basis = B;
38 using size_type = typename Basis::size_type;
39 using SizePrefix = typename Basis::SizePrefix;
40
44 SizeInfo(const Basis& basis) :
45 basis_(&basis)
46 {}
47
51 size_type operator()(const SizePrefix& prefix) const
52 {
53 return basis_->size(prefix);
54 }
55
62 size_type size(const SizePrefix& prefix) const
63 {
64 return basis_->size(prefix);
65 }
66
67 operator size_type () const
68 {
69 return basis_->dimension();
70 }
71
72protected:
73
74 const Basis* basis_;
75};
76
77
81template<class Basis>
82SizeInfo<Basis> sizeInfo(const Basis& basis)
83{
84 return SizeInfo<Basis>(basis);
85}
86
87
88
89} // end namespace Functions
90} // end namespace Dune
91
92#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
A class encapsulating size information.
Definition: sizeinfo.hh:35
size_type size(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition: sizeinfo.hh:62
size_type operator()(const SizePrefix &prefix) const
Return number possible values for next position in multi index.
Definition: sizeinfo.hh:51
SizeInfo(const Basis &basis)
Construct from basis.
Definition: sizeinfo.hh:44
Definition: polynomial.hh:17
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Aug 14, 22:29, 2024)