10#ifndef EIGEN_SPARSEREDUX_H
11#define EIGEN_SPARSEREDUX_H
13#include "./InternalHeaderCheck.h"
17template<
typename Derived>
18typename internal::traits<Derived>::Scalar
19SparseMatrixBase<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)
30template<
typename Scalar_,
int Options_,
typename Index_>
31typename 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())
41template<
typename Scalar_,
int Options_,
typename Index_>
42typename 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:643
Scalar sum() const
Definition: SparseRedux.h:32
Scalar sum() const
Definition: SparseRedux.h:43
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:59