| 11 | #include <Eigen/SVD> |
| 12 | |
| 13 | template<typename MatrixType> void upperbidiag(const MatrixType& m) |
| 14 | { |
| 15 | const Index rows = m.rows(); |
| 16 | const Index cols = m.cols(); |
| 17 | |
| 18 | typedef Matrix<typename MatrixType::RealScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime> RealMatrixType; |
| 19 | typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime, MatrixType::RowsAtCompileTime> TransposeMatrixType; |
| 20 | |
| 21 | MatrixType a = MatrixType::Random(rows,cols); |
| 22 | internal::UpperBidiagonalization<MatrixType> ubd(a); |
| 23 | RealMatrixType b(rows, cols); |
| 24 | b.setZero(); |
| 25 | b.block(0,0,cols,cols) = ubd.bidiagonal(); |
| 26 | MatrixType c = ubd.householderU() * b * ubd.householderV().adjoint(); |
| 27 | VERIFY_IS_APPROX(a,c); |
| 28 | TransposeMatrixType d = ubd.householderV() * b.adjoint() * ubd.householderU().adjoint(); |
| 29 | VERIFY_IS_APPROX(a.adjoint(),d); |
| 30 | } |
| 31 | |
| 32 | EIGEN_DECLARE_TEST(upperbidiagonalization) |
| 33 | { |
no test coverage detected