10 #ifndef EIGEN_SPARSEREDUX_H
11 #define EIGEN_SPARSEREDUX_H
15 template<
typename Derived>
16 typename internal::traits<Derived>::Scalar
17 SparseMatrixBase<Derived>::sum()
const
19 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
21 internal::evaluator<Derived> thisEval(derived());
22 for (Index j=0; j<outerSize(); ++j)
23 for (
typename internal::evaluator<Derived>::InnerIterator iter(thisEval,j); iter; ++iter)
28 template<
typename _Scalar,
int _Options,
typename _Index>
29 typename internal::traits<SparseMatrix<_Scalar,_Options,_Index> >::Scalar
32 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
36 template<
typename _Scalar,
int _Options,
typename _Index>
37 typename internal::traits<SparseVector<_Scalar,_Options, _Index> >::Scalar
40 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
46 #endif // EIGEN_SPARSEREDUX_H
Scalar sum() const
Definition: SparseRedux.h:38
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:178
Scalar sum() const
Definition: SparseRedux.h:30