27 #ifndef MPBLOCKS_CUDA_POLYNOMIAL_SUM_H_
28 #define MPBLOCKS_CUDA_POLYNOMIAL_SUM_H_
34 namespace polynomial {
37 template <
typename Scalar,
38 class Exp1,
class Spec1,
39 class Exp2,
class Spec2>
41 public RValue<Scalar, Sum<Scalar,Exp1,Spec1,Exp2,Spec2>,
42 typename intlist::make_union<Spec1,Spec2>::result >
49 Sum( Exp1
const&
A, Exp2
const&
B ):
57 return A.eval(x) +
B.eval(x);
63 template <
typename Scalar,
64 class Exp1,
class Spec1,
65 class Exp2,
class Spec2>
72 template <
int idx,
typename Scalar,
73 class Exp1,
class Spec1,
74 class Exp2,
class Spec2>
78 return get<idx>( sum.A ) + get<idx>( sum.B );
83 template <
typename Scalar,
class Exp1,
class Spec1,
class Exp2,
class Spec2>
91 static_cast<Exp1 const&>(A),
92 static_cast<Exp2 const&>(B));
expression template for sum of two matrix expressions
intlist::make_union< Spec1, Spec2 >::result result
expression template for rvalues
__host__ __device__ Sum(Exp1 const &A, Exp2 const &B)
__host__ __device__ Scalar eval(Scalar x)
__host__ __device__ __forceinline__ ScalarSum< Scalar, Exp, Spec > operator+(const Scalar &a, RValue< Scalar, Exp, Spec > const &B)
strip_dups< typename merge_sort< typename join< IntList1, IntList2 >::result >::result >::result result