20 #ifndef ACTION_MATRIX_VECTOR_PRODUCT
21 #define ACTION_MATRIX_VECTOR_PRODUCT
22 #include "utilities.h"
31 template<
class Interface>
40 MESSAGE(
"Action_matrix_vector_product Ctor");
44 init_matrix<pseudo_random>(A_stl,_size);
45 init_vector<pseudo_random>(B_stl,_size);
46 init_vector<null_function>(X_stl,_size);
47 init_vector<null_function>(resu_stl,_size);
51 Interface::matrix_from_stl(A_ref,A_stl);
52 Interface::matrix_from_stl(
A,A_stl);
53 Interface::vector_from_stl(B_ref,B_stl);
54 Interface::vector_from_stl(
B,B_stl);
55 Interface::vector_from_stl(X_ref,X_stl);
56 Interface::vector_from_stl(
X,X_stl);
64 INFOS(
"illegal call to Action_matrix_vector_product Copy Ctor");
72 MESSAGE(
"Action_matrix_vector_product Dtor");
76 Interface::free_matrix(
A,_size);
77 Interface::free_vector(
B);
78 Interface::free_vector(
X);
80 Interface::free_matrix(A_ref,_size);
81 Interface::free_vector(B_ref);
82 Interface::free_vector(X_ref);
88 static inline std::string
name(
void )
94 return 2.0*_size*_size;
100 Interface::copy_vector(B_ref,
B,_size);
101 Interface::copy_vector(X_ref,
X,_size);
107 Interface::matrix_vector_product(
A,
B,
X,_size);
115 Interface::vector_to_stl(
X,resu_stl);
119 typename Interface::real_type
error=
123 INFOS(
"WRONG CALCULATION...residual=" <<
error);
131 typename Interface::stl_matrix
A_stl;
132 typename Interface::stl_vector
B_stl;
133 typename Interface::stl_vector
X_stl;
136 typename Interface::gene_matrix
A_ref;
137 typename Interface::gene_vector
B_ref;
138 typename Interface::gene_vector
X_ref;
140 typename Interface::gene_matrix
A;
141 typename Interface::gene_vector
B;
142 typename Interface::gene_vector
X;