aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/householder.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-01-14 19:16:49 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-01-14 19:16:49 -0500
commitf1d1756cdde229b701cb23702b43763e39d8d8f5 (patch)
treef16fcb47b263547c92853c5db398443df6752d61 /test/householder.cpp
parent5d796e363c6fa367647e8f3be386788b8210eb5f (diff)
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.
Diffstat (limited to 'test/householder.cpp')
-rw-r--r--test/householder.cpp22
1 files changed, 5 insertions, 17 deletions
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<typename MatrixType> void householder(const MatrixType& m)
m5.block(shift,0,brows,cols).template triangularView<StrictlyLower>().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<HBlockMatrixType> qr(hbm);
- m2 = m1;
- m2.block(shift,0,brows,cols) = qr.matrixQR();
- HCoeffsVectorType hc = qr.hCoeffs().conjugate();
- HouseholderSequence<MatrixType, HCoeffsVectorType> hseq(m2, hc, false, hc.size(), shift);
- MatrixType m5 = m2;
- m5.block(shift,0,brows,cols).template triangularView<StrictlyLower>().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<TMatrixType, HCoeffsVectorType, OnTheRight> 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()