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,...
Classe Matrice_Base Classe de base de la hierarchie des matrices.
void BlocSymToMatMorseSym(Matrice_Morse_Sym &mat) const
void BlocToMatMorse(Matrice_Morse &matrix) const
virtual const Matrice & get_bloc(int i, int j) const
Classe Matrice_Morse_Sym Represente une matrice M (creuse) symetrique stockee au format Morse.
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
int ordre() const override
Renvoie l'ordre de la matrice: - le nombre de lignes si la matrice est carree.
virtual Matrice_Morse & transpose(const Matrice_Morse &a)
*this = a transposee.
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
renvoie la chaine identifiant la classe.
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
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
Classe de base des flux de sortie.
_SIZE_ size_array() const