20#ifndef ACTION_MATRIX_VECTOR_PRODUCT
21#define ACTION_MATRIX_VECTOR_PRODUCT
23#include "STL_interface.hh"
31template<
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 )
90 return "matrix_vector_" + Interface::name();
94 return 2.0*_size*_size;
99 Interface::copy_matrix(A_ref,
A,_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);
117 STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl,B_stl,X_stl,_size);
119 typename Interface::real_type error=
120 STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
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;
134 typename Interface::stl_vector resu_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;
Scalar Scalar int size
Definition benchVecAdd.cpp:17
#define BTL_ASM_COMMENT(X)
Definition btl.hh:44
#define BTL_DONT_INLINE
Definition btl.hh:38
Definition action_matrix_vector_product.hh:32
BTL_DONT_INLINE ~Action_matrix_vector_product(void)
Definition action_matrix_vector_product.hh:70
BTL_DONT_INLINE void calculate(void)
Definition action_matrix_vector_product.hh:105
double nb_op_base(void)
Definition action_matrix_vector_product.hh:93
BTL_DONT_INLINE void check_result(void)
Definition action_matrix_vector_product.hh:111
BTL_DONT_INLINE void initialize(void)
Definition action_matrix_vector_product.hh:97
static std::string name(void)
Definition action_matrix_vector_product.hh:88
Action_matrix_vector_product(const Action_matrix_vector_product &)
Definition action_matrix_vector_product.hh:62
BTL_DONT_INLINE Action_matrix_vector_product(int size)
Definition action_matrix_vector_product.hh:38
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