aboutsummaryrefslogtreecommitdiff
path: root/test/bdcsvd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/bdcsvd.cpp')
-rw-r--r--test/bdcsvd.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/bdcsvd.cpp b/test/bdcsvd.cpp
index f9f687aac..e92a7dc97 100644
--- a/test/bdcsvd.cpp
+++ b/test/bdcsvd.cpp
@@ -28,9 +28,13 @@
template<typename MatrixType>
void bdcsvd(const MatrixType& a = MatrixType(), bool pickrandom = true)
{
- MatrixType m = a;
- if(pickrandom)
+ MatrixType m;
+ if(pickrandom) {
+ m.resizeLike(a);
svd_fill_random(m);
+ }
+ else
+ m = a;
CALL_SUBTEST(( svd_test_all_computation_options<BDCSVD<MatrixType> >(m, false) ));
}
@@ -46,6 +50,8 @@ void bdcsvd_method()
VERIFY_RAISES_ASSERT(m.bdcSvd().matrixU());
VERIFY_RAISES_ASSERT(m.bdcSvd().matrixV());
VERIFY_IS_APPROX(m.bdcSvd(ComputeFullU|ComputeFullV).solve(m), m);
+ VERIFY_IS_APPROX(m.bdcSvd(ComputeFullU|ComputeFullV).transpose().solve(m), m);
+ VERIFY_IS_APPROX(m.bdcSvd(ComputeFullU|ComputeFullV).adjoint().solve(m), m);
}
// compare the Singular values returned with Jacobi and Bdc
@@ -62,7 +68,7 @@ void compare_bdc_jacobi(const MatrixType& a = MatrixType(), unsigned int computa
if(computationOptions & ComputeThinV) VERIFY_IS_APPROX(bdc_svd.matrixV(), jacobi_svd.matrixV());
}
-void test_bdcsvd()
+EIGEN_DECLARE_TEST(bdcsvd)
{
CALL_SUBTEST_3(( svd_verify_assert<BDCSVD<Matrix3f> >(Matrix3f()) ));
CALL_SUBTEST_4(( svd_verify_assert<BDCSVD<Matrix4d> >(Matrix4d()) ));
@@ -104,7 +110,8 @@ void test_bdcsvd()
CALL_SUBTEST_7( BDCSVD<MatrixXf>(10,10) );
// Check that preallocation avoids subsequent mallocs
- CALL_SUBTEST_9( svd_preallocate<void>() );
+ // Disabled because not supported by BDCSVD
+ // CALL_SUBTEST_9( svd_preallocate<void>() );
CALL_SUBTEST_2( svd_underoverflow<void>() );
}