GammaLib  1.7.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-2013 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 "GException.hpp"
32 #include "GVector.hpp"
33 #include "GMatrix.hpp"
34 #include "GMatrixSparse.hpp"
35 #include "GSparseSymbolic.hpp"
36 
37 /* __ Definitions ________________________________________________________ */
38 
39 /* __ Enumerators ________________________________________________________ */
40 
41 /* __ Structures _________________________________________________________ */
42 
43 /* __ Prototypes _________________________________________________________ */
44 
45 
46 /***********************************************************************//**
47  * @class GSparseNumeric
48  *
49  * @brief Sparse matrix numeric analysis class
50  ***************************************************************************/
52 
53  // Friend classes
54  friend class GMatrixSparse;
55 
56  // I/O friends
57  friend std::ostream& operator<< (std::ostream& os, const GSparseNumeric& n);
58 
59 public:
60  // Constructors and destructors
61  GSparseNumeric(void);
62  virtual ~GSparseNumeric(void);
63 
64  // Assignment operator
66 
67  // Functions
69 
70 private:
71  // Functions
72  int cs_ereach(const GMatrixSparse* A, int k, const int* parent, int* s, int* w);
73 
74  // Data
75  GMatrixSparse* m_L; // L for LU and Cholesky, V for QR
76  GMatrixSparse* m_U; // U for LU, R for QR, not used for Cholesky
77  int* m_pinv; // partial pivoting for LU
78  double* m_B; // beta [0..n-1] for QR
79  int m_n_pinv; // Number of elements in m_pinv
80  int m_n_B; // Number of elements in m_B
81 };
82 
83 #endif /* GSPARSENUMERIC_HPP */
GMatrixSparse * m_L
Sparse matrix class interface definition.
Generic matrix class definition.
Sparse matrix symbolic analysis class definition.
GMatrixSparse * m_U
friend std::ostream & operator<<(std::ostream &os, const GSparseNumeric &n)
Sparse matrix symbolic analysis class.
Sparse matrix numeric analysis class.
Vector class interface definition.
GSparseNumeric & operator=(const GSparseNumeric &n)
int cs_ereach(const GMatrixSparse *A, int k, const int *parent, int *s, int *w)
Sparse matrix class definition.
Exception handler interface definition.
virtual ~GSparseNumeric(void)
void cholesky_numeric_analysis(const GMatrixSparse &m, const GSparseSymbolic &s)