26 #include <tests/myratest.h> 34 myra::out() << typestring<Number>() << std::endl;
38 int K = I < J ? I : J;
41 const auto& U = USV.U;
42 const auto& S = USV.S;
43 const auto& V = USV.V;
45 Precision decomposition_error = frobenius(U*S*V-A);
46 myra::out() <<
" |U*S*V-A| = " << decomposition_error << std::endl;
47 REQUIRE(decomposition_error < tolerance);
50 myra::out() <<
" |U'U-I| = " << unitary_u << std::endl;
51 REQUIRE(unitary_u < tolerance);
54 myra::out() <<
" |VV'-I| = " << unitary_v << std::endl;
55 REQUIRE(unitary_u < tolerance);
61 ADD_TEST(
"sgesvd_tallskinny",
"[dense][lapack]")
62 { test<NumberS>(47,23,1.0e-4f); }
64 ADD_TEST(
"dgesvd_tallskinny",
"[dense][lapack]")
65 { test<NumberD>(47,23,1.0e-12); }
67 ADD_TEST(
"cgesvd_tallskinny",
"[dense][lapack]")
68 { test<NumberC>(47,23,1.0e-4f); }
70 ADD_TEST(
"zgesvd_tallskinny",
"[dense][lapack]")
71 { test<NumberZ>(47,23,1.0e-12); }
74 ADD_TEST(
"sgesvd_shortfat",
"[dense][lapack]")
75 { test<NumberS>(13,33,1.0e-4f); }
77 ADD_TEST(
"dgesvd_shortfat",
"[dense][lapack]")
78 { test<NumberD>(13,33,1.0e-12); }
80 ADD_TEST(
"cgesvd_shortfat",
"[dense][lapack]")
81 { test<NumberC>(13,33,1.0e-4f); }
83 ADD_TEST(
"zgesvd_shortfat",
"[dense][lapack]")
84 { test<NumberZ>(13,33,1.0e-12); }
87 ADD_TEST(
"sgesvd_square",
"[dense][lapack]")
88 { test<NumberS>(25,25,1.0e-4f); }
90 ADD_TEST(
"dgesvd_square",
"[dense][lapack]")
91 { test<NumberD>(25,25,1.0e-12); }
93 ADD_TEST(
"cgesvd_square",
"[dense][lapack]")
94 { test<NumberC>(25,25,1.0e-4f); }
96 ADD_TEST(
"zgesvd_square",
"[dense][lapack]")
97 { test<NumberZ>(25,25,1.0e-12); }
100 ADD_TEST(
"sgesvd_stress",
"[dense][lapack][.]")
103 for (
int t = 0; t < T; ++t)
104 test<NumberS>( random_int(1,50), random_int(1,50), 1.0e-4f );
107 ADD_TEST(
"dgesvd_stress",
"[dense][lapack][.]")
110 for (
int t = 0; t < T; ++t)
111 test<NumberD>( random_int(1,50), random_int(1,50), 1.0e-12 );
114 ADD_TEST(
"cgesvd_stress",
"[dense][lapack][.]")
117 for (
int t = 0; t < T; ++t)
118 test<NumberC>( random_int(1,50), random_int(1,50), 1.0e-4f );
121 ADD_TEST(
"zgesvd_stress",
"[dense][lapack][.]")
124 for (
int t = 0; t < T; ++t)
125 test<NumberZ>( random_int(1,50), random_int(1,50), 1.0e-12 );
Interface class for representing subranges of DiagonalMatrix's.
Interface class for representing subranges of dense Matrix's.
Tabulates an IxJ matrix. Allows random access, has column major layout to be compatible with BLAS/LAP...
Definition: bdsqr.h:20
Routines for computing Frobenius norms of various algebraic containers.
static Matrix< Number > random(int I, int J)
Generates a random Matrix of specified size.
Definition: Matrix.cpp:353
Routines for multiplying by a DiagonalMatrix.
Various utility functions/classes related to scalar Number types.
General purpose dense matrix container, O(i*j) storage.
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Routines for computing singular value decompositions.
Simplistic random number functions.
Container for a diagonal matrix, O(n) storage. Used by SVD, row/column scaling, etc.
Variety of routines all for dense Matrix*Matrix multiplies. Delegates to the BLAS.