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;
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
BTL_DONT_INLINE void calculate(void)
Interface::stl_vector resu_stl
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Interface::stl_vector X_stl
BTL_DONT_INLINE Action_matrix_vector_product(int size)
BTL_DONT_INLINE ~Action_matrix_vector_product(void)
Interface::stl_vector B_stl
#define BTL_ASM_COMMENT(X)
Interface::gene_matrix A_ref
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Action_matrix_vector_product(const Action_matrix_vector_product &)
Interface::gene_vector B_ref
Interface::gene_vector X_ref
static void matrix_vector_product(gene_matrix &A, gene_vector &B, gene_vector &X, int N)
static std::string name(void)
Interface::stl_matrix A_stl
static real norm_diff(const stl_vector &A, const stl_vector &B)
void copy_matrix(MatrixType &m)
BTL_DONT_INLINE void initialize(void)
BTL_DONT_INLINE void check_result(void)