10 #ifndef EIGEN_SPARSEREDUX_H
11 #define EIGEN_SPARSEREDUX_H
13 #include "./InternalHeaderCheck.h"
17 template<
typename Derived>
18 typename internal::traits<Derived>::Scalar
19 SparseMatrixBase<Derived>::sum()
const
21 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
23 internal::evaluator<Derived> thisEval(derived());
24 for (
Index j=0; j<outerSize(); ++j)
25 for (
typename internal::evaluator<Derived>::InnerIterator iter(thisEval,j); iter; ++iter)
30 template<
typename Scalar_,
int Options_,
typename Index_>
31 typename internal::traits<SparseMatrix<Scalar_,Options_,Index_> >::Scalar
34 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
35 if(this->isCompressed())
41 template<
typename Scalar_,
int Options_,
typename Index_>
42 typename internal::traits<SparseVector<Scalar_,Options_, Index_> >::Scalar
45 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
static ConstMapType Map(const Scalar *data)
Definition: PlainObjectBase.h:642
Scalar sum() const
Definition: SparseRedux.h:32
Scalar sum() const
Definition: SparseRedux.h:43
Namespace containing all symbols from the Eigen library.
Definition: Core:139
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:59