27 #ifndef MPBLOCKS_POLYNOMIAL_SUM_H_
28 #define MPBLOCKS_POLYNOMIAL_SUM_H_
31 namespace polynomial {
34 template <
typename Scalar,
class Exp1,
class Exp2>
47 Sum( Exp1
const& A, Exp2
const& B ):
62 if( i <
m_A.size() && i <
m_B.size() )
64 else if( i <
m_A.size() )
66 else if( i <
m_B.size() )
74 return m_A.eval(x) +
m_B.eval(x);
81 template <
typename Scalar,
class Exp1,
class Exp2>
88 static_cast<Exp1 const&>(A),
89 static_cast<Exp2 const&>(B));
Scalar operator[](Size_t i) const
return the evaluated i'th element of a vector expression
Sum(Exp1 const &A, Exp2 const &B)
expression template for rvalues
Size_t size() const
return the size for a vector
expression template for sum of two matrix expressions
Sum< Scalar, Exp1, Exp2 > operator+(RValue< Scalar, Exp1 > const &A, RValue< Scalar, Exp2 > const &B)