aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-07-22 23:48:42 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-07-22 23:48:42 +0200
commitf696efc00ed3a74334a263d81b60c662a7e3ab63 (patch)
tree1de0c06211f9f8132f03afeea23e831251f4f244 /test
parent0cb4f32e12a190f43f794a8258661bade74f2eb2 (diff)
bugfix in SYMM
Diffstat (limited to 'test')
-rw-r--r--test/product_selfadjoint.cpp27
1 files changed, 16 insertions, 11 deletions
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<typename MatrixType> void symm(const MatrixType& m)
Rhs2 rhs2 = Rhs2::Random(ei_random<int>(1,320), rows), rhs22, rhs23;
Rhs3 rhs3 = Rhs3::Random(cols, ei_random<int>(1,320)), rhs32, rhs33;
-// Scalar s1 = ei_random<Scalar>(),
-// s2 = ei_random<Scalar>();
+ Scalar s1 = ei_random<Scalar>(),
+ s2 = ei_random<Scalar>();
m2 = m1.template triangularView<LowerTriangular>();
- VERIFY_IS_APPROX(rhs12 = m2.template selfadjointView<LowerTriangular>() * rhs1, rhs13 = m1 * rhs1);
+ VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<LowerTriangular>() * (s2*rhs1),
+ rhs13 = (s1*m1) * (s2*rhs1));
m2 = m1.template triangularView<UpperTriangular>();
- VERIFY_IS_APPROX(rhs12 = m2.template selfadjointView<UpperTriangular>() * rhs1, rhs13 = m1 * rhs1);
+ VERIFY_IS_APPROX(rhs12 = (s1*m2).template selfadjointView<UpperTriangular>() * (s2*rhs1),
+ rhs13 = (s1*m1) * (s2*rhs1));
m2 = m1.template triangularView<LowerTriangular>();
- VERIFY_IS_APPROX(rhs22 = m2.template selfadjointView<LowerTriangular>() * rhs2.adjoint(), rhs23 = m1 * rhs2.adjoint());
+ VERIFY_IS_APPROX(rhs22 = (s1*m2).template selfadjointView<LowerTriangular>() * (s2*rhs2.adjoint()),
+ rhs23 = (s1*m1) * (s2*rhs2.adjoint()));
m2 = m1.template triangularView<UpperTriangular>();
- VERIFY_IS_APPROX(rhs22 = m2.template selfadjointView<UpperTriangular>() * rhs2.adjoint(), rhs23 = m1 * rhs2.adjoint());
+ VERIFY_IS_APPROX(rhs22 = (s1*m2).template selfadjointView<UpperTriangular>() * (s2*rhs2.adjoint()),
+ rhs23 = (s1*m1) * (s2*rhs2.adjoint()));
m2 = m1.template triangularView<UpperTriangular>();
- VERIFY_IS_APPROX(rhs22 = m2.adjoint().template selfadjointView<LowerTriangular>() * rhs2.adjoint(),
- rhs23 = m1.adjoint() * rhs2.adjoint());
+ VERIFY_IS_APPROX(rhs22 = (s1*m2.adjoint()).template selfadjointView<LowerTriangular>() * (s2*rhs2.adjoint()),
+ rhs23 = (s1*m1.adjoint()) * (s2*rhs2.adjoint()));
// test row major = <...>
m2 = m1.template triangularView<LowerTriangular>();
- VERIFY_IS_APPROX(rhs32 = m2.template selfadjointView<LowerTriangular>() * rhs3, rhs33 = m1 * rhs3);
+ VERIFY_IS_APPROX(rhs32 = (s1*m2).template selfadjointView<LowerTriangular>() * (s2*rhs3),
+ rhs33 = (s1*m1) * (s2 * rhs3));
m2 = m1.template triangularView<UpperTriangular>();
- VERIFY_IS_APPROX(rhs32 = m2.adjoint().template selfadjointView<LowerTriangular>() * rhs3.conjugate(),
- rhs33 = m1.adjoint() * rhs3.conjugate());
+ VERIFY_IS_APPROX(rhs32 = (s1*m2.adjoint()).template selfadjointView<LowerTriangular>() * (s2*rhs3).conjugate(),
+ rhs33 = (s1*m1.adjoint()) * (s2*rhs3).conjugate());
}
void test_product_selfadjoint()
{