TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Matrice_SuperMorse.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15#ifndef Matrice_SuperMorse_included
16#define Matrice_SuperMorse_included
17
18#include <Matrice_Base.h>
19
20/*! @brief : Matrice avec un stockage encore plus creux que Matrice_Morse: On stocke uniquement les lignes non vides (economie sur la taille de tab1_,
21 *
22 * tab2_ et coeff_ restent identiques)
23 *
24 */
26{
27public :
28 const auto& tab1(int i) const { return tab1_[i]; } // i de 0 a n
29 auto& tab1(int i) { return tab1_[i]; }
30 const int& tab2(int i) const { return tab2_[i]; } // i de 0 a nnz-1
31 int& tab2(int i) { return tab2_[i]; }
32 const double& coeff(int i) const { return coeff_[i]; } // i de 0 a nnz-1
33 double& coeff(int i) { return coeff_[i]; }
34
35 auto& get_set_tab1() { return tab1_ ; }
36 auto& get_set_tab2() { return tab2_ ; }
37 auto& get_set_coeff() { return coeff_ ; }
38
39 const auto& get_tab1() const { return tab1_ ; }
40 const auto& get_tab2() const { return tab2_ ; }
41 const auto& get_coeff() const { return coeff_ ; }
42
43 double ajouter_mult_vect_et_prodscal(const DoubleVect& x, DoubleVect& resu) const;
44 // Tableau contenant les indices des lignes non vides (indices fortran)
46 // tab1_ est de taille lignes_non_vides_.size_array()+1
47
48
49protected :
50#ifdef TRUST_USE_GPU
51 ArrOfTID tab1_;
52 BigArrOfInt tab2_;
53 BigDoubleVect coeff_;
54#else
55 IntVect tab1_;
56 IntVect tab2_;
57 DoubleVect coeff_;
58#endif
59};
60
61#endif
: Matrice avec un stockage encore plus creux que Matrice_Morse: On stocke uniquement les lignes non v...
const auto & get_tab1() const
double & coeff(int i)
double ajouter_mult_vect_et_prodscal(const DoubleVect &x, DoubleVect &resu) const
Calcul de "resu += MATRICE * x" et d'un produit scalaire (c'est une brique de base pour le gradient c...
const auto & tab1(int i) const
const auto & get_tab2() const
const auto & get_coeff() const
const double & coeff(int i) const
const int & tab2(int i) const