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");
33 if(this->isCompressed())
39 template<
typename _Scalar,
int _Options,
typename _Index>
43 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
49 #endif // EIGEN_SPARSEREDUX_H Scalar sum() const
Overloaded for performance.
Definition: SparseRedux.h:30
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Scalar sum() const
Overloaded for performance.
Definition: SparseRedux.h:41
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:178
Definition: ForwardDeclarations.h:17