From f696efc00ed3a74334a263d81b60c662a7e3ab63 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 22 Jul 2009 23:48:42 +0200 Subject: bugfix in SYMM --- test/product_selfadjoint.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'test/product_selfadjoint.cpp') diff --git a/test/product_selfadjoint.cpp b/test/product_selfadjoint.cpp index eca1daacf..814d542e4 100644 --- a/test/product_selfadjoint.cpp +++ b/test/product_selfadjoint.cpp @@ -107,32 +107,37 @@ template void symm(const MatrixType& m) Rhs2 rhs2 = Rhs2::Random(ei_random(1,320), rows), rhs22, rhs23; Rhs3 rhs3 = Rhs3::Random(cols, ei_random(1,320)), rhs32, rhs33; -// Scalar s1 = ei_random(), -// s2 = ei_random(); + Scalar s1 = ei_random(), + s2 = ei_random(); m2 = m1.template triangularView(); - VERIFY_IS_APPROX(rhs12 = m2.template selfadjointView() * rhs1, rhs13 = m1 * rhs1); + VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView() * (s2*rhs1), + rhs13 = (s1*m1) * (s2*rhs1)); m2 = m1.template triangularView(); - VERIFY_IS_APPROX(rhs12 = m2.template selfadjointView() * rhs1, rhs13 = m1 * rhs1); + VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView() * (s2*rhs1), + rhs13 = (s1*m1) * (s2*rhs1)); m2 = m1.template triangularView(); - VERIFY_IS_APPROX(rhs22 = m2.template selfadjointView() * rhs2.adjoint(), rhs23 = m1 * rhs2.adjoint()); + VERIFY_IS_APPROX(rhs22 = (s1*m2).template selfadjointView() * (s2*rhs2.adjoint()), + rhs23 = (s1*m1) * (s2*rhs2.adjoint())); m2 = m1.template triangularView(); - VERIFY_IS_APPROX(rhs22 = m2.template selfadjointView() * rhs2.adjoint(), rhs23 = m1 * rhs2.adjoint()); + VERIFY_IS_APPROX(rhs22 = (s1*m2).template selfadjointView() * (s2*rhs2.adjoint()), + rhs23 = (s1*m1) * (s2*rhs2.adjoint())); m2 = m1.template triangularView(); - VERIFY_IS_APPROX(rhs22 = m2.adjoint().template selfadjointView() * rhs2.adjoint(), - rhs23 = m1.adjoint() * rhs2.adjoint()); + VERIFY_IS_APPROX(rhs22 = (s1*m2.adjoint()).template selfadjointView() * (s2*rhs2.adjoint()), + rhs23 = (s1*m1.adjoint()) * (s2*rhs2.adjoint())); // test row major = <...> m2 = m1.template triangularView(); - VERIFY_IS_APPROX(rhs32 = m2.template selfadjointView() * rhs3, rhs33 = m1 * rhs3); + VERIFY_IS_APPROX(rhs32 = (s1*m2).template selfadjointView() * (s2*rhs3), + rhs33 = (s1*m1) * (s2 * rhs3)); m2 = m1.template triangularView(); - VERIFY_IS_APPROX(rhs32 = m2.adjoint().template selfadjointView() * rhs3.conjugate(), - rhs33 = m1.adjoint() * rhs3.conjugate()); + VERIFY_IS_APPROX(rhs32 = (s1*m2.adjoint()).template selfadjointView() * (s2*rhs3).conjugate(), + rhs33 = (s1*m1.adjoint()) * (s2*rhs3).conjugate()); } void test_product_selfadjoint() { -- cgit v1.2.3