annotate liboctave/numeric/sparse-base-chol.h @ 19898:4197fc428c7d

maint: Update copyright notices for 2015.
author John W. Eaton <jwe@octave.org>
date Wed, 11 Feb 2015 14:19:08 -0500
parents 49a5a4be04a1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
1 /*
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
2
19898
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17769
diff changeset
3 Copyright (C) 2005-2015 David Bateman
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11505
diff changeset
4 Copyright (C) 1998-2005 Andy Adler
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5512
diff changeset
5
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5512
diff changeset
6 This file is part of Octave.
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
7
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5512
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5512
diff changeset
11 option) any later version.
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
12
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
16 for more details.
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
17
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5512
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5512
diff changeset
20 <http://www.gnu.org/licenses/>.
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
21
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
22 */
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
23
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
24 #if !defined (octave_sparse_base_chol_h)
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
25 #define octave_sparse_base_chol_h 1
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
26
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
27 #include "oct-sparse.h"
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
28 #include "dColVector.h"
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
29
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
30 template <class chol_type, class chol_elt, class p_type>
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
31 class
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
32 sparse_base_chol
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
33 {
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
34 protected:
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
35 #ifdef HAVE_CHOLMOD
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
36 class sparse_base_chol_rep
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
37 {
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
38 public:
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
39 sparse_base_chol_rep (void)
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
40 : count (1), Lsparse (0), Common (), is_pd (false), minor_p (0),
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
41 perms (), cond (0)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
42 { }
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
43
15264
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
44 sparse_base_chol_rep (const chol_type& a, bool natural, bool force)
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
45 : count (1), Lsparse (0), Common (), is_pd (false), minor_p (0),
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
46 perms (), cond (0)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
47 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
48 init (a, natural, force);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
49 }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
50
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
51 sparse_base_chol_rep (const chol_type& a, octave_idx_type& info,
15264
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
52 bool natural, bool force)
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
53 : count (1), Lsparse (0), Common (), is_pd (false), minor_p (0),
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
54 perms (), cond (0)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
55 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
56 info = init (a, natural, force);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
57 }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
58
7637
2be056f03720 Fix fall back from sparse cholesky factorization to LU when matrix detected as not being positive definite
David Bateman <dbateman@free.fr>
parents: 7520
diff changeset
59 ~sparse_base_chol_rep (void)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
60 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
61 if (is_pd)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
62 CHOLMOD_NAME (free_sparse) (&Lsparse, &Common);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
63 }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
64
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
65 cholmod_sparse * L (void) const { return Lsparse; }
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
66
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
67 octave_idx_type P (void) const
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
68 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
69 return (minor_p == static_cast<octave_idx_type>(Lsparse->ncol) ?
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
70 0 : minor_p + 1);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
71 }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
72
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
73 ColumnVector perm (void) const { return perms + 1; }
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
74
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
75 p_type Q (void) const;
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
76
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
77 bool is_positive_definite (void) const { return is_pd; }
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
78
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
79 double rcond (void) const { return cond; }
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
80
12125
a21a3875ca83 implement a common class for reference counts
Jaroslav Hajek <highegg@gmail.com>
parents: 12122
diff changeset
81 octave_refcount<int> count;
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
82
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
83 private:
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
84 cholmod_sparse *Lsparse;
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
85
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
86 cholmod_common Common;
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
87
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
88 bool is_pd;
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
89
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
90 octave_idx_type minor_p;
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
91
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
92 ColumnVector perms;
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
93
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
94 double cond;
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
95
15264
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
96 octave_idx_type init (const chol_type& a, bool natural, bool force);
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
97
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
98 void drop_zeros (const cholmod_sparse* S);
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
99
12122
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
100 // No copying!
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
101
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
102 sparse_base_chol_rep (const sparse_base_chol_rep&);
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
103
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
104 sparse_base_chol_rep& operator = (const sparse_base_chol_rep&);
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
105 };
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
106 #else
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
107 class sparse_base_chol_rep
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
108 {
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
109 public:
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
110 sparse_base_chol_rep (void)
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
111 : count (1), is_pd (false), minor_p (0), perms (), cond (0) { }
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
112
15264
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
113 sparse_base_chol_rep (const chol_type& a, bool natural, bool force)
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
114 : count (1), is_pd (false), minor_p (0), perms (), cond (0)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
115 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
116 init (a, natural, force);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
117 }
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
118
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
119 sparse_base_chol_rep (const chol_type& a, octave_idx_type& info,
15264
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
120 bool natural, bool force)
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
121 : count (1), is_pd (false), minor_p (0), perms (), cond (0)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
122 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
123 info = init (a, natural, force);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
124 }
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
125
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
126 ~sparse_base_chol_rep (void) { }
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
127
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
128 octave_idx_type P (void) const { return 0; }
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
129
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
130 ColumnVector perm (void) const { return perms + 1; }
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
131
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
132 p_type Q (void) const;
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
133
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
134 bool is_positive_definite (void) const { return is_pd; }
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
135
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
136 double rcond (void) const { return cond; }
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
137
12125
a21a3875ca83 implement a common class for reference counts
Jaroslav Hajek <highegg@gmail.com>
parents: 12122
diff changeset
138 octave_refcount<int> count;
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
139
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
140 private:
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
141 bool is_pd;
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
142
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
143 octave_idx_type minor_p;
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
144
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
145 ColumnVector perms;
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
146
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
147 double cond;
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
148
15264
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
149 octave_idx_type init (const chol_type& a, bool natural, bool force);
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
150
12122
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
151 // No copying!
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
152
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
153 sparse_base_chol_rep (const sparse_base_chol_rep&);
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
154
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
155 sparse_base_chol_rep& operator = (const sparse_base_chol_rep&);
5512
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
156 };
7c8767d0ffc0 [project @ 2005-10-27 02:20:17 by jwe]
jwe
parents: 5511
diff changeset
157 #endif
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
158
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
159 private:
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
160 sparse_base_chol_rep *rep;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
161
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
162 public:
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
163
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
164 sparse_base_chol (void)
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
165 : rep (new typename
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
166 sparse_base_chol<chol_type, chol_elt, p_type>
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
167 ::sparse_base_chol_rep ())
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
168 { }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
169
15264
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
170 sparse_base_chol (const chol_type& a, bool natural, bool force)
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
171 : rep (new typename
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
172 sparse_base_chol<chol_type, chol_elt, p_type>
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
173 ::sparse_base_chol_rep (a, natural, force))
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
174 { }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
175
15264
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
176 sparse_base_chol (const chol_type& a, octave_idx_type& info,
94cdf82d4a0c don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents: 15185
diff changeset
177 bool natural, bool force)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
178 : rep (new typename
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
179 sparse_base_chol<chol_type, chol_elt, p_type>
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
180 ::sparse_base_chol_rep (a, info, natural, force))
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
181 { }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
182
11505
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
183 sparse_base_chol (const sparse_base_chol<chol_type, chol_elt, p_type>& a)
9a308e96194e more data member initialization fixes
John W. Eaton <jwe@octave.org>
parents: 10312
diff changeset
184 : rep (a.rep)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
185 { rep->count++; }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
186
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
187 virtual ~sparse_base_chol (void)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
188 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
189 if (--rep->count == 0)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
190 delete rep;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
191 }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
192
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
193 sparse_base_chol& operator = (const sparse_base_chol& a)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
194 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
195 if (this != &a)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
196 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
197 if (--rep->count == 0)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
198 delete rep;
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
199
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
200 rep = a.rep;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
201 rep->count++;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
202 }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
203
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
204 return *this;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
205 }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
206
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
207 chol_type L (void) const;
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
208
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
209 chol_type R (void) const { return L ().hermitian (); }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
210
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
211 octave_idx_type P (void) const { return rep->P (); }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
212
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
213 ColumnVector perm (void) const { return rep->perm (); }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
214
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
215 p_type Q (void) const { return rep->Q (); }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
216
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
217 bool is_positive_definite (void) const
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
218 { return rep->is_positive_definite (); }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
219
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
220 double rcond (void) const { return rep->rcond (); }
5506
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
221
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
222 chol_type inverse (void) const;
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
223 };
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
224
b4cfbb0ec8c4 [project @ 2005-10-23 19:09:32 by dbateman]
dbateman
parents:
diff changeset
225 #endif