27 #ifndef MPBLOCKS_CUDA_LINALG_SUM_H_
28 #define MPBLOCKS_CUDA_LINALG_SUM_H_
35 template <
typename Scalar,
class Exp1,
class Exp2>
37 public RValue<Scalar, Sum<Scalar,Exp1,Exp2> >
46 Sum( Exp1
const& A, Exp2
const& B ):
87 return (
m_A(i,j) +
m_B(i,j) );
94 template <
typename Scalar,
class Exp1,
class Exp2>
101 static_cast<Exp1 const&>(A),
102 static_cast<Exp2 const&>(B));
__device__ __host__ Sum< Scalar, Exp1, Exp2 > operator+(RValue< Scalar, Exp1 > const &A, RValue< Scalar, Exp2 > const &B)
__device__ __host__ Scalar operator[](Size_t i) const
return the evaluated i'th element of a vector expression
__device__ __host__ Sum(Exp1 const &A, Exp2 const &B)
__device__ __host__ Size_t rows() const
return the rows of a matrix expression
expression template for sum of two matrix expressions
__device__ __host__ Scalar operator()(Size_t i, Size_t j) const
return the evaluated (i,j)'th element of a matrix expression
expression template for rvalues
__device__ __host__ Size_t size() const
return the size for a vector
__device__ __host__ Size_t cols() const
return the columns of a matrix expression