dune-common 2.11
Loading...
Searching...
No Matches
Dune::Concept::Number Concept Reference

The Number concept is satisfied if the type N can act as a scalar in the context of (hierarchically blocked) containers. More...

#include <dune/common/concepts/number.hh>

Concept definition

template<class N>
Whether this type acts as a scalar in the context of (hierarchically blocked) containers.
Definition typetraits.hh:194
The Number concept is satisfied if the type N can act as a scalar in the context of (hierarchically b...
Definition number.hh:34

Detailed Description

The Number concept is satisfied if the type N can act as a scalar in the context of (hierarchically blocked) containers.

Number types are possible element types of (hierarchically blocked) matrices and vectors, such as FieldMatrix, FieldVector, BCRSMatrix, BlockVector, MultiTypeBlockVector, etc. It allows, for example, to define break conditions in recursive algorithms and are used as value initializers and scalar factors in scaling operations.

Types that can act as number types include the arithmetic types like double, int, or float, and the std::complex<U> types if U itself is a scalar type. It is possible to register used-defined types, e.g., extended precision types or automatic differentiation types, or anything else that might sensibly be an element of a matrix or vector. Therefore, the traits class Dune::IsNumber can be specialized.

Note
The precise semantics of number types are only vaguely specified. It should behave similar to arithmetic types, e.g., provide arithmetic operations, and should be considered a field type in the mathematical sense.