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>
40 typename internal::traits<SparseVector<_Scalar,_Options, _Index> >::Scalar
43 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
static ConstMapType Map(const Scalar *data)
Definition: PlainObjectBase.h:644
Scalar sum() const
Definition: SparseRedux.h:30
Scalar sum() const
Definition: SparseRedux.h:41
Namespace containing all symbols from the Eigen library.
Definition: Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74