diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-12-22 14:01:06 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-12-22 14:01:06 +0100 |
commit | 2c03e6fccc274db665c6e4708f2cbde14813e826 (patch) | |
tree | 9b2ca1b7b59b7f1d6fb00f2f4d749d88ca890311 /Eigen/src/SparseCore/SparseDot.h | |
parent | 7f0484502328c1ee0ed6a3916d7f3aa4417237c1 (diff) |
evaluate 1D sparse expressions into SparseVector and make the sparse operator<< and dot honor nested types
Diffstat (limited to 'Eigen/src/SparseCore/SparseDot.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseDot.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Eigen/src/SparseCore/SparseDot.h b/Eigen/src/SparseCore/SparseDot.h index 132bb47f3..4c600362d 100644 --- a/Eigen/src/SparseCore/SparseDot.h +++ b/Eigen/src/SparseCore/SparseDot.h @@ -62,8 +62,16 @@ SparseMatrixBase<Derived>::dot(const SparseMatrixBase<OtherDerived>& other) cons eigen_assert(size() == other.size()); - typename Derived::InnerIterator i(derived(),0); - typename OtherDerived::InnerIterator j(other.derived(),0); + typedef typename Derived::Nested Nested; + typedef typename OtherDerived::Nested OtherNested; + typedef typename internal::remove_all<Nested>::type NestedCleaned; + typedef typename internal::remove_all<OtherNested>::type OtherNestedCleaned; + + const Nested nthis(derived()); + const OtherNested nother(other.derived()); + + typename NestedCleaned::InnerIterator i(nthis,0); + typename OtherNestedCleaned::InnerIterator j(nother,0); Scalar res(0); while (i && j) { |