20#ifndef ACTION_ATV_PRODUCT
21#define ACTION_ATV_PRODUCT
23#include "STL_interface.hh"
31template<
class Interface>
38 MESSAGE(
"Action_atv_product Ctor");
42 init_matrix<pseudo_random>(A_stl,_size);
43 init_vector<pseudo_random>(B_stl,_size);
44 init_vector<null_function>(X_stl,_size);
45 init_vector<null_function>(resu_stl,_size);
49 Interface::matrix_from_stl(A_ref,A_stl);
50 Interface::vector_from_stl(B_ref,B_stl);
51 Interface::vector_from_stl(X_ref,X_stl);
53 Interface::matrix_from_stl(
A,A_stl);
54 Interface::vector_from_stl(
B,B_stl);
55 Interface::vector_from_stl(X,X_stl);
61 INFOS(
"illegal call to Action_atv_product Copy Ctor");
67 MESSAGE(
"Action_atv_product Dtor");
69 Interface::free_matrix(
A,_size);
70 Interface::free_vector(
B);
71 Interface::free_vector(X);
73 Interface::free_matrix(A_ref,_size);
74 Interface::free_vector(B_ref);
75 Interface::free_vector(X_ref);
78 static inline std::string
name() {
return "atv_" + Interface::name(); }
83 Interface::copy_matrix(A_ref,
A,_size);
84 Interface::copy_vector(B_ref,
B,_size);
85 Interface::copy_vector(X_ref,X,_size);
90 Interface::atv_product(
A,
B,X,_size);
96 if (_size>128)
return;
97 Interface::vector_to_stl(X,resu_stl);
99 STL_interface<typename Interface::real_type>::atv_product(A_stl,B_stl,X_stl,_size);
101 typename Interface::real_type error=
102 STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
105 INFOS(
"WRONG CALCULATION...residual=" << error);
112 typename Interface::stl_matrix A_stl;
113 typename Interface::stl_vector B_stl;
114 typename Interface::stl_vector X_stl;
115 typename Interface::stl_vector resu_stl;
117 typename Interface::gene_matrix A_ref;
118 typename Interface::gene_vector B_ref;
119 typename Interface::gene_vector X_ref;
121 typename Interface::gene_matrix
A;
122 typename Interface::gene_vector
B;
123 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_atv_product.hh:32
void check_result(void)
Definition action_atv_product.hh:94
void initialize(void)
Definition action_atv_product.hh:82
Action_atv_product(int size)
Definition action_atv_product.hh:36
static std::string name()
Definition action_atv_product.hh:78
~Action_atv_product(void)
Definition action_atv_product.hh:65
Action_atv_product(const Action_atv_product &)
Definition action_atv_product.hh:59
double nb_op_base(void)
Definition action_atv_product.hh:80
BTL_DONT_INLINE void calculate(void)
Definition action_atv_product.hh:88
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