23#include "STL_interface.hh"
31template<
class Interface>
43 init_matrix_symm<pseudo_random>(A_stl,_size);
44 init_vector<pseudo_random>(B_stl,_size);
45 init_vector<null_function>(X_stl,_size);
46 init_vector<null_function>(resu_stl,_size);
49 Interface::matrix_from_stl(A_ref,A_stl);
50 Interface::matrix_from_stl(
A,A_stl);
51 Interface::vector_from_stl(B_ref,B_stl);
52 Interface::vector_from_stl(
B,B_stl);
53 Interface::vector_from_stl(X_ref,X_stl);
54 Interface::vector_from_stl(X,X_stl);
62 INFOS(
"illegal call to Action_symv Copy Ctor");
68 Interface::free_matrix(
A,_size);
69 Interface::free_vector(
B);
70 Interface::free_vector(X);
71 Interface::free_matrix(A_ref,_size);
72 Interface::free_vector(B_ref);
73 Interface::free_vector(X_ref);
78 static inline std::string
name(
void )
80 return "symv_" + Interface::name();
84 return 2.0*_size*_size;
89 Interface::copy_matrix(A_ref,
A,_size);
90 Interface::copy_vector(B_ref,
B,_size);
91 Interface::copy_vector(X_ref,X,_size);
97 Interface::symv(
A,
B,X,_size);
102 if (_size>128)
return;
104 Interface::vector_to_stl(X,resu_stl);
106 STL_interface<typename Interface::real_type>::symv(A_stl,B_stl,X_stl,_size);
108 typename Interface::real_type error=
109 STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
112 INFOS(
"WRONG CALCULATION...residual=" << error);
120 typename Interface::stl_matrix A_stl;
121 typename Interface::stl_vector B_stl;
122 typename Interface::stl_vector X_stl;
123 typename Interface::stl_vector resu_stl;
125 typename Interface::gene_matrix A_ref;
126 typename Interface::gene_vector B_ref;
127 typename Interface::gene_vector X_ref;
129 typename Interface::gene_matrix
A;
130 typename Interface::gene_vector
B;
131 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_symv.hh:32
BTL_DONT_INLINE void calculate(void)
Definition action_symv.hh:95
double nb_op_base(void)
Definition action_symv.hh:83
BTL_DONT_INLINE void check_result(void)
Definition action_symv.hh:101
static std::string name(void)
Definition action_symv.hh:78
BTL_DONT_INLINE ~Action_symv(void)
Definition action_symv.hh:67
Action_symv(const Action_symv &)
Definition action_symv.hh:60
BTL_DONT_INLINE Action_symv(int size)
Definition action_symv.hh:38
BTL_DONT_INLINE void initialize(void)
Definition action_symv.hh:87
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