Mercurial > octave-nkf
comparison liboctave/sparse-base-lu.h @ 5164:57077d0ddc8e
[project @ 2005-02-25 19:55:24 by jwe]
author | jwe |
---|---|
date | Fri, 25 Feb 2005 19:55:28 +0000 |
parents | |
children | 4c8a2e4e0717 |
comparison
equal
deleted
inserted
replaced
5163:9f3299378193 | 5164:57077d0ddc8e |
---|---|
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 | |
17 along with this program; see the file COPYING. If not, write to the Free | |
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
19 | |
20 */ | |
21 | |
22 | |
23 #if !defined (octave_sparse_base_lu_h) | |
24 #define octave_sparse_base_lu_h 1 | |
25 | |
26 #include "MArray.h" | |
27 | |
28 template <class lu_type, class lu_elt_type, class p_type, class p_elt_type> | |
29 class | |
30 sparse_base_lu | |
31 { | |
32 public: | |
33 | |
34 sparse_base_lu (void) { } | |
35 | |
36 sparse_base_lu (const sparse_base_lu& a) | |
37 : Lfact (a.Lfact), Ufact (a.Ufact), cond (a.cond), P (a.P), Q (a.Q) { } | |
38 | |
39 sparse_base_lu& operator = (const sparse_base_lu& a) | |
40 { | |
41 if (this != &a) | |
42 { | |
43 Lfact = a.Lfact; | |
44 Ufact = a.Ufact; | |
45 cond = a.cond; | |
46 P = a.P; | |
47 Q = a.Q; | |
48 } | |
49 return *this; | |
50 } | |
51 | |
52 ~sparse_base_lu (void) { } | |
53 | |
54 lu_type L (void) const { return Lfact; } | |
55 | |
56 lu_type U (void) const { return Ufact; } | |
57 | |
58 p_type Pc (void) const; | |
59 | |
60 p_type Pr (void) const; | |
61 | |
62 MArray<int> row_perm (void) const { return P; } | |
63 | |
64 MArray<int> col_perm (void) const { return Q; } | |
65 | |
66 double rcond (void) const { return cond; } | |
67 | |
68 protected: | |
69 | |
70 lu_type Lfact; | |
71 lu_type Ufact; | |
72 | |
73 double cond; | |
74 | |
75 MArray<int> P; | |
76 MArray<int> Q; | |
77 }; | |
78 | |
79 #endif | |
80 | |
81 /* | |
82 ;;; Local Variables: *** | |
83 ;;; mode: C++ *** | |
84 ;;; End: *** | |
85 */ |