Mercurial > hg > octave-nkf
annotate liboctave/sparse-base-lu.h @ 15283:a95432e7309c stable release-3-6-3
Version 3.6.3 released.
* configure.ac (AC_INIT): Version is now 3.6.3.
(OCTAVE_RELEASE_DATE): Now 2012-09-04.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 04 Sep 2012 13:17:13 -0400 |
parents | 72c96de7a403 |
children |
rev | line source |
---|---|
5164 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
3 Copyright (C) 2004-2012 David Bateman |
11523 | 4 Copyright (C) 1998-2004 Andy Adler |
7016 | 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 | |
11505
9a308e96194e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
37 sparse_base_lu (void) |
9a308e96194e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
38 : Lfact (), Ufact (), Rfact (), cond (0), P (), Q () { } |
5164 | 39 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
40 sparse_base_lu (const sparse_base_lu& a) |
11505
9a308e96194e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
41 : Lfact (a.Lfact), Ufact (a.Ufact), Rfact (), cond (a.cond), |
9a308e96194e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
42 P (a.P), Q (a.Q) |
9a308e96194e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
43 { } |
5164 | 44 |
45 sparse_base_lu& operator = (const sparse_base_lu& a) | |
46 { | |
47 if (this != &a) | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
48 { |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
49 Lfact = a.Lfact; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
50 Ufact = a.Ufact; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
51 cond = a.cond; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
52 P = a.P; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
53 Q = a.Q; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
54 } |
5164 | 55 return *this; |
56 } | |
57 | |
11505
9a308e96194e
more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
58 virtual ~sparse_base_lu (void) { } |
5164 | 59 |
60 lu_type L (void) const { return Lfact; } | |
61 | |
62 lu_type U (void) const { return Ufact; } | |
63 | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
64 SparseMatrix R (void) const { return Rfact; } |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
65 |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
66 lu_type Y (void) const; |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
67 |
5164 | 68 p_type Pc (void) const; |
69 | |
70 p_type Pr (void) const; | |
71 | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
72 ColumnVector Pc_vec (void) const; |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
73 |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
74 ColumnVector Pr_vec (void) const; |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
75 |
8969
3ecbc236e2e0
Have sparse LU return permutation matrices rather than sparse matrices.
Jason Riedy <jason@acm.org>
parents:
8920
diff
changeset
|
76 PermMatrix Pc_mat (void) const; |
3ecbc236e2e0
Have sparse LU return permutation matrices rather than sparse matrices.
Jason Riedy <jason@acm.org>
parents:
8920
diff
changeset
|
77 |
3ecbc236e2e0
Have sparse LU return permutation matrices rather than sparse matrices.
Jason Riedy <jason@acm.org>
parents:
8920
diff
changeset
|
78 PermMatrix Pr_mat (void) const; |
3ecbc236e2e0
Have sparse LU return permutation matrices rather than sparse matrices.
Jason Riedy <jason@acm.org>
parents:
8920
diff
changeset
|
79 |
5322 | 80 const octave_idx_type * row_perm (void) const { return P.fortran_vec (); } |
5164 | 81 |
5322 | 82 const octave_idx_type * col_perm (void) const { return Q.fortran_vec (); } |
5164 | 83 |
84 double rcond (void) const { return cond; } | |
85 | |
86 protected: | |
87 | |
88 lu_type Lfact; | |
89 lu_type Ufact; | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
90 SparseMatrix Rfact; |
5164 | 91 |
92 double cond; | |
93 | |
5322 | 94 MArray<octave_idx_type> P; |
95 MArray<octave_idx_type> Q; | |
5164 | 96 }; |
97 | |
98 #endif |