KASKADE 7 development version
|
#include <linearspace.hh>
A product space of linear spaces.
Access to the components of the product space is provided by the component function:
Arithmetic operations are delegated componentwise to the heterogeneous subspaces.
Scalar | the scalar field type of the linear space |
Seq | a boost::fusion sequence type defining the variables of the cartesian product |
Definition at line 76 of file linearspace.hh.
Public Types | |
typedef Scalar_ | Scalar |
scalar type More... | |
typedef Scalar | field_type |
typedef Seq | Sequence |
boost::fusion::vector of element vectors. More... | |
typedef Seq | Functions |
template<int m> | |
using | Component = std::remove_reference_t< typename boost::fusion::result_of::at_c< Sequence const, m >::type > |
The type of the m-th component. More... | |
Public Member Functions | |
LinearProductSpace ()=delete | |
size_t | dim () const |
Number of scalar degrees of freedom. This computes the total number of degrees of freedom, i.e. the sum of the dimensions of the components. More... | |
template<class SequenceY > | |
Self & | operator+= (LinearProductSpace< Scalar, SequenceY > const &y) |
In place addition. More... | |
Self & | operator-= (Self const &y) |
In place subtraction. More... | |
Self & | axpy (Scalar a, Self const &y) |
this <- this + a*y More... | |
template<class InIterator > | |
void | read (InIterator i) |
DEPRECATED use vectorFromSequence instead. More... | |
template<class InIterator > | |
void | read (int rbegin, int rend, InIterator i) |
Reads the coefficients of the subrange [rbegin,rend[ sequentially from an input iterator. The InIterator's value type must be convertible to field_type. More... | |
template<class OutIterator > | |
void | write (OutIterator i) const |
DEPRECATED use vectorToSequence instead. More... | |
template<class DataOutIter > | |
void | write (int rbegin, int rend, DataOutIter i) const |
Writes the coefficients of the subrange [rbegin,rend[ sequentially to an output iterator. The InIterator's value type must be convertible to field_type. More... | |
Construction | |
LinearProductSpace (LinearProductSpace< Scalar, Sequence > const &y) | |
Copy constructor. More... | |
LinearProductSpace (LinearProductSpace< Scalar, Sequence > &&y) | |
Move constructor. More... | |
template<class VSDescriptions > | |
LinearProductSpace (const VariableSet< VSDescriptions > &y) | |
Copy from VariableSet. More... | |
template<class S > | |
LinearProductSpace (S const &init) | |
Constructor with explicit data. More... | |
template<typename... Args> | |
LinearProductSpace (boost::fusion::transform_view< Args... > const &data_) | |
Assignment | |
Self & | operator= (Self const &y) |
Assignment from the same type. More... | |
template<class VSDescriptions > | |
Self & | operator= (VariableSet< VSDescriptions > const &y) |
Assignment from a different (hopefully compatible) type. More... | |
template<class OtherSeq > | |
Self & | operator= (LinearProductSpace< Scalar, OtherSeq > const &y) |
Assignment from a different (hopefully compatible) type. More... | |
template<class FunctionSpace , int m> | |
Self & | operator= (FunctionSpaceElement< FunctionSpace, m > const &fse) |
Assignment from a (hopefully compatible) FunctionSpaceElement. More... | |
Self & | operator= (Scalar a) |
Assignment to constant scalar. More... | |
template<class First , class Last > | |
Self & | operator= (boost::fusion::iterator_range< First, Last > range) |
Assignment from a (hopefully compatible) boost::fusion iterator range. More... | |
Self & | operator*= (Scalar a) |
Scaling. More... | |
Scalar products and norms | |
field_type | operator* (Self const &y) const |
Scalar product. More... | |
field_type | dot (Self const &y) const |
Scalar product. More... | |
double | two_norm2 () const |
squared euclidean norm More... | |
double | two_norm () const |
euclidean norm More... | |
Public Attributes | |
Sequence | data |
Data. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<int m, class Scalar , class Sequence > | |
auto const & | component (LinearProductSpace< Scalar, Sequence > const &x) |
Provides access to the m-th component of a product space. More... | |
template<class X0 , class ... Xs> | |
auto | cartesianProduct (X0 const &x0, Xs const &... xs) |
Creates a cartesian product of the given vectors, i.e. a LinearProductSpace object. More... | |
template<class Scalar , class Seq , class OutIter > | |
OutIter | vectorToSequence (LinearProductSpace< Scalar, Seq > const &v, OutIter i) |
writes the coefficients of a vector to a flat scalar sequence <Scalar,Seq> More... | |
template<class Scalar , class Seq , class InIter > | |
InIter | vectorFromSequence (LinearProductSpace< Scalar, Seq > &v, InIter i) |
reads the coefficients of a vector from a flat scalar sequence <Scalar,Seq> More... | |
using Kaskade::LinearProductSpace< Scalar_, Seq >::Component = std::remove_reference_t<typename boost::fusion::result_of::at_c<Sequence const,m>::type> |
The type of the m-th component.
Definition at line 104 of file linearspace.hh.
typedef Scalar Kaskade::LinearProductSpace< Scalar_, Seq >::field_type |
Definition at line 94 of file linearspace.hh.
typedef Seq Kaskade::LinearProductSpace< Scalar_, Seq >::Functions |
Definition at line 98 of file linearspace.hh.
typedef Scalar_ Kaskade::LinearProductSpace< Scalar_, Seq >::Scalar |
scalar type
Definition at line 93 of file linearspace.hh.
typedef Seq Kaskade::LinearProductSpace< Scalar_, Seq >::Sequence |
boost::fusion::vector of element vectors.
Definition at line 97 of file linearspace.hh.
|
delete |
|
inline |
Copy constructor.
Definition at line 115 of file linearspace.hh.
|
inline |
Move constructor.
Definition at line 120 of file linearspace.hh.
|
inlineexplicit |
Copy from VariableSet.
Definition at line 124 of file linearspace.hh.
|
inlineexplicit |
Constructor with explicit data.
S | a type convertible to Sequence |
init | a sequence type from which the components are initialized |
Definition at line 136 of file linearspace.hh.
|
inlineexplicit |
Definition at line 140 of file linearspace.hh.
|
inline |
this <- this + a*y
Definition at line 233 of file linearspace.hh.
|
inline |
Number of scalar degrees of freedom. This computes the total number of degrees of freedom, i.e. the sum of the dimensions of the components.
Definition at line 154 of file linearspace.hh.
Referenced by Kaskade::LinearProductSpace< Scalar_, Seq >::dim().
|
inline |
Scalar product.
Definition at line 302 of file linearspace.hh.
|
inline |
Scalar product.
For two vectors \( (x_i)_{i=0,\dots,n-1} \) and \( (y_i)_{i=0,\dots,n-1}\) this computes and returns the euclidean scalar product
\[ \sum_{i=0}^{n-1} \langle x_i , y_i \rangle. \]
For the entries' scalar products, the operator*() is called.
Definition at line 292 of file linearspace.hh.
|
inline |
Definition at line 213 of file linearspace.hh.
|
inline |
In place addition.
Definition at line 221 of file linearspace.hh.
|
inline |
In place subtraction.
Definition at line 227 of file linearspace.hh.
|
inline |
Assignment from a (hopefully compatible) boost::fusion iterator range.
Definition at line 204 of file linearspace.hh.
|
inline |
Assignment from a (hopefully compatible) FunctionSpaceElement.
Definition at line 190 of file linearspace.hh.
|
inline |
Assignment from a different (hopefully compatible) type.
Definition at line 180 of file linearspace.hh.
|
inline |
Assignment to constant scalar.
Definition at line 197 of file linearspace.hh.
|
inline |
Assignment from the same type.
Definition at line 165 of file linearspace.hh.
|
inline |
Assignment from a different (hopefully compatible) type.
Definition at line 169 of file linearspace.hh.
|
inline |
DEPRECATED use vectorFromSequence instead.
Reads the coefficients sequentially from an input iterator. The InIterator's value type must be convertible to field_type.
Definition at line 245 of file linearspace.hh.
Referenced by Kaskade::Bridge::VectorTraits< VariableSet< Descr > >::read().
|
inline |
Reads the coefficients of the subrange [rbegin,rend[ sequentially from an input iterator. The InIterator's value type must be convertible to field_type.
Definition at line 255 of file linearspace.hh.
|
inline |
euclidean norm
Definition at line 318 of file linearspace.hh.
Referenced by Kaskade::uniformEmbeddedErrorEstimation().
|
inline |
squared euclidean norm
Definition at line 310 of file linearspace.hh.
Referenced by Kaskade::LinearProductSpace< Scalar_, Seq >::two_norm().
|
inline |
Writes the coefficients of the subrange [rbegin,rend[ sequentially to an output iterator. The InIterator's value type must be convertible to field_type.
Definition at line 274 of file linearspace.hh.
|
inline |
DEPRECATED use vectorToSequence instead.
Writes the coefficients sequentially to an output iterator (flattening). The field_type must be convertible to the OutIterator's value type.
Definition at line 264 of file linearspace.hh.
Referenced by Kaskade::Bridge::VectorTraits< VariableSet< Descr > >::write().
Sequence Kaskade::LinearProductSpace< Scalar_, Seq >::data |
Data.
Definition at line 328 of file linearspace.hh.
Referenced by Kaskade::LinearSpace_Detail::Copy< VariableSet< VSDescriptions >, Space, id >::apply(), Kaskade::LinearSpace_Detail::Copy< VariableSet< VSDescriptions >, Space, 0 >::apply(), Kaskade::coarsening(), Kaskade::component(), Kaskade::LinearProductSpace< Scalar_, Seq >::component(), LossyStorage< Grid, VariableSet, Space, QuantizationPolicy >::decode(), Kaskade::LinearProductSpace< Scalar_, Seq >::dim(), LossyStorage< Grid, VariableSet, Space, QuantizationPolicy >::encode(), Kaskade::EmbeddedErrorEstimator< VariableSetDescription, Scaling >::estimate(), Kaskade::evaluateVariables(), Kaskade::VTKReader::getCoefficients(), Kaskade::gridIterate(), Kaskade::YetAnotherHBErrorEstimator< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, RefinementStrategy, lump, components, ReferenceSolution, ReferenceOperator >::operator()(), Kaskade::YetAnotherHBErrorEstimator_Elasticity< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, RefinementStrategy, lump, components >::operator()(), Kaskade::HierarchicalBasisErrorEstimator2< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, LinearSolverLA, LinearSolverHA, LinearSolverLM, LinearSolverHM, lumpM, RefinementStrategy >::operator()(), Kaskade::AdjointEquationLinearPropagationHBErrorEstimator< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, LinearSolverLA, LinearSolverHA, LinearSolverLU, RefinementStrategy >::operator()(), Kaskade::AnotherHBErrorEstimator< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, LinearSolverLA, LinearSolverHA, LinearSolverHU, LinearSolverLU, RefinementStrategy, lump >::operator()(), Kaskade::HierarchicalBasisErrorEstimator3< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, LinearSolverLA, LinearSolverHA, LinearSolverLM, LinearSolverHM, lumpM, RefinementStrategy >::operator()(), Kaskade::DoRegularization< Linearization, VariableSet >::operator()(), Kaskade::LinearProductSpace< Scalar_, Seq >::operator*(), Kaskade::VariableSet< VSDescriptions >::operator=(), Kaskade::LinearProductSpace< Scalar_, Seq >::operator=(), Kaskade::projectHierarchically(), Kaskade::LinearProductSpace< Scalar_, Seq >::read(), Kaskade::Bridge::VectorTraits< VariableSet< Descr > >::scale(), Kaskade::LinearProductSpace< Scalar_, Seq >::vectorFromSequence(), Kaskade::LinearProductSpace< Scalar_, Seq >::vectorToSequence(), Kaskade::LinearProductSpace< Scalar_, Seq >::write(), Kaskade::writePartialFile(), and Kaskade::writeVTK().