finitediff
SNplu.h
Go to the documentation of this file.
1 /*
2 Copyright 2017 Laurent Claessens
3 contact : laurent@claessens-donadello.eu
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef __SNPLU_H__142039__
20 #define __SNPLU_H__142039__
21 
22 
23 #include "SNmatrices/SNmatrix.h"
27 
28 
29 // THE CLASS HEADER -----------------------------------------
30 
31 template <class T,unsigned int tp_size>
32 class SNplu
33 {
34 
36 
37  private :
38  Mpermutation<tp_size> data_P; // we store the "mathematical" permutation, not the matrix.
41 
49  void _setU(const SNmatrix<T,tp_size>& A);
57  void _setL(const SNmatrix<T,tp_size>& A);
58  public:
59 
63 
65 };
66 
67 // CONSTRUCTORS -----------------------
68 
69 
70 template <class T,unsigned int tp_size>
72 {
73  // TODO : non optimal because one could try to copy only the useful part.
74  data_U=A;
75 }
76 
77 template <class T,unsigned int tp_size>
79 {
80  // TODO : non optimal because one could try to copy only the useful part.
81  data_L=A;
82 }
83 
84 // GETTER METHODS -----------------------
85 
86 template <class T,unsigned int tp_size>
88 {
90 }
91 
92 template <class T,unsigned int tp_size>
94 {
95  return data_L;
96 }
97 
98 
99 template <class T,unsigned int tp_size>
101 {
102  return data_U;
103 }
104 
105 
106 template <class T,unsigned int tp_size>
108 {
109  return data_P;
110 }
111 
112 #endif
void _setU(const SNmatrix< T, tp_size > &A)
Definition: SNplu.h:71
Definition: SNupperTriangular.h:34
Represent a square numerical matrix.
Definition: SNline.h:29
Mpermutation< tp_size > getMpermutation() const
Definition: SNplu.h:107
SNplu< T, tp_size > getPLU() const
Definition: SNmatrix.h:317
Definition: SNplu.h:32
SNupperTriangular< T, tp_size > data_U
Definition: SNplu.h:40
SNpermutation< T, tp_size > getP() const
Definition: SNplu.h:87
SNlowerTriangular< T, tp_size > data_L
Definition: SNplu.h:39
Mpermutation< tp_size > data_P
Definition: SNplu.h:38
Represents a lower triangular matrix (the diagonal can be non zero).
Definition: SNlowerTriangular.h:37
SNlowerTriangular< T, tp_size > getL() const
Definition: SNplu.h:93
Definition: SNpermutation.h:36
This class represents a permutation (not a matrix).
Definition: MelementaryPermutation.h:26
void _setL(const SNmatrix< T, tp_size > &A)
Definition: SNplu.h:78
SNupperTriangular< T, tp_size > getU() const
Definition: SNplu.h:100