5164
|
1 /* |
|
2 |
|
3 Copyright (C) 2004 David Bateman |
|
4 Copyright (C) 1998-2004 Andy Adler |
|
5 |
|
6 Octave is free software; you can redistribute it and/or modify it |
|
7 under the terms of the GNU General Public License as published by the |
|
8 Free Software Foundation; either version 2, or (at your option) any |
|
9 later version. |
|
10 |
|
11 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 for more details. |
|
15 |
|
16 You should have received a copy of the GNU General Public License |
5307
|
17 along with this program; see the file COPYING. If not, write to the |
|
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
19 Boston, MA 02110-1301, USA. |
5164
|
20 |
|
21 */ |
|
22 |
|
23 |
|
24 #if !defined (octave_sparse_base_lu_h) |
|
25 #define octave_sparse_base_lu_h 1 |
|
26 |
|
27 #include "MArray.h" |
|
28 |
|
29 template <class lu_type, class lu_elt_type, class p_type, class p_elt_type> |
|
30 class |
|
31 sparse_base_lu |
|
32 { |
|
33 public: |
|
34 |
|
35 sparse_base_lu (void) { } |
|
36 |
|
37 sparse_base_lu (const sparse_base_lu& a) |
|
38 : Lfact (a.Lfact), Ufact (a.Ufact), cond (a.cond), P (a.P), Q (a.Q) { } |
|
39 |
|
40 sparse_base_lu& operator = (const sparse_base_lu& a) |
|
41 { |
|
42 if (this != &a) |
|
43 { |
|
44 Lfact = a.Lfact; |
|
45 Ufact = a.Ufact; |
|
46 cond = a.cond; |
|
47 P = a.P; |
|
48 Q = a.Q; |
|
49 } |
|
50 return *this; |
|
51 } |
|
52 |
|
53 ~sparse_base_lu (void) { } |
|
54 |
|
55 lu_type L (void) const { return Lfact; } |
|
56 |
|
57 lu_type U (void) const { return Ufact; } |
|
58 |
|
59 p_type Pc (void) const; |
|
60 |
|
61 p_type Pr (void) const; |
|
62 |
|
63 MArray<int> row_perm (void) const { return P; } |
|
64 |
|
65 MArray<int> col_perm (void) const { return Q; } |
|
66 |
|
67 double rcond (void) const { return cond; } |
|
68 |
|
69 protected: |
|
70 |
|
71 lu_type Lfact; |
|
72 lu_type Ufact; |
|
73 |
|
74 double cond; |
|
75 |
|
76 MArray<int> P; |
|
77 MArray<int> Q; |
|
78 }; |
|
79 |
|
80 #endif |
|
81 |
|
82 /* |
|
83 ;;; Local Variables: *** |
|
84 ;;; mode: C++ *** |
|
85 ;;; End: *** |
|
86 */ |