mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #1343: fix compilation regression in mat+=selfadjoint_view.
Generic EigenBase2EigenBase assignment was incomplete.
(grafted from 8193ffb3d3
)
This commit is contained in:
@@ -21,7 +21,9 @@ template<typename MatrixType> void selfadjoint(const MatrixType& m)
|
||||
Index cols = m.cols();
|
||||
|
||||
MatrixType m1 = MatrixType::Random(rows, cols),
|
||||
m3(rows, cols);
|
||||
m2 = MatrixType::Random(rows, cols),
|
||||
m3(rows, cols),
|
||||
m4(rows, cols);
|
||||
|
||||
m1.diagonal() = m1.diagonal().real().template cast<Scalar>();
|
||||
|
||||
@@ -30,10 +32,19 @@ template<typename MatrixType> void selfadjoint(const MatrixType& m)
|
||||
VERIFY_IS_APPROX(MatrixType(m3.template triangularView<Upper>()), MatrixType(m1.template triangularView<Upper>()));
|
||||
VERIFY_IS_APPROX(m3, m3.adjoint());
|
||||
|
||||
|
||||
m3 = m1.template selfadjointView<Lower>();
|
||||
VERIFY_IS_APPROX(MatrixType(m3.template triangularView<Lower>()), MatrixType(m1.template triangularView<Lower>()));
|
||||
VERIFY_IS_APPROX(m3, m3.adjoint());
|
||||
|
||||
m3 = m1.template selfadjointView<Upper>();
|
||||
m4 = m2;
|
||||
m4 += m1.template selfadjointView<Upper>();
|
||||
VERIFY_IS_APPROX(m4, m2+m3);
|
||||
|
||||
m3 = m1.template selfadjointView<Lower>();
|
||||
m4 = m2;
|
||||
m4 -= m1.template selfadjointView<Lower>();
|
||||
VERIFY_IS_APPROX(m4, m2-m3);
|
||||
}
|
||||
|
||||
void bug_159()
|
||||
|
||||
Reference in New Issue
Block a user