Fix HouseholderSequence::conjugate() and ::adjoint() and add respective unit tests.

This commit is contained in:
Gael Guennebaud
2013-06-17 00:14:42 +02:00
parent 9f11f80db1
commit 55365566b2
8 changed files with 31 additions and 9 deletions

View File

@@ -16,6 +16,7 @@ template<typename MatrixType> void upperbidiag(const MatrixType& m)
const typename MatrixType::Index cols = m.cols();
typedef Matrix<typename MatrixType::RealScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime> RealMatrixType;
typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime, MatrixType::RowsAtCompileTime> TransposeMatrixType;
MatrixType a = MatrixType::Random(rows,cols);
internal::UpperBidiagonalization<MatrixType> ubd(a);
@@ -24,6 +25,8 @@ template<typename MatrixType> void upperbidiag(const MatrixType& m)
b.block(0,0,cols,cols) = ubd.bidiagonal();
MatrixType c = ubd.householderU() * b * ubd.householderV().adjoint();
VERIFY_IS_APPROX(a,c);
TransposeMatrixType d = ubd.householderV() * b.adjoint() * ubd.householderU().adjoint();
VERIFY_IS_APPROX(a.adjoint(),d);
}
void test_upperbidiagonalization()