23 template <
class Scalar,
int n>
class FieldVector;
24 template <
class Scalar,
int n,
int m>
class FieldMatrix;
34 template <
class Scalar>
41 static bool const isBLAStype = std::is_same_v<Scalar,float> || std::is_same_v<Scalar,double>;
54 static Real real(Scalar
const& s) {
return s; }
66 static Real real(std::complex<T>
const& z) {
return z.real(); }
71 template <
class Entry>
79 static int const lapackLayout = std::is_floating_point<Entry>::value;
84 template <
class Entry,
int n,
int m>
97 template <
class Entry,
int n>
110 template <
class Entry>
121 namespace ScalarDetail
126 static constexpr int value = 0;
129 template <
class K,
int n>
130 struct Rank<
Dune::FieldVector<K,n>>
132 static constexpr int value = 1;
135 template <
class K,
int n,
int m>
136 struct Rank<
Dune::FieldMatrix<K,n,m>>
138 static constexpr int value = 2;
150 constexpr int rank = ScalarDetail::Rank<T>::value;
159 template <
class T,
class Real>
162 using type = std::conditional_t<std::is_convertible<T,Real>::value,Real,T>;
165 template <
class T,
int n,
int m,
class Real>
static Real real(std::complex< T > const &z)
Helper class for working with (real or complex) scalar field types.
static Real real(Scalar const &s)
Conversion to the real type, ignoring the imaginary part if nonzero.
Scalar Real
The real type on which the scalar field is based.
static bool const isBLAStype
Whether the scalar is BLAS/LAPACK compatible or not.
constexpr int rank
Reports the rank of vector, matrix, and tensor types of static size.
EntryTraits< Entry >::real_type frobenius_norm2(Entry const &x)
Reports the converted type.
std::conditional_t< std::is_convertible< T, Real >::value, Real, T > type
typename ScalarTraits< field_type >::Real real_type
typename EntryTraits< Entry >::field_type field_type
static real_type frobenius_norm2(Dune::FieldMatrix< Entry, n, m > const &x)
typename ScalarTraits< field_type >::Real real_type
typename EntryTraits< Entry >::field_type field_type
static real_type frobenius_norm2(Dune::FieldVector< Entry, n > const &x)
static real_type frobenius_norm2(Entry const &x)
typename ScalarTraits< field_type >::Real real_type
static int const lapackLayout