1 #ifndef DUNE_FEM_BASEFUNCTIONSET_FUNCTOR_HH 2 #define DUNE_FEM_BASEFUNCTIONSET_FUNCTOR_HH 4 #include <dune/common/fmatrix.hh> 5 #include <dune/common/fvector.hh> 19 inline void axpy (
const T &a,
const T &x, T &y );
21 template<
class K,
int SIZE >
22 inline void axpy (
const typename FieldTraits< K >::field_type &a,
23 const FieldVector< K, SIZE > &x,
24 FieldVector< K, SIZE > &y );
26 template<
class K,
int ROWS,
int COLS >
27 inline void axpy (
const typename FieldTraits< K >::field_type &a,
28 const FieldMatrix< K, ROWS, COLS > &x,
29 FieldMatrix< K, ROWS, COLS > &y );
37 inline void axpy (
const T &a,
const T &x, T &y )
42 template<
class K,
int SIZE >
43 inline void axpy (
const typename FieldTraits< K >::field_type &a,
44 const FieldVector< K, SIZE > &x,
45 FieldVector< K, SIZE > &y )
47 for(
int i = 0; i < SIZE; ++i )
48 axpy( a, x[ i ], y[ i ] );
51 template<
class K,
int ROWS,
int COLS >
52 inline void axpy (
const typename FieldTraits< K >::field_type &a,
53 const FieldMatrix< K, ROWS, COLS > &x,
54 FieldMatrix< K, ROWS, COLS > &y )
64 inline double scalarProduct (
const double &a,
const double &b ) {
return a * b; }
72 template<
class K,
int ROWS,
int COLS >
73 inline K
scalarProduct (
const FieldMatrix< K, ROWS, COLS > &a,
const FieldMatrix< K, ROWS, COLS > &b )
76 for(
int r = 0; r < ROWS; ++r )
86 template<
class Vector,
class Value >
97 axpy( vector_[ i ], v, value_ );
101 const Vector &vector_;
110 template<
class Value,
class Vector >
133 #endif // #ifndef DUNE_FEM_BASEFUNCTIONSET_FUNCTOR_HH
Definition: space/basisfunctionset/functor.hh:87
void axpy(const T &a, const T &x, T &y)
Definition: space/basisfunctionset/functor.hh:37
Definition: coordinate.hh:4
void operator()(const std::size_t i, const V &v)
Definition: space/basisfunctionset/functor.hh:95
Definition: space/basisfunctionset/functor.hh:111
AxpyFunctor(const Vector &vector, Value &value)
Definition: space/basisfunctionset/functor.hh:89
FunctionalAxpyFunctor(const Value &value, Vector &vector)
Definition: space/basisfunctionset/functor.hh:113
double scalarProduct(const double &a, const double &b)
Definition: space/basisfunctionset/functor.hh:64