Mercurial > hg > octave-lyh
annotate liboctave/sparse-base-lu.h @ 7515:f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
author | David Bateman <dbateman@free.fr> |
---|---|
date | Fri, 22 Feb 2008 15:50:51 +0100 |
parents | a1dbe9d80eee |
children | eb63fbe60fab |
rev | line source |
---|---|
5164 | 1 /* |
2 | |
7017 | 3 Copyright (C) 2004, 2005, 2007 David Bateman |
7016 | 4 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Andy Adler |
5 | |
6 This file is part of Octave. | |
5164 | 7 |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5164 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5164 | 21 |
22 */ | |
23 | |
24 | |
25 #if !defined (octave_sparse_base_lu_h) | |
26 #define octave_sparse_base_lu_h 1 | |
27 | |
28 #include "MArray.h" | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
29 #include "dSparse.h" |
5164 | 30 |
31 template <class lu_type, class lu_elt_type, class p_type, class p_elt_type> | |
32 class | |
33 sparse_base_lu | |
34 { | |
35 public: | |
36 | |
37 sparse_base_lu (void) { } | |
38 | |
39 sparse_base_lu (const sparse_base_lu& a) | |
40 : Lfact (a.Lfact), Ufact (a.Ufact), cond (a.cond), P (a.P), Q (a.Q) { } | |
41 | |
42 sparse_base_lu& operator = (const sparse_base_lu& a) | |
43 { | |
44 if (this != &a) | |
45 { | |
46 Lfact = a.Lfact; | |
47 Ufact = a.Ufact; | |
48 cond = a.cond; | |
49 P = a.P; | |
50 Q = a.Q; | |
51 } | |
52 return *this; | |
53 } | |
54 | |
55 ~sparse_base_lu (void) { } | |
56 | |
57 lu_type L (void) const { return Lfact; } | |
58 | |
59 lu_type U (void) const { return Ufact; } | |
60 | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
61 SparseMatrix R (void) const { return Rfact; } |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
62 |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
63 lu_type Y (void) const; |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
64 |
5164 | 65 p_type Pc (void) const; |
66 | |
67 p_type Pr (void) const; | |
68 | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
69 ColumnVector Pc_vec (void) const; |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
70 |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
71 ColumnVector Pr_vec (void) const; |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
72 |
5322 | 73 const octave_idx_type * row_perm (void) const { return P.fortran_vec (); } |
5164 | 74 |
5322 | 75 const octave_idx_type * col_perm (void) const { return Q.fortran_vec (); } |
5164 | 76 |
77 double rcond (void) const { return cond; } | |
78 | |
79 protected: | |
80 | |
81 lu_type Lfact; | |
82 lu_type Ufact; | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
83 SparseMatrix Rfact; |
5164 | 84 |
85 double cond; | |
86 | |
5322 | 87 MArray<octave_idx_type> P; |
88 MArray<octave_idx_type> Q; | |
5164 | 89 }; |
90 | |
91 #endif | |
92 | |
93 /* | |
94 ;;; Local Variables: *** | |
95 ;;; mode: C++ *** | |
96 ;;; End: *** | |
97 */ |