23#include "STL_interface.hh"
31template<
class Interface>
41 typename Interface::stl_matrix tmp;
42 init_matrix<pseudo_random>(A_stl,_size);
43 init_vector<pseudo_random>(B_stl,_size);
44 init_vector<pseudo_random>(X_stl,_size);
45 init_vector<null_function>(resu_stl,_size);
48 Interface::matrix_from_stl(A_ref,A_stl);
49 Interface::matrix_from_stl(
A,A_stl);
50 Interface::vector_from_stl(B_ref,B_stl);
51 Interface::vector_from_stl(
B,B_stl);
52 Interface::vector_from_stl(X_ref,X_stl);
53 Interface::vector_from_stl(X,X_stl);
59 INFOS(
"illegal call to Action_syr2 Copy Ctor");
65 Interface::free_matrix(
A,_size);
66 Interface::free_vector(
B);
67 Interface::free_vector(X);
68 Interface::free_matrix(A_ref,_size);
69 Interface::free_vector(B_ref);
70 Interface::free_vector(X_ref);
75 static inline std::string
name(
void )
77 return "syr2_" + Interface::name();
81 return 2.0*_size*_size;
85 Interface::copy_matrix(A_ref,
A,_size);
86 Interface::copy_vector(B_ref,
B,_size);
87 Interface::copy_vector(X_ref,X,_size);
92 Interface::syr2(
A,
B,X,_size);
98 Interface::vector_to_stl(X,resu_stl);
100 STL_interface<typename Interface::real_type>::syr2(A_stl,B_stl,X_stl,_size);
102 typename Interface::real_type error=
103 STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
106 INFOS(
"WRONG CALCULATION...residual=" << error);
114 typename Interface::stl_matrix A_stl;
115 typename Interface::stl_vector B_stl;
116 typename Interface::stl_vector X_stl;
117 typename Interface::stl_vector resu_stl;
119 typename Interface::gene_matrix A_ref;
120 typename Interface::gene_vector B_ref;
121 typename Interface::gene_vector X_ref;
123 typename Interface::gene_matrix
A;
124 typename Interface::gene_vector
B;
125 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_syr2.hh:32
double nb_op_base(void)
Definition action_syr2.hh:80
BTL_DONT_INLINE ~Action_syr2(void)
Definition action_syr2.hh:64
BTL_DONT_INLINE void calculate(void)
Definition action_syr2.hh:90
static std::string name(void)
Definition action_syr2.hh:75
BTL_DONT_INLINE Action_syr2(int size)
Definition action_syr2.hh:38
Action_syr2(const Action_syr2 &)
Definition action_syr2.hh:57
BTL_DONT_INLINE void check_result(void)
Definition action_syr2.hh:96
BTL_DONT_INLINE void initialize(void)
Definition action_syr2.hh:84
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
#define INFOS(chain)
Definition utilities.h:22