20#ifndef ACTION_MATRIX_MATRIX_PRODUCT
21#define ACTION_MATRIX_MATRIX_PRODUCT
23#include "STL_interface.hh"
31template<
class Interface>
40 MESSAGE(
"Action_matrix_matrix_product Ctor");
44 init_matrix<pseudo_random>(A_stl,_size);
45 init_matrix<pseudo_random>(B_stl,_size);
46 init_matrix<null_function>(X_stl,_size);
47 init_matrix<null_function>(resu_stl,_size);
51 Interface::matrix_from_stl(A_ref,A_stl);
52 Interface::matrix_from_stl(B_ref,B_stl);
53 Interface::matrix_from_stl(X_ref,X_stl);
55 Interface::matrix_from_stl(
A,A_stl);
56 Interface::matrix_from_stl(
B,B_stl);
57 Interface::matrix_from_stl(X,X_stl);
65 INFOS(
"illegal call to Action_matrix_matrix_product Copy Ctor");
73 MESSAGE(
"Action_matrix_matrix_product Dtor");
77 Interface::free_matrix(
A,_size);
78 Interface::free_matrix(
B,_size);
79 Interface::free_matrix(X,_size);
81 Interface::free_matrix(A_ref,_size);
82 Interface::free_matrix(B_ref,_size);
83 Interface::free_matrix(X_ref,_size);
89 static inline std::string
name(
void )
91 return "matrix_matrix_"+Interface::name();
95 return 2.0*_size*_size*_size;
100 Interface::copy_matrix(A_ref,
A,_size);
101 Interface::copy_matrix(B_ref,
B,_size);
102 Interface::copy_matrix(X_ref,X,_size);
107 Interface::matrix_matrix_product(
A,
B,X,_size);
115 Interface::matrix_to_stl(X,resu_stl);
116 STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size);
117 typename Interface::real_type error=
118 STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
120 INFOS(
"WRONG CALCULATION...residual=" << error);
128 typename Interface::stl_matrix A_stl;
129 typename Interface::stl_matrix B_stl;
130 typename Interface::stl_matrix X_stl;
131 typename Interface::stl_matrix resu_stl;
133 typename Interface::gene_matrix A_ref;
134 typename Interface::gene_matrix B_ref;
135 typename Interface::gene_matrix X_ref;
137 typename Interface::gene_matrix
A;
138 typename Interface::gene_matrix
B;
139 typename Interface::gene_matrix X;
Scalar Scalar int size
Definition benchVecAdd.cpp:17
Definition action_matrix_matrix_product.hh:32
Action_matrix_matrix_product(int size)
Definition action_matrix_matrix_product.hh:38
void calculate(void)
Definition action_matrix_matrix_product.hh:106
double nb_op_base(void)
Definition action_matrix_matrix_product.hh:94
~Action_matrix_matrix_product(void)
Definition action_matrix_matrix_product.hh:71
static std::string name(void)
Definition action_matrix_matrix_product.hh:89
void initialize(void)
Definition action_matrix_matrix_product.hh:98
void check_result(void)
Definition action_matrix_matrix_product.hh:110
Action_matrix_matrix_product(const Action_matrix_matrix_product &)
Definition action_matrix_matrix_product.hh:63
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
#define INFOS(chain)
Definition utilities.h:22
#define MESSAGE(chain)
Definition utilities.h:76