29 #ifndef __Functional_H
30 #define __Functional_H 1
32 #include <boost/operators.hpp>
33 #include <boost/numeric/ublas/vector_proxy.hpp>
34 #include <boost/numeric/ublas/matrix_proxy.hpp>
36 #include <feel/feelcore/feel.hpp>
41 namespace ublas = boost::numeric::ublas;
54 template<
typename Space>
57 public boost::addable<Functional<Space> >
59 typedef boost::addable<Functional<Space> > super;
67 typedef typename Space::value_type value_type;
68 typedef Functional<Space> self_type;
69 typedef Space space_type;
70 typedef Space polynomialset_type;
71 typedef typename space_type::polynomial_type polynomial_type;
72 typedef typename space_type::basis_type basis_type;
73 typedef typename space_type::matrix_type matrix_type;
75 static const uint16_type nComponents = space_type::nComponents;
78 typedef ublas::matrix<value_type> rep_type;
93 Functional( space_type
const& P )
97 M_coeff( M_p.
coeff() )
104 Functional( space_type
const& P,
105 matrix_type
const&
coeff )
117 Functional( Functional
const & __f )
120 M_coeff( __f.M_coeff )
126 virtual ~Functional()
135 self_type& operator=( self_type
const& __f )
140 M_coeff = __f.M_coeff;
152 M_coeff += __f.M_coeff;
163 virtual matrix_type
operator()( polynomial_type
const& p )
const
165 FEELPP_ASSERT( p.coeff().size2() == M_coeff.size2() )
166 ( p.coeff() )( M_coeff ).error(
"invalid polynomial" );
168 return ublas::prod( p.coeff(), ublas::trans( M_coeff ) );
182 return M_coeff.size2();
202 void setCoefficient( matrix_type
const& __coeff )
uint16_type size() const
Definition: functional.hpp:180
virtual matrix_type operator()(polynomial_type const &p) const
Definition: functional.hpp:163
self_type & operator+=(const self_type &__f)
Definition: functional.hpp:150
rep_type const & coeff() const
Definition: functional.hpp:189