mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-20 03:44:26 +08:00
honor nested types in dense * sparse
This commit is contained in:
parent
ed244e9c1a
commit
27d222d23e
@ -163,12 +163,10 @@ class SparseTimeDenseProduct
|
|||||||
|
|
||||||
template<typename Dest> void scaleAndAddTo(Dest& dest, Scalar alpha) const
|
template<typename Dest> void scaleAndAddTo(Dest& dest, Scalar alpha) const
|
||||||
{
|
{
|
||||||
typedef typename internal::remove_all<Lhs>::type _Lhs;
|
typedef typename _LhsNested::InnerIterator LhsInnerIterator;
|
||||||
typedef typename internal::remove_all<Rhs>::type _Rhs;
|
|
||||||
typedef typename _Lhs::InnerIterator LhsInnerIterator;
|
|
||||||
enum {
|
enum {
|
||||||
LhsIsRowMajor = (_Lhs::Flags&RowMajorBit)==RowMajorBit,
|
LhsIsRowMajor = (_LhsNested::Flags&RowMajorBit)==RowMajorBit,
|
||||||
RhsIsVector = Rhs::ColsAtCompileTime==1
|
RhsIsVector = _RhsNested::ColsAtCompileTime==1
|
||||||
};
|
};
|
||||||
Index j=0;
|
Index j=0;
|
||||||
for(j=0; j<m_lhs.outerSize(); ++j)
|
for(j=0; j<m_lhs.outerSize(); ++j)
|
||||||
@ -215,9 +213,8 @@ class DenseTimeSparseProduct
|
|||||||
|
|
||||||
template<typename Dest> void scaleAndAddTo(Dest& dest, Scalar alpha) const
|
template<typename Dest> void scaleAndAddTo(Dest& dest, Scalar alpha) const
|
||||||
{
|
{
|
||||||
typedef typename internal::remove_all<Rhs>::type _Rhs;
|
typedef typename _RhsNested::InnerIterator RhsInnerIterator;
|
||||||
typedef typename _Rhs::InnerIterator RhsInnerIterator;
|
enum { RhsIsRowMajor = (_RhsNested::Flags&RowMajorBit)==RowMajorBit };
|
||||||
enum { RhsIsRowMajor = (_Rhs::Flags&RowMajorBit)==RowMajorBit };
|
|
||||||
for(Index j=0; j<m_rhs.outerSize(); ++j)
|
for(Index j=0; j<m_rhs.outerSize(); ++j)
|
||||||
for(RhsInnerIterator i(m_rhs,j); i; ++i)
|
for(RhsInnerIterator i(m_rhs,j); i; ++i)
|
||||||
dest.col(RhsIsRowMajor ? i.index() : j) += (alpha*i.value()) * m_lhs.col(RhsIsRowMajor ? j : i.index());
|
dest.col(RhsIsRowMajor ? i.index() : j) += (alpha*i.value()) * m_lhs.col(RhsIsRowMajor ? j : i.index());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user