From 0590c18555bd5d195e29ee6a131285cf0f80f9d1 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 27 Jul 2009 13:17:39 +0200 Subject: various compilation and bug fixes in selfadjoint stuff --- test/product_selfadjoint.cpp | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'test/product_selfadjoint.cpp') diff --git a/test/product_selfadjoint.cpp b/test/product_selfadjoint.cpp index efa487ab1..e47358197 100644 --- a/test/product_selfadjoint.cpp +++ b/test/product_selfadjoint.cpp @@ -52,42 +52,23 @@ template void product_selfadjoint(const MatrixType& m) m1 = (m1.adjoint() + m1).eval(); - // lower - m2 = m1.template triangularView(); - VERIFY_IS_APPROX(v3 = (s1*m2).template selfadjointView() * (s2*v1), (s1*m1) * (s2*v1)); - VERIFY_IS_APPROX(v3 = (s1*m2.conjugate()).template selfadjointView() * (s2*v1), (s1*m1.conjugate()) * (s2*v1)); - VERIFY_IS_APPROX(v3 = (s1*m2).template selfadjointView() * (s2*m4.col(1)), (s1*m1) * (s2*m4.col(1))); - - VERIFY_IS_APPROX(v3 = (s1*m2).template selfadjointView() * (s2*v1.conjugate()), (s1*m1) * (s2*v1.conjugate())); - VERIFY_IS_APPROX(v3 = (s1*m2.conjugate()).template selfadjointView() * (s2*v1.conjugate()), (s1*m1.conjugate()) * (s2*v1.conjugate())); - - // upper - m2 = m1.template triangularView(); - VERIFY_IS_APPROX(v3 = (s1*m2).template selfadjointView() * (s2*v1), (s1*m1) * (s2*v1)); - VERIFY_IS_APPROX(v3 = (s1*m2.conjugate()).template selfadjointView() * (s2*v1), (s1*m1.conjugate()) * (s2*v1)); - VERIFY_IS_APPROX(v3 = (s1*m2.adjoint()).template selfadjointView() * (s2*v1), (s1*m1.adjoint()) * (s2*v1)); - VERIFY_IS_APPROX(v3 = (s1*m2.transpose()).template selfadjointView() * (s2*v1), (s1*m1.transpose()) * (s2*v1)); - - VERIFY_IS_APPROX(v3 = (s1*m2).template selfadjointView() * (s2*v1.conjugate()), (s1*m1) * (s2*v1.conjugate())); - VERIFY_IS_APPROX(v3 = (s1*m2.conjugate()).template selfadjointView() * (s2*v1.conjugate()), (s1*m1.conjugate()) * (s2*v1.conjugate())); - // rank2 update m2 = m1.template triangularView(); - m2.template selfadjointView().rank2update(v1,v2); + m2.template selfadjointView().rankUpdate(v1,v2); VERIFY_IS_APPROX(m2, (m1 + v1 * v2.adjoint()+ v2 * v1.adjoint()).template triangularView().toDense()); m2 = m1.template triangularView(); - m2.template selfadjointView().rank2update(-v1,s2*v2,s3); + m2.template selfadjointView().rankUpdate(-v1,s2*v2,s3); VERIFY_IS_APPROX(m2, (m1 + (-s2*s3) * (v1 * v2.adjoint()+ v2 * v1.adjoint())).template triangularView().toDense()); m2 = m1.template triangularView(); - m2.template selfadjointView().rank2update(-r1.adjoint(),r2.adjoint()*s3,s1); + m2.template selfadjointView().rankUpdate(-r1.adjoint(),r2.adjoint()*s3,s1); VERIFY_IS_APPROX(m2, (m1 + (-s3*s1) * (r1.adjoint() * r2 + r2.adjoint() * r1)).template triangularView().toDense()); if (rows>1) { m2 = m1.template triangularView(); - m2.block(1,1,rows-1,cols-1).template selfadjointView().rank2update(v1.end(rows-1),v2.start(cols-1)); + m2.block(1,1,rows-1,cols-1).template selfadjointView().rankUpdate(v1.end(rows-1),v2.start(cols-1)); m3 = m1; m3.block(1,1,rows-1,cols-1) += v1.end(rows-1) * v2.start(cols-1).adjoint()+ v2.start(cols-1) * v1.end(rows-1).adjoint(); VERIFY_IS_APPROX(m2, m3.template triangularView().toDense()); -- cgit v1.2.3