18#include "STL_interface.hh"
26template<
class Interface>
37 typename Interface::stl_matrix tmp;
38 init_matrix<pseudo_random>(A_stl,_size);
39 init_vector<pseudo_random>(B_stl,_size);
40 init_vector<pseudo_random>(X_stl,_size);
41 init_vector<null_function>(resu_stl,_size);
44 Interface::matrix_from_stl(A_ref,A_stl);
45 Interface::matrix_from_stl(
A,A_stl);
46 Interface::vector_from_stl(B_ref,B_stl);
47 Interface::vector_from_stl(
B,B_stl);
48 Interface::vector_from_stl(X_ref,X_stl);
49 Interface::vector_from_stl(X,X_stl);
55 INFOS(
"illegal call to Action_ger Copy Ctor");
62 Interface::free_matrix(
A,_size);
63 Interface::free_vector(
B);
64 Interface::free_vector(X);
65 Interface::free_matrix(A_ref,_size);
66 Interface::free_vector(B_ref);
67 Interface::free_vector(X_ref);
72 static inline std::string
name(
void )
74 return "ger_" + Interface::name();
78 return 2.0*_size*_size;
82 Interface::copy_matrix(A_ref,
A,_size);
83 Interface::copy_vector(B_ref,
B,_size);
84 Interface::copy_vector(X_ref,X,_size);
89 Interface::ger(
A,
B,X,_size);
95 Interface::vector_to_stl(X,resu_stl);
97 STL_interface<typename Interface::real_type>::ger(A_stl,B_stl,X_stl,_size);
99 typename Interface::real_type error=
100 STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl);
103 INFOS(
"WRONG CALCULATION...residual=" << error);
111 typename Interface::stl_matrix A_stl;
112 typename Interface::stl_vector B_stl;
113 typename Interface::stl_vector X_stl;
114 typename Interface::stl_vector resu_stl;
116 typename Interface::gene_matrix A_ref;
117 typename Interface::gene_vector B_ref;
118 typename Interface::gene_vector X_ref;
120 typename Interface::gene_matrix
A;
121 typename Interface::gene_vector
B;
122 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_ger.hh:27
BTL_DONT_INLINE void initialize(void)
Definition action_ger.hh:81
Action_ger(const Action_ger &)
Definition action_ger.hh:53
BTL_DONT_INLINE ~Action_ger(void)
Definition action_ger.hh:60
BTL_DONT_INLINE void check_result(void)
Definition action_ger.hh:93
BTL_DONT_INLINE void calculate(void)
Definition action_ger.hh:87
BTL_DONT_INLINE Action_ger(int size)
Definition action_ger.hh:32
double nb_op_base(void)
Definition action_ger.hh:77
static std::string name(void)
Definition action_ger.hh:72
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