27 #ifndef MPBLOCKS_CUDA_LINALG_RVALUE_H_
28 #define MPBLOCKS_CUDA_LINALG_RVALUE_H_
37 template <
typename Scalar,
class Exp>
class Scale;
40 template <
typename Scalar,
class Mat>
50 return static_cast<Mat const&
>(*this).size();
57 return static_cast<Mat const&
>(*this).rows();
64 return static_cast<Mat const&
>(*this).cols();
71 return static_cast<Mat const&
>(*this)[i];
78 return static_cast<Mat const&
>(*this)(i,j);
85 for(
int i=0; i <
size(); i++)
86 r += (*
this)[i] * (*this)[i];
99 Scalar scale = 1.0/
norm();
106 Scalar r = (*this)[0];
107 for(
int i=1; i <
size(); i++)
127 #endif // MATRIXEXPRESSION_H_
__device__ __host__ Scalar operator[](Size_t i) const
return the evaluated i'th element of a vector expression
__device__ __host__ Size_t cols() const
return the columns of a matrix expression
__device__ __host__ Size_t size() const
return the size for a vector
__device__ __host__ Scalar maxCoeff()
__device__ __host__ Scale< Scalar, Mat > normalized() const
__device__ __host__ Size_t rows() const
return the rows of a matrix expression
__device__ __host__ Scalar norm() const
expression template for rvalues
__device__ __host__ Scalar norm_squared() const
__device__ __host__ Scalar operator()(Size_t i, Size_t j) const
return the evaluated (i,j)'th element of a matrix expression
forward declared for normalized()