19 #ifndef ACTION_TRISOLVE 20 #define ACTION_TRISOLVE 21 #include "utilities.h" 30 template<
class Interface>
39 MESSAGE(
"Action_trisolve Ctor");
42 init_matrix<pseudo_random>(L_stl,_size);
43 init_vector<pseudo_random>(B_stl,_size);
44 init_vector<null_function>(X_stl,_size);
45 for (
int j=0;
j<_size; ++
j)
47 for (
int i=0;
i<
j; ++
i)
52 init_vector<null_function>(resu_stl,_size);
55 Interface::matrix_from_stl(
L,L_stl);
56 Interface::vector_from_stl(
X,X_stl);
57 Interface::vector_from_stl(
B,B_stl);
60 for (
int j=0;
j<_size; ++
j)
70 INFOS(
"illegal call to Action_trisolve Copy Ctor");
78 MESSAGE(
"Action_trisolve Dtor");
81 Interface::free_matrix(
L,_size);
82 Interface::free_vector(
B);
83 Interface::free_vector(
X);
88 static inline std::string
name(
void )
102 Interface::trisolve_lower(
L,
B,
X,_size);
106 if (_size>128)
return;
108 Interface::vector_to_stl(
X,resu_stl);
112 typename Interface::real_type
error=
116 INFOS(
"WRONG CALCULATION...residual=" << error);
124 typename Interface::stl_matrix
L_stl;
125 typename Interface::stl_vector
X_stl;
126 typename Interface::stl_vector
B_stl;
129 typename Interface::gene_matrix
L;
130 typename Interface::gene_vector
X;
131 typename Interface::gene_vector
B;
Interface::stl_matrix L_stl
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
static void trisolve_lower(const gene_matrix &L, const gene_vector &B, gene_vector &X, int N)
Action_trisolve(int size)
static std::string name(void)
Interface::stl_vector X_stl
Action_trisolve(const Action_trisolve &)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Interface::stl_vector B_stl
Interface::stl_vector resu_stl
static real norm_diff(const stl_vector &A, const stl_vector &B)