aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore/SparseProduct.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-10-26 22:50:41 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-10-26 22:50:41 +0200
commit3ecb343dc3f0be6c60654cec581d0f3145553238 (patch)
treead1f322152f69276dcd0a4e370c7e5901c9d3068 /Eigen/src/SparseCore/SparseProduct.h
parent97feea9d39ccaf298082cd537e85c311bf354010 (diff)
Fix regression in X = (X*X.transpose())/s with X rectangular by deferring resizing of the destination after the creation of the evaluator of the source expression.
Diffstat (limited to 'Eigen/src/SparseCore/SparseProduct.h')
-rw-r--r--Eigen/src/SparseCore/SparseProduct.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Eigen/src/SparseCore/SparseProduct.h b/Eigen/src/SparseCore/SparseProduct.h
index 7a5ad0635..4cbf68781 100644
--- a/Eigen/src/SparseCore/SparseProduct.h
+++ b/Eigen/src/SparseCore/SparseProduct.h
@@ -104,6 +104,11 @@ struct Assignment<DstXprType, Product<Lhs,Rhs,AliasFreeProduct>, internal::assig
typedef Product<Lhs,Rhs,AliasFreeProduct> SrcXprType;
static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op<typename DstXprType::Scalar,typename SrcXprType::Scalar> &)
{
+ Index dstRows = src.rows();
+ Index dstCols = src.cols();
+ if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
+ dst.resize(dstRows, dstCols);
+
generic_product_impl<Lhs, Rhs>::evalTo(dst,src.lhs(),src.rhs());
}
};