mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-30 15:54:13 +08:00
Operators += and -= do not resize!
This commit is contained in:
parent
8dfb3e00b8
commit
fe696022ec
@ -158,10 +158,7 @@ struct Assignment<DstXprType, Product<Lhs,Rhs,Options>, internal::add_assign_op<
|
|||||||
static EIGEN_STRONG_INLINE
|
static EIGEN_STRONG_INLINE
|
||||||
void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op<Scalar,Scalar> &)
|
void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op<Scalar,Scalar> &)
|
||||||
{
|
{
|
||||||
Index dstRows = src.rows();
|
eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
|
||||||
Index dstCols = src.cols();
|
|
||||||
if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
|
|
||||||
dst.resize(dstRows, dstCols);
|
|
||||||
// FIXME shall we handle nested_eval here?
|
// FIXME shall we handle nested_eval here?
|
||||||
generic_product_impl<Lhs, Rhs>::addTo(dst, src.lhs(), src.rhs());
|
generic_product_impl<Lhs, Rhs>::addTo(dst, src.lhs(), src.rhs());
|
||||||
}
|
}
|
||||||
@ -176,10 +173,7 @@ struct Assignment<DstXprType, Product<Lhs,Rhs,Options>, internal::sub_assign_op<
|
|||||||
static EIGEN_STRONG_INLINE
|
static EIGEN_STRONG_INLINE
|
||||||
void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op<Scalar,Scalar> &)
|
void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op<Scalar,Scalar> &)
|
||||||
{
|
{
|
||||||
Index dstRows = src.rows();
|
eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
|
||||||
Index dstCols = src.cols();
|
|
||||||
if((dst.rows()!=dstRows) || (dst.cols()!=dstCols))
|
|
||||||
dst.resize(dstRows, dstCols);
|
|
||||||
// FIXME shall we handle nested_eval here?
|
// FIXME shall we handle nested_eval here?
|
||||||
generic_product_impl<Lhs, Rhs>::subTo(dst, src.lhs(), src.rhs());
|
generic_product_impl<Lhs, Rhs>::subTo(dst, src.lhs(), src.rhs());
|
||||||
}
|
}
|
||||||
@ -377,7 +371,6 @@ struct generic_product_impl<Lhs,Rhs,DenseShape,DenseShape,GemvProduct>
|
|||||||
{
|
{
|
||||||
LhsNested actual_lhs(lhs);
|
LhsNested actual_lhs(lhs);
|
||||||
RhsNested actual_rhs(rhs);
|
RhsNested actual_rhs(rhs);
|
||||||
|
|
||||||
internal::gemv_dense_selector<Side,
|
internal::gemv_dense_selector<Side,
|
||||||
(int(MatrixType::Flags)&RowMajorBit) ? RowMajor : ColMajor,
|
(int(MatrixType::Flags)&RowMajorBit) ? RowMajor : ColMajor,
|
||||||
bool(internal::blas_traits<MatrixType>::HasUsableDirectAccess)
|
bool(internal::blas_traits<MatrixType>::HasUsableDirectAccess)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user