19#ifndef ACTION_HESSENBERG
20#define ACTION_HESSENBERG
22#include "STL_interface.hh"
30template<
class Interface>
39 MESSAGE(
"Action_hessenberg Ctor");
42 init_matrix<pseudo_random>(X_stl,_size);
44 init_matrix<null_function>(C_stl,_size);
45 init_matrix<null_function>(resu_stl,_size);
48 Interface::matrix_from_stl(X_ref,X_stl);
49 Interface::matrix_from_stl(X,X_stl);
50 Interface::matrix_from_stl(
C,C_stl);
53 for (
int j=0;
j<_size-2; ++
j)
55 double r = std::max(0,_size-
j-1);
56 double b = std::max(0,_size-
j-2);
57 _cost += 6 + 3*
b + r*r*4 + r*_size*4;
65 INFOS(
"illegal call to Action_hessenberg Copy Ctor");
73 MESSAGE(
"Action_hessenberg Dtor");
76 Interface::free_matrix(X_ref,_size);
77 Interface::free_matrix(X,_size);
78 Interface::free_matrix(
C,_size);
83 static inline std::string
name(
void )
85 return "hessenberg_"+Interface::name();
93 Interface::copy_matrix(X_ref,X,_size);
97 Interface::hessenberg(X,
C,_size);
102 Interface::matrix_to_stl(
C,resu_stl);
118 typename Interface::stl_matrix X_stl;
119 typename Interface::stl_matrix C_stl;
120 typename Interface::stl_matrix resu_stl;
122 typename Interface::gene_matrix X_ref;
123 typename Interface::gene_matrix X;
124 typename Interface::gene_matrix
C;
130template<
class Interface>
139 MESSAGE(
"Action_tridiagonalization Ctor");
142 init_matrix<pseudo_random>(X_stl,_size);
144 for(
int i=0;
i<_size; ++
i)
146 for(
int j=0;
j<
i; ++
j)
147 X_stl[
i][
j] = X_stl[
j][
i];
150 init_matrix<null_function>(C_stl,_size);
151 init_matrix<null_function>(resu_stl,_size);
154 Interface::matrix_from_stl(X_ref,X_stl);
155 Interface::matrix_from_stl(X,X_stl);
156 Interface::matrix_from_stl(
C,C_stl);
159 for (
int j=0;
j<_size-2; ++
j)
161 double r = std::max(0,_size-
j-1);
162 double b = std::max(0,_size-
j-2);
163 _cost += 6. + 3.*
b + r*r*8.;
171 INFOS(
"illegal call to Action_tridiagonalization Copy Ctor");
179 MESSAGE(
"Action_tridiagonalization Dtor");
182 Interface::free_matrix(X_ref,_size);
183 Interface::free_matrix(X,_size);
184 Interface::free_matrix(
C,_size);
189 static inline std::string
name(
void ) {
return "tridiagonalization_"+Interface::name(); }
196 Interface::copy_matrix(X_ref,X,_size);
200 Interface::tridiagonalization(X,
C,_size);
205 Interface::matrix_to_stl(
C,resu_stl);
221 typename Interface::stl_matrix X_stl;
222 typename Interface::stl_matrix C_stl;
223 typename Interface::stl_matrix resu_stl;
225 typename Interface::gene_matrix X_ref;
226 typename Interface::gene_matrix X;
227 typename Interface::gene_matrix
C;
int i
Definition BiCGSTAB_step_by_step.cpp:9
Scalar * b
Definition benchVecAdd.cpp:17
Scalar Scalar int size
Definition benchVecAdd.cpp:17
Definition action_hessenberg.hh:31
void calculate(void)
Definition action_hessenberg.hh:96
~Action_hessenberg(void)
Definition action_hessenberg.hh:71
Action_hessenberg(int size)
Definition action_hessenberg.hh:37
double nb_op_base(void)
Definition action_hessenberg.hh:88
static std::string name(void)
Definition action_hessenberg.hh:83
void initialize(void)
Definition action_hessenberg.hh:92
void check_result(void)
Definition action_hessenberg.hh:100
Action_hessenberg(const Action_hessenberg &)
Definition action_hessenberg.hh:63
Definition action_hessenberg.hh:131
void initialize(void)
Definition action_hessenberg.hh:195
~Action_tridiagonalization(void)
Definition action_hessenberg.hh:177
void calculate(void)
Definition action_hessenberg.hh:199
static std::string name(void)
Definition action_hessenberg.hh:189
double nb_op_base(void)
Definition action_hessenberg.hh:191
Action_tridiagonalization(const Action_tridiagonalization &)
Definition action_hessenberg.hh:169
Action_tridiagonalization(int size)
Definition action_hessenberg.hh:137
void check_result(void)
Definition action_hessenberg.hh:203
std::ptrdiff_t j
Definition tut_arithmetic_redux_minmax.cpp:2
#define INFOS(chain)
Definition utilities.h:22
#define MESSAGE(chain)
Definition utilities.h:76