20 #ifndef ACTION_MATRIX_MATRIX_PRODUCT_BIS 21 #define ACTION_MATRIX_MATRIX_PRODUCT_BIS 22 #include "utilities.h" 32 template<
class Interface>
37 static inline std::string
name(
void )
43 return 2.0*size*size*
size;
50 typename Interface::stl_matrix A_stl;
51 typename Interface::stl_matrix B_stl;
52 typename Interface::stl_matrix X_stl;
54 init_matrix<pseudo_random>(A_stl,
size);
55 init_matrix<pseudo_random>(B_stl,
size);
56 init_matrix<null_function>(X_stl,
size);
60 typename Interface::gene_matrix A_ref;
61 typename Interface::gene_matrix B_ref;
62 typename Interface::gene_matrix X_ref;
64 typename Interface::gene_matrix
A;
65 typename Interface::gene_matrix
B;
66 typename Interface::gene_matrix
X;
69 Interface::matrix_from_stl(A_ref,A_stl);
70 Interface::matrix_from_stl(B_ref,B_stl);
71 Interface::matrix_from_stl(X_ref,X_stl);
73 Interface::matrix_from_stl(A,A_stl);
74 Interface::matrix_from_stl(B,B_stl);
75 Interface::matrix_from_stl(X,X_stl);
84 chronos.start_baseline(nb_calc);
88 Interface::copy_matrix(A_ref,A,size);
89 Interface::copy_matrix(B_ref,B,size);
90 Interface::copy_matrix(X_ref,X,size);
95 while(chronos.check());
101 chronos.start(nb_calc);
105 Interface::copy_matrix(A_ref,A,size);
106 Interface::copy_matrix(B_ref,B,size);
107 Interface::copy_matrix(X_ref,X,size);
109 Interface::matrix_matrix_product(A,B,X,size);
111 while(chronos.check());
113 chronos.report(
true);
115 double time=chronos.calculated_time/2000.0;
119 typename Interface::stl_matrix resu_stl(size);
121 Interface::matrix_to_stl(X,resu_stl);
125 typename Interface::real_type
error=
129 INFOS(
"WRONG CALCULATION...residual=" << error);
135 Interface::free_matrix(A,size);
136 Interface::free_matrix(B,size);
137 Interface::free_matrix(X,size);
139 Interface::free_matrix(A_ref,size);
140 Interface::free_matrix(B_ref,size);
141 Interface::free_matrix(X_ref,size);
static double nb_op_base(int size)
static double calculate(int nb_calc, int size)
Matrix< SCALARB, Dynamic, Dynamic > B
static void matrix_matrix_product(const gene_matrix &A, const gene_matrix &B, gene_matrix &X, int N)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static real norm_diff(const stl_vector &A, const stl_vector &B)
static std::string name(void)