16#include <Solv_Externe.h>
17#include <Matrice_Base.h>
18#include <Matrice_Morse_Sym.h>
19#include <Matrice_Bloc_Sym.h>
42 int ordre = M.
ordre();
43 for (
int i=0; i<ordre; i++)
90 Cerr <<
"Error, we do not know yet treat a matrix of type " << la_matrice.
que_suis_je() << finl;
97 if (!indice_coeff_to_keep_.size_array())
100 const auto& tab1 = matrice_morse.
get_tab1();
101 const int n = tab1.size_array() - 1;
104 for (
int i = 0; i < n; i++)
107 nnz += tab1[i + 1] - tab1[i];
109 indice_coeff_to_keep_.resize((
int)nnz);
111 for (
int i = 0; i < n; i++)
115 const auto k0 = tab1[i] - 1;
116 const auto k1 = tab1[i + 1] - 1;
117 for (
auto k = k0; k < k1; k++)
119 indice_coeff_to_keep_[(int)nnz] = (
int)k;
125 return indice_coeff_to_keep_;
134template<
typename ExecSpace>
138 auto x = tab_x.template view_ro<1, ExecSpace>();
139 auto b = tab_b.template view_ro<1, ExecSpace>();
140 auto index =
static_cast<const ArrOfInt&
>(
index_).
template view_ro<1, ExecSpace>();
141 auto lhs =
lhs_.template view_wo<1, ExecSpace>();
142 auto rhs =
rhs_.template view_wo<1, ExecSpace>();
143 Kokkos::RangePolicy<ExecSpace> policy(0, size);
144 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), policy, KOKKOS_LAMBDA(
154 static constexpr bool kernelOnDevice = !std::is_same<ExecSpace, Kokkos::DefaultHostExecutionSpace>::value;
155 end_gpu_timer(__KERNEL_NAME__, kernelOnDevice);
158template<
typename ExecSpace>
162 auto index =
static_cast<const ArrOfInt&
>(
index_).
template view_ro<1, ExecSpace>();
163 auto lhs =
lhs_.template view_ro<1, ExecSpace>();
164 auto x = tab_x.template view_wo<1, ExecSpace>();
165 Kokkos::RangePolicy<ExecSpace> policy(0, size);
166 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), policy, KOKKOS_LAMBDA(
173 static constexpr bool kernelOnDevice = !std::is_same<ExecSpace, Kokkos::DefaultHostExecutionSpace>::value;
174 end_gpu_timer(__KERNEL_NAME__, kernelOnDevice);
Class defining operators and methods for all reading operation in an input flow (file,...
Matrice_Base class - Base class of the matrix hierarchy.
void BlocSymToMatMorseSym(Matrice_Morse_Sym &mat) const
void BlocToMatMorse(Matrice_Morse &matrix) const
virtual const Matrice & get_bloc(int i, int j) const
Matrice_Morse_Sym class - Represents a sparse symmetric matrix M stored in Morse format.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
int ordre() const override
Returns the order of the matrix: - the number of rows if the matrix is square.
virtual Matrice_Morse & transpose(const Matrice_Morse &a)
*this = transpose of a.
void dimensionner(int n, _SIZE_ nnz)
Size the matrix with n lines and n columns and nnz zero-values coefficients.
const auto & get_tab1() const
int get_est_definie() const
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Common stuff for several external solvers.
public_for_cuda void Update_lhs_rhs(const DoubleVect &b, DoubleVect &x)
void Create_lhs_rhs_onDevice()
void MorseSymToMorse(const Matrice_Morse_Sym &MS, Matrice_Morse &M)
const ArrOfInt & indice_coeff_to_keep(const Matrice_Morse &)
void construit_matrice_morse_intermediaire(const Matrice_Base &, Matrice_Morse &)
void Update_solution(DoubleVect &x)
virtual int solveur_direct() const =0
Base class for output streams.
_SIZE_ size_array() const