27 #ifndef MPBLOCKS_CUDA_LINALG2_MATRIX_H_
28 #define MPBLOCKS_CUDA_LINALG2_MATRIX_H_
39 template <
typename Scalar, Size_t ROWS, Size_t COLS, Size_t i, Size_t j>
47 template <
typename Scalar, Size_t ROWS, Size_t COLS, Size_t i>
56 template <
typename Scalar, Size_t ROWS, Size_t COLS>
61 template <
typename Scalar, Size_t ROWS, Size_t COLS, Size_t i>
66 template <
typename Scalar, Size_t ROWS, Size_t COLS>
69 public LValue< Scalar,ROWS,COLS, Matrix<Scalar,ROWS,COLS> >,
70 public RValue< Scalar,ROWS,COLS, Matrix<Scalar,ROWS,COLS> >
130 template <Size_t i, Size_t j>
139 template <Size_t i, Size_t j>
153 template <
typename Exp>
168 Scalar* buf = (Scalar*)(
this);
169 return buf[ROWS*COLS -1 - i];
175 Scalar* buf = (Scalar*)(
this);
176 return buf[ROWS*COLS -1 - i];
187 Scalar* buf = (Scalar*)(
this);
188 unsigned int off = 0;
192 off = ROWS + (COLS-1)*(ROWS-1-i) + (j-1);
194 if( off > ROWS*COLS-1 )
197 return buf[ROWS*COLS-1 - off];
203 Scalar* buf = (Scalar*)(
this);
204 unsigned int off = 0;
208 off = ROWS + (COLS-1)*(ROWS-1-i) + (j-1);
210 if( off > ROWS*COLS-1 )
213 return buf[ROWS*COLS-1 - off];
__device__ __host__ Scalar me() const
matrix accessor
__device__ __host__ Scalar & operator()(int i, int j)
dynamic accessor for matrix expressions
expression template for rvalues
LValue< Scalar, ROWS, COLS, Matrix_t > LValue_t
__device__ __host__ Scalar & me()
matrix accessor
__device__ __host__ Scalar ve() const
vector accessor
specialization for 0'th column, also inherits row
__device__ __host__ LValue< Scalar, ROWS, COLS, Exp > & operator=(RValue< Scalar, ROWS, COLS, Exp2 > const &B)
assignment
__device__ __host__ Matrix()
Default constructor.
__device__ __host__ Scalar const & operator[](int i) const
default template has column inheritence
Matrix< Scalar, ROWS, COLS > Matrix_t
__device__ __host__ Scalar & operator[](int i)
dynamic accessor for vector expressions
__device__ __host__ Scalar & ve()
vector accessor
__device__ __host__ Matrix(RValue< Scalar, ROWS, COLS, Exp > const &exp)
Construct from any MatrixExpression:
expression template for rvalues
__device__ __host__ Scalar gve() const
vector accessor
__device__ __host__ Scalar const & operator()(int i, int j) const
__device__ __host__ Scalar & sve()
vector accessor