mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix trmv regarding strided vectors and static allocation of temporaries
This commit is contained in:
@@ -71,7 +71,7 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
|
||||
VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c)));
|
||||
VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0,0,rows,cols)), (m1.array()*m1.array()).matrix());
|
||||
VERIFY_IS_APPROX((m1*m1.transpose())*m2, m1*(m1.transpose()*m2));
|
||||
|
||||
|
||||
m2.col(0).noalias() = m1 * m1.col(0);
|
||||
m2.col(0).noalias() -= m1.adjoint() * m1.col(0);
|
||||
m2.col(0).noalias() -= m1 * m1.row(0).adjoint();
|
||||
@@ -81,6 +81,36 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
|
||||
m2.row(0).noalias() -= m1.row(0) * m1.adjoint();
|
||||
m2.row(0).noalias() -= m1.col(0).adjoint() * m1;
|
||||
m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint();
|
||||
VERIFY_IS_APPROX(m2,m2);
|
||||
|
||||
m2.col(0).noalias() = m1.template triangularView<Upper>() * m1.col(0);
|
||||
m2.col(0).noalias() -= m1.adjoint().template triangularView<Upper>() * m1.col(0);
|
||||
m2.col(0).noalias() -= m1.template triangularView<Upper>() * m1.row(0).adjoint();
|
||||
m2.col(0).noalias() -= m1.adjoint().template triangularView<Upper>() * m1.row(0).adjoint();
|
||||
|
||||
m2.row(0).noalias() = m1.row(0) * m1.template triangularView<Upper>();
|
||||
m2.row(0).noalias() -= m1.row(0) * m1.adjoint().template triangularView<Upper>();
|
||||
m2.row(0).noalias() -= m1.col(0).adjoint() * m1.template triangularView<Upper>();
|
||||
m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint().template triangularView<Upper>();
|
||||
VERIFY_IS_APPROX(m2,m2);
|
||||
|
||||
m2.col(0).noalias() = m1.template selfadjointView<Upper>() * m1.col(0);
|
||||
m2.col(0).noalias() -= m1.adjoint().template selfadjointView<Upper>() * m1.col(0);
|
||||
m2.col(0).noalias() -= m1.template selfadjointView<Upper>() * m1.row(0).adjoint();
|
||||
m2.col(0).noalias() -= m1.adjoint().template selfadjointView<Upper>() * m1.row(0).adjoint();
|
||||
|
||||
m2.row(0).noalias() = m1.row(0) * m1.template selfadjointView<Upper>();
|
||||
m2.row(0).noalias() -= m1.row(0) * m1.adjoint().template selfadjointView<Upper>();
|
||||
m2.row(0).noalias() -= m1.col(0).adjoint() * m1.template selfadjointView<Upper>();
|
||||
m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint().template selfadjointView<Upper>();
|
||||
VERIFY_IS_APPROX(m2,m2);
|
||||
|
||||
// The following fancy matrix-matrix products are not safe yet regarding static allocation
|
||||
// m1 += m1.template triangularView<Upper>() * m2.col(;
|
||||
// m1.template selfadjointView<Lower>().rankUpdate(m2);
|
||||
// m1 += m1.template triangularView<Upper>() * m2;
|
||||
// m1 += m1.template selfadjointView<Lower>() * m2;
|
||||
// VERIFY_IS_APPROX(m1,m1);
|
||||
}
|
||||
|
||||
template<typename Scalar>
|
||||
|
||||
Reference in New Issue
Block a user