27 #ifndef MPBLOCKS_CUDA_LINALG2_SUM_H_
28 #define MPBLOCKS_CUDA_LINALG2_SUM_H_
35 template <
typename Scalar, Size_t ROWS, Size_t COLS,
class Exp1,
class Exp2>
37 public RValue< Scalar, ROWS, COLS, Sum< Scalar, ROWS, COLS, Exp1, Exp2> >
44 Sum( Exp1
const& A, Exp2
const& B ):
54 return m_A.Exp1::template ve<i>()
55 +
m_B.Exp2::template ve<i>();
59 template< Size_t i, Size_t j >
63 return m_A.Exp1::template me<i,j>()
64 +
m_B.Exp2::template me<i,j>();
71 template <
typename Scalar, Size_t ROWS, Size_t COLS,
class Exp1,
class Exp2>
73 Sum< Scalar, ROWS, COLS, Exp1, Exp2 >
78 static_cast< Exp1 const&
>(A),
79 static_cast< Exp2 const& >(B) );
expression template for rvalues
expression template for sum of two expressions
__device__ __host__ Sum< Scalar, ROWS, COLS, Exp1, Exp2 > operator+(RValue< Scalar, ROWS, COLS, Exp1 > const &A, RValue< Scalar, ROWS, COLS, Exp2 > const &B)
__device__ __host__ Scalar me() const
return the evaluated (j,i)'th element of a matrix expression
__device__ __host__ Scalar ve() const
return the evaluated i'th element of a vector expression
__device__ __host__ Sum(Exp1 const &A, Exp2 const &B)