mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-06 02:34:05 +08:00
Fix regression in sparse-sparse product
This commit is contained in:
parent
f9580a3473
commit
1bf3b34849
@ -151,18 +151,19 @@ struct conservative_sparse_sparse_product_selector<Lhs,Rhs,ResultType,ColMajor,C
|
|||||||
typedef SparseMatrix<typename ResultType::Scalar,ColMajor,typename ResultType::Index> ColMajorMatrixAux;
|
typedef SparseMatrix<typename ResultType::Scalar,ColMajor,typename ResultType::Index> ColMajorMatrixAux;
|
||||||
typedef typename sparse_eval<ColMajorMatrixAux,ResultType::RowsAtCompileTime,ResultType::ColsAtCompileTime>::type ColMajorMatrix;
|
typedef typename sparse_eval<ColMajorMatrixAux,ResultType::RowsAtCompileTime,ResultType::ColsAtCompileTime>::type ColMajorMatrix;
|
||||||
|
|
||||||
ColMajorMatrix resCol(lhs.rows(),rhs.cols());
|
|
||||||
// FIXME, the following heuristic is probably not very good.
|
// FIXME, the following heuristic is probably not very good.
|
||||||
if(lhs.rows()>=rhs.cols())
|
if(lhs.rows()>=rhs.cols())
|
||||||
{
|
{
|
||||||
|
ColMajorMatrix resCol(lhs.rows(),rhs.cols());
|
||||||
// perform sorted insertion
|
// perform sorted insertion
|
||||||
internal::conservative_sparse_sparse_product_impl<Lhs,Rhs,ColMajorMatrix>(lhs, rhs, resCol, true);
|
internal::conservative_sparse_sparse_product_impl<Lhs,Rhs,ColMajorMatrix>(lhs, rhs, resCol, true);
|
||||||
res = resCol.markAsRValue();
|
res = resCol.markAsRValue();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ColMajorMatrixAux resCol(lhs.rows(),rhs.cols());
|
||||||
// ressort to transpose to sort the entries
|
// ressort to transpose to sort the entries
|
||||||
internal::conservative_sparse_sparse_product_impl<Lhs,Rhs,ColMajorMatrix>(lhs, rhs, resCol, false);
|
internal::conservative_sparse_sparse_product_impl<Lhs,Rhs,ColMajorMatrixAux>(lhs, rhs, resCol, false);
|
||||||
RowMajorMatrix resRow(resCol);
|
RowMajorMatrix resRow(resCol);
|
||||||
res = resRow.markAsRValue();
|
res = resRow.markAsRValue();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user