mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 12:46:00 +08:00
fix dense=sparse*diagonal (there was an issue in the values returned by the .outer() function of the related iterators)
(transplanted from fec6df1f7dc4da6de865cc024c45aee5dbb64d88 )
This commit is contained in:
parent
749317561c
commit
2f0307cdb5
@ -126,11 +126,15 @@ class sparse_diagonal_product_inner_iterator_selector
|
|||||||
SparseInnerVectorSet<Rhs,1>,
|
SparseInnerVectorSet<Rhs,1>,
|
||||||
typename Lhs::DiagonalVectorType>::InnerIterator Base;
|
typename Lhs::DiagonalVectorType>::InnerIterator Base;
|
||||||
typedef typename Lhs::Index Index;
|
typedef typename Lhs::Index Index;
|
||||||
|
Index m_outer;
|
||||||
public:
|
public:
|
||||||
inline sparse_diagonal_product_inner_iterator_selector(
|
inline sparse_diagonal_product_inner_iterator_selector(
|
||||||
const SparseDiagonalProductType& expr, Index outer)
|
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>
|
template<typename Lhs, typename Rhs, typename SparseDiagonalProductType>
|
||||||
@ -160,11 +164,15 @@ class sparse_diagonal_product_inner_iterator_selector
|
|||||||
SparseInnerVectorSet<Lhs,1>,
|
SparseInnerVectorSet<Lhs,1>,
|
||||||
Transpose<const typename Rhs::DiagonalVectorType> >::InnerIterator Base;
|
Transpose<const typename Rhs::DiagonalVectorType> >::InnerIterator Base;
|
||||||
typedef typename Lhs::Index Index;
|
typedef typename Lhs::Index Index;
|
||||||
|
Index m_outer;
|
||||||
public:
|
public:
|
||||||
inline sparse_diagonal_product_inner_iterator_selector(
|
inline sparse_diagonal_product_inner_iterator_selector(
|
||||||
const SparseDiagonalProductType& expr, Index outer)
|
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
|
} // end namespace internal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user