10#ifndef EIGEN_SPARSEREDUX_H
11#define EIGEN_SPARSEREDUX_H
15template<
typename Derived>
16typename internal::traits<Derived>::Scalar
17SparseMatrixBase<Derived>::sum()
const
19 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
21 for (Index j=0; j<outerSize(); ++j)
22 for (
typename Derived::InnerIterator iter(derived(),j); iter; ++iter)
27template<
typename _Scalar,
int _Options,
typename _Index>
28typename internal::traits<SparseMatrix<_Scalar,_Options,_Index> >::Scalar
29SparseMatrix<_Scalar,_Options,_Index>::sum()
const
31 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
32 if(this->isCompressed())
38template<
typename _Scalar,
int _Options,
typename _Index>
39typename internal::traits<SparseVector<_Scalar,_Options, _Index> >::Scalar
42 eigen_assert(rows()>0 && cols()>0 &&
"you are using a non initialized matrix");
static ConstMapType Map(const Scalar *data)
Definition PlainObjectBase.h:505
Scalar sum() const
Definition SparseRedux.h:40