diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-06-25 17:24:43 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-06-25 17:24:43 +0200 |
commit | a7bd4c455acbf19166e91f2148c042c3f2ea946e (patch) | |
tree | 38b46239864f799a5624fe23186b2ed30844e51d /Eigen/src/SparseCore/SparseDot.h | |
parent | b868bfb84a4a86231bb338e9bcf08afd882d32dc (diff) |
Update sparse reduxions and sparse-vectors to evaluators.
Diffstat (limited to 'Eigen/src/SparseCore/SparseDot.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseDot.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Eigen/src/SparseCore/SparseDot.h b/Eigen/src/SparseCore/SparseDot.h index db39c9aec..a63cb003c 100644 --- a/Eigen/src/SparseCore/SparseDot.h +++ b/Eigen/src/SparseCore/SparseDot.h @@ -26,7 +26,12 @@ SparseMatrixBase<Derived>::dot(const MatrixBase<OtherDerived>& other) const eigen_assert(size() == other.size()); eigen_assert(other.size()>0 && "you are using a non initialized vector"); +#ifndef EIGEN_TEST_EVALUATORS typename Derived::InnerIterator i(derived(),0); +#else + typename internal::evaluator<Derived>::type thisEval(derived()); + typename internal::evaluator<Derived>::InnerIterator i(thisEval, 0); +#endif Scalar res(0); while (i) { @@ -49,6 +54,7 @@ SparseMatrixBase<Derived>::dot(const SparseMatrixBase<OtherDerived>& other) cons eigen_assert(size() == other.size()); +#ifndef EIGEN_TEST_EVALUATORS typedef typename Derived::Nested Nested; typedef typename OtherDerived::Nested OtherNested; typedef typename internal::remove_all<Nested>::type NestedCleaned; @@ -59,6 +65,13 @@ SparseMatrixBase<Derived>::dot(const SparseMatrixBase<OtherDerived>& other) cons typename NestedCleaned::InnerIterator i(nthis,0); typename OtherNestedCleaned::InnerIterator j(nother,0); +#else + typename internal::evaluator<Derived>::type thisEval(derived()); + typename internal::evaluator<Derived>::InnerIterator i(thisEval, 0); + + typename internal::evaluator<OtherDerived>::type otherEval(other.derived()); + typename internal::evaluator<OtherDerived>::InnerIterator j(otherEval, 0); +#endif Scalar res(0); while (i && j) { |