27 #include <tests/myratest.h> 41 auto E0 = bothcat(A0,B0,C0,D0);
42 auto A = make_GemmAction(A0);
43 auto B = make_GemmAction(B0);
44 auto C = make_GemmAction(C0);
45 auto D = make_GemmAction(D0);
46 auto E = bothcat(A,B,C,D);
47 Precision error = frobenius(E0-E.make_Matrix());
48 myra::out() <<
" |E0-E| = " << error << std::endl;
49 REQUIRE(error < tolerance);
52 #ifdef MYRAMATH_ENABLE_CPP11 64 auto G0 = bothcat({2,3,{A0,B0,C0,D0,E0,F0}});
65 auto A = make_GemmAction(A0);
66 auto B = make_GemmAction(B0);
67 auto C = make_GemmAction(C0);
68 auto D = make_GemmAction(D0);
69 auto E = make_GemmAction(E0);
70 auto F = make_GemmAction(F0);
71 auto G = bothcat({2,3,{A,B,C,D,E,F}});
72 Precision error = frobenius(G0-G.make_Matrix());
73 myra::out() <<
" |G0-G| = " << error << std::endl;
74 REQUIRE(error < tolerance);
81 ADD_TEST(
"bothcat_Action",
"[iterative]")
83 test1<NumberS>(1.0e-5f);
84 test1<NumberD>(1.0e-10);
85 test1<NumberC>(1.0e-5f);
86 test1<NumberZ>(1.0e-10);
89 #ifdef MYRAMATH_ENABLE_CPP11 91 ADD_TEST(
"bothcat_Action_cpp11",
"[iterative]")
93 test2<NumberS>(1.0e-5f);
94 test2<NumberD>(1.0e-10);
95 test2<NumberC>(1.0e-5f);
96 test2<NumberZ>(1.0e-10);
Interface class for representing subranges of dense Matrix's.
Applies the "Action" of a linear operator, b := A*x, used in iterative solution algorithms.
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
Container of values, allows random (i,j) access.
Routines to concatenate Action's in two-by-two fashion.
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
An Action for multiplying by a dense Matrix or SparseMatrix using gemm().
Routines to concatenate Matrix's in two-by-two fashion.