GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSparseNumeric.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GSparseNumeric.hpp - Sparse matrix numeric analysis class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2006-2021 by Juergen Knoedlseder *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file GSparseNumeric.hpp
23  * @brief Sparse matrix numeric analysis class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GSPARSENUMERIC_HPP
28 #define GSPARSENUMERIC_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include "GMatrixSparse.hpp"
32 
33 /* __ Definitions ________________________________________________________ */
34 
35 /* __ Enumerators ________________________________________________________ */
36 
37 /* __ Structures _________________________________________________________ */
38 
39 /* __ Prototypes _________________________________________________________ */
40 
41 
42 /***********************************************************************//**
43  * @class GSparseNumeric
44  *
45  * @brief Sparse matrix numeric analysis class
46  ***************************************************************************/
48 
49  // Friend classes
50  friend class GMatrixSparse;
51 
52  // I/O friends
53  friend std::ostream& operator<< (std::ostream& os, const GSparseNumeric& n);
54 
55 public:
56  // Constructors and destructors
57  GSparseNumeric(void);
58  virtual ~GSparseNumeric(void);
59 
60  // Assignment operator
62 
63  // Methods
65 
66 private:
67  // Methods
68  int cs_ereach(const GMatrixSparse* A, int k, const int* parent, int* s, int* w);
69 
70  // Data
71  GMatrixSparse* m_L; // L for LU and Cholesky, V for QR
72  GMatrixSparse* m_U; // U for LU, R for QR, not used for Cholesky
73  int* m_pinv; // partial pivoting for LU
74  double* m_B; // beta [0..n-1] for QR
75  int m_n_pinv; // Number of elements in m_pinv
76  int m_n_B; // Number of elements in m_B
77 };
78 
79 #endif /* GSPARSENUMERIC_HPP */
GMatrixSparse * m_L
Sparse matrix class interface definition.
GMatrixSparse * m_U
friend std::ostream & operator<<(std::ostream &os, const GSparseNumeric &n)
Sparse matrix symbolic analysis class.
Sparse matrix numeric analysis class.
GSparseNumeric & operator=(const GSparseNumeric &n)
int cs_ereach(const GMatrixSparse *A, int k, const int *parent, int *s, int *w)
Sparse matrix class definition.
virtual ~GSparseNumeric(void)
void cholesky_numeric_analysis(const GMatrixSparse &m, const GSparseSymbolic &s)