16#include <Matrice_Diagonale.h>
52 assert( x.
size( ) ==count );
53 assert( r.
size( ) ==count );
56 const double* x_ptr = x.
addr( );
57 double* r_ptr = r.
addr( );
59 for ( ; count; count-- )
61 const double x_ = *x_ptr;
62 const double c_ = *c_ptr;
63 double& r_ = *( r_ptr++ );
84 assert( x.
nb_dim( ) == 2 );
85 assert( r.
nb_dim( ) == 2 );
91 const int nb_components = x.
dimension( 1 );
92 assert( r.
dimension( 1 ) == nb_components );
94 for (
int i=0; i<size; ++i )
97 for (
int j=0; j<nb_components; ++j )
99 r( i, j ) += x( i, j ) * coefficient;
124 const int size =
ordre( );
126 stencil.
resize( size, 2 );
128 for (
int i=0; i<size; ++i )
141 StencilCoeffs& coefficients )
const
147 Cerr <<
"Error in Matrice_Morse::get_stencil_and_coefficients( )"<<finl;
148 Cerr <<
" The coefficients are not filled."<<finl;
149 Cerr <<
" Aborting..." << finl;
155 for (
int i=0; i<n; ++i ) coefficients[ i ] =
coefficients_( i );
158 const int size =
ordre( );
160 stencil.
resize( size, 2 );
163 for (
int i=0; i<size; ++i )
172 StencilCoeffs& coefficients )
const
227 Cerr <<
"Error in 'Matrice_Diagonale::coeff()':" << finl;
228 Cerr <<
" non-const access is only allowed for diagonal coefficients" << finl;
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.
bool is_stencil_up_to_date_
Classe Matrice_Diagonale Represente une matrice diagonale.
void dimensionner(int size)
void get_stencil_and_coefficients(Stencil &stencil, StencilCoeffs &coefficients) const override
int ordre() const override
If square matrix, returns number of lines, otherwise 0.
void get_stencil(Stencil &stencil) const override
double coeff(int i, int j) const
void get_symmetric_stencil(Stencil &stencil) const override
int nb_lignes() const override
Return local number of lines (=size on the current proc).
int nb_colonnes() const override
Return local number of columns (=size on the current proc).
DoubleTab & ajouter_multTab_(const DoubleTab &x, DoubleTab &r) const override
DoubleVect & ajouter_multvectT_(const DoubleVect &x, DoubleVect &r) const override
void get_symmetric_stencil_and_coefficients(Stencil &stencil, StencilCoeffs &coefficients) const override
DoubleVect & ajouter_multvect_(const DoubleVect &x, DoubleVect &r) const override
void scale(const double x) override
DoubleVect & get_coefficients()
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 abort()
Routine de sortie de Trio-U sur une erreur abort().
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Classe de base des flux de sortie.
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const