diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-21 14:04:53 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-21 14:04:53 +0400 |
commit | 3411146984316c97f56543333a46f47aeb7f9d35 (patch) | |
tree | 5de608a3c18ff2a5459fd2191609dd882ad86213 /extern/Eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h | |
parent | 1781928f9d720fa1dc4811afb69935b35aa89878 (diff) |
Update Eigen to version 3.2.1
Main purpose of this is to have SparseLU solver which
we can use now as a replacement to opennl library.
Diffstat (limited to 'extern/Eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h')
-rw-r--r-- | extern/Eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/extern/Eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h b/extern/Eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h index 095bf6863fc..1bb590e64d4 100644 --- a/extern/Eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +++ b/extern/Eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h @@ -78,7 +78,11 @@ class SparseDiagonalProduct EIGEN_SPARSE_PUBLIC_INTERFACE(SparseDiagonalProduct) typedef internal::sparse_diagonal_product_inner_iterator_selector - <_LhsNested,_RhsNested,SparseDiagonalProduct,LhsMode,RhsMode> InnerIterator; + <_LhsNested,_RhsNested,SparseDiagonalProduct,LhsMode,RhsMode> InnerIterator; + + // We do not want ReverseInnerIterator for diagonal-sparse products, + // but this dummy declaration is needed to make diag * sparse * diag compile. + class ReverseInnerIterator; EIGEN_STRONG_INLINE SparseDiagonalProduct(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) @@ -118,19 +122,23 @@ class sparse_diagonal_product_inner_iterator_selector <Lhs,Rhs,SparseDiagonalProductType,SDP_IsDiagonal,SDP_IsSparseColMajor> : public CwiseBinaryOp< scalar_product_op<typename Lhs::Scalar>, - SparseInnerVectorSet<Rhs,1>, - typename Lhs::DiagonalVectorType>::InnerIterator + const typename Rhs::ConstInnerVectorReturnType, + const typename Lhs::DiagonalVectorType>::InnerIterator { typedef typename CwiseBinaryOp< scalar_product_op<typename Lhs::Scalar>, - SparseInnerVectorSet<Rhs,1>, - typename Lhs::DiagonalVectorType>::InnerIterator Base; + const typename Rhs::ConstInnerVectorReturnType, + const typename Lhs::DiagonalVectorType>::InnerIterator Base; typedef typename Lhs::Index Index; + Index m_outer; public: inline sparse_diagonal_product_inner_iterator_selector( const SparseDiagonalProductType& expr, Index outer) - : Base(expr.rhs().innerVector(outer) .cwiseProduct(expr.lhs().diagonal()), 0) + : Base(expr.rhs().innerVector(outer) .cwiseProduct(expr.lhs().diagonal()), 0), m_outer(outer) {} + + inline Index outer() const { return m_outer; } + inline Index col() const { return m_outer; } }; template<typename Lhs, typename Rhs, typename SparseDiagonalProductType> @@ -152,19 +160,23 @@ class sparse_diagonal_product_inner_iterator_selector <Lhs,Rhs,SparseDiagonalProductType,SDP_IsSparseRowMajor,SDP_IsDiagonal> : public CwiseBinaryOp< scalar_product_op<typename Rhs::Scalar>, - SparseInnerVectorSet<Lhs,1>, - Transpose<const typename Rhs::DiagonalVectorType> >::InnerIterator + const typename Lhs::ConstInnerVectorReturnType, + const Transpose<const typename Rhs::DiagonalVectorType> >::InnerIterator { typedef typename CwiseBinaryOp< scalar_product_op<typename Rhs::Scalar>, - SparseInnerVectorSet<Lhs,1>, - Transpose<const typename Rhs::DiagonalVectorType> >::InnerIterator Base; + const typename Lhs::ConstInnerVectorReturnType, + const Transpose<const typename Rhs::DiagonalVectorType> >::InnerIterator Base; typedef typename Lhs::Index Index; + Index m_outer; public: inline sparse_diagonal_product_inner_iterator_selector( const SparseDiagonalProductType& expr, Index outer) - : Base(expr.lhs().innerVector(outer) .cwiseProduct(expr.rhs().diagonal().transpose()), 0) + : Base(expr.lhs().innerVector(outer) .cwiseProduct(expr.rhs().diagonal().transpose()), 0), m_outer(outer) {} + + inline Index outer() const { return m_outer; } + inline Index row() const { return m_outer; } }; } // end namespace internal |