26 #include <tests/myratest.h> 37 int K = I < J ? I : J;
42 auto tau = gebrd_inplace(A);
43 auto tauq = tau.first;
44 auto taup = tau.second;
47 ormqr_inplace(Q,tauq,B,
'L',
'H');
49 ormlq_inplace(P,taup.cut_last(1),B.
cut_left(1).top(J),
'R',
'H');
51 for (
int k = 0; k < K; ++k)
53 for (
int k = 0; k < K-1; ++k)
56 Precision error = frobenius(B);
57 myra::out() <<
"|Q'*A*P' - B| = " << error << std::endl;
58 REQUIRE(error < tolerance);
66 int K = I < J ? I : J;
71 auto tau = gebrd_inplace(A);
72 auto tauq = tau.first;
73 auto taup = tau.second;
76 ormlq_inplace(P,taup,B,
'R',
'H');
78 ormqr_inplace(Q,tauq.cut_last(1),B.
cut_top(1).left(I),
'L',
'H');
80 for (
int k = 0; k < K; ++k)
82 for (
int k = 0; k < K-1; ++k)
85 Precision error = frobenius(B);
86 myra::out() <<
"|Q'*A*P' - B| = " << error << std::endl;
87 REQUIRE(error < tolerance);
92 ADD_TEST(
"gebrd_tallskinny",
"[dense][lapack]")
96 test1<NumberS>(N1,N2,1.0e-5f);
97 test1<NumberD>(N1,N2,1.0e-10);
98 test1<NumberC>(N1,N2,1.0e-5f);
99 test1<NumberZ>(N1,N2,1.0e-10);
102 ADD_TEST(
"gebrd_shortfat",
"[dense][lapack]")
106 test2<NumberS>(N2,N1,1.0e-5f);
107 test2<NumberD>(N2,N1,1.0e-10);
108 test2<NumberC>(N2,N1,1.0e-5f);
109 test2<NumberZ>(N2,N1,1.0e-10);
112 ADD_TEST(
"gebrd_square",
"[dense][lapack]")
116 test1<NumberS>(N1,N1,1.0e-5f);
117 test1<NumberD>(N1,N1,1.0e-10);
118 test1<NumberC>(N1,N1,1.0e-5f);
119 test1<NumberZ>(N1,N1,1.0e-10);
CMatrixRange< Number > range() const
Explicit conversion, returns a MatrixRange over all of *this.
Definition: Matrix.cpp:130
Interface class for representing subranges of dense Matrix's.
Routines to apply a Householder Q, as previously factored via gelqf_inplace()
CMatrixRange< Number > cut_left(int j) const
Returns a MatrixRange that cuts the j leftmost columns, this(:,j:J)
Definition: Matrix.cpp:269
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
Replaces small values with explicit zeros.
Various utility functions/classes related to scalar Number types.
General purpose dense matrix container, O(i*j) storage.
CMatrixRange< Number > cut_top(int i) const
Cuts the i topmost rows, returns this(i:I,:)
Definition: MatrixRange.cpp:539
Householder bidiagonalization of a general Matrix.
Container for either a column vector or row vector (depends upon the usage context) ...
CMatrixRange< Number > cut_left(int j) const
Cuts the j leftmost columns, returns this(:,j:J)
Definition: MatrixRange.cpp:588
Reflects Precision trait for a Number, scalar Number types should specialize it.
Definition: Number.h:33
Routines to apply a Householder Q, as previously factored via geqrf_inplace()
CMatrixRange< Number > cut_top(int i) const
Returns a MatrixRange that cuts the i topmost rows, this(i:I,:)
Definition: Matrix.cpp:213
Variety of routines all for dense Matrix*Matrix multiplies. Delegates to the BLAS.