From f1d1756cdde229b701cb23702b43763e39d8d8f5 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 14 Jan 2010 19:16:49 -0500 Subject: Introduce third template parameter to HouseholderSequence: int Side. When it's OnTheRight, we read householder vectors as rows above the diagonal. With unit test. The use case will be bidiagonalization. --- test/householder.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'test/householder.cpp') diff --git a/test/householder.cpp b/test/householder.cpp index c4c95e648..d98780872 100644 --- a/test/householder.cpp +++ b/test/householder.cpp @@ -106,27 +106,15 @@ template void householder(const MatrixType& m) m5.block(shift,0,brows,cols).template triangularView().setZero(); VERIFY_IS_APPROX(hseq * m5, m1); // test applying hseq directly m3 = hseq; - VERIFY_IS_APPROX(m3*m5, m1); // test evaluating hseq to a dense matrix, then applying + VERIFY_IS_APPROX(m3 * m5, m1); // test evaluating hseq to a dense matrix, then applying -#if 0 // test householder sequence on the right with a shift - TMatrixType tm1 = m1.transpose(); TMatrixType tm2 = m2.transpose(); - - int bcols = cols - shift; - VBlockMatrixType vbm = - HouseholderQR qr(hbm); - m2 = m1; - m2.block(shift,0,brows,cols) = qr.matrixQR(); - HCoeffsVectorType hc = qr.hCoeffs().conjugate(); - HouseholderSequence hseq(m2, hc, false, hc.size(), shift); - MatrixType m5 = m2; - m5.block(shift,0,brows,cols).template triangularView().setZero(); - VERIFY_IS_APPROX(hseq * m5, m1); // test applying hseq directly - m3 = hseq; - VERIFY_IS_APPROX(m3*m5, m1); // test evaluating hseq to a dense matrix, then applying -#endif + HouseholderSequence rhseq(tm2, hc, false, hc.size(), shift); + VERIFY_IS_APPROX(rhseq * m5, m1); // test applying rhseq directly + m3 = rhseq; + VERIFY_IS_APPROX(m3 * m5, m1); // test evaluating rhseq to a dense matrix, then applying } void test_householder() -- cgit v1.2.3