mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 03:39:01 +08:00
bug #37: fix resizing when the destination sparse matrix is row major
This commit is contained in:
parent
c6c6c34909
commit
5d1263e7c5
@ -133,7 +133,12 @@ static void sparse_product_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res)
|
||||
float avgNnzPerRhsColumn = float(rhs.nonZeros())/float(cols);
|
||||
float ratioRes = std::min(ratioLhs * avgNnzPerRhsColumn, 1.f);
|
||||
|
||||
res.resize(rows, cols);
|
||||
// mimics a resizeByInnerOuter:
|
||||
if(ResultType::IsRowMajor)
|
||||
res.resize(cols, rows);
|
||||
else
|
||||
res.resize(rows, cols);
|
||||
|
||||
res.reserve(Index(ratioRes*rows*cols));
|
||||
for (Index j=0; j<cols; ++j)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user