mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add transpose, adjoint, conjugate methods to SelfAdjointView (useful to write generic code)
(grafted from 684cfc762d
)
This commit is contained in:
@@ -39,6 +39,24 @@ template<typename Scalar, int Size, int OtherSize> void symm(int size = Size, in
|
||||
VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>() * (s2*rhs1),
|
||||
rhs13 = (s1*m1) * (s2*rhs1));
|
||||
|
||||
VERIFY_IS_APPROX(rhs12 = (s1*m2).transpose().template selfadjointView<Upper>() * (s2*rhs1),
|
||||
rhs13 = (s1*m1.transpose()) * (s2*rhs1));
|
||||
|
||||
VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>().transpose() * (s2*rhs1),
|
||||
rhs13 = (s1*m1.transpose()) * (s2*rhs1));
|
||||
|
||||
VERIFY_IS_APPROX(rhs12 = (s1*m2).conjugate().template selfadjointView<Lower>() * (s2*rhs1),
|
||||
rhs13 = (s1*m1).conjugate() * (s2*rhs1));
|
||||
|
||||
VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>().conjugate() * (s2*rhs1),
|
||||
rhs13 = (s1*m1).conjugate() * (s2*rhs1));
|
||||
|
||||
VERIFY_IS_APPROX(rhs12 = (s1*m2).adjoint().template selfadjointView<Upper>() * (s2*rhs1),
|
||||
rhs13 = (s1*m1).adjoint() * (s2*rhs1));
|
||||
|
||||
VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<Lower>().adjoint() * (s2*rhs1),
|
||||
rhs13 = (s1*m1).adjoint() * (s2*rhs1));
|
||||
|
||||
m2 = m1.template triangularView<Upper>(); rhs12.setRandom(); rhs13 = rhs12;
|
||||
m3 = m2.template selfadjointView<Upper>();
|
||||
VERIFY_IS_EQUAL(m1, m3);
|
||||
|
||||
Reference in New Issue
Block a user