Mercurial > hg > octave-lyh
comparison liboctave/sparse-base-chol.h @ 10312:cbc402e64d83
untabify liboctave header files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:14:48 -0500 |
parents | 4c0cdbe0acca |
children | 9a308e96194e |
comparison
equal
deleted
inserted
replaced
10311:a217e1d74353 | 10312:cbc402e64d83 |
---|---|
35 #ifdef HAVE_CHOLMOD | 35 #ifdef HAVE_CHOLMOD |
36 class sparse_base_chol_rep | 36 class sparse_base_chol_rep |
37 { | 37 { |
38 public: | 38 public: |
39 sparse_base_chol_rep (void) : count (1), Lsparse (0), | 39 sparse_base_chol_rep (void) : count (1), Lsparse (0), |
40 is_pd (false), minor_p (0) { } | 40 is_pd (false), minor_p (0) { } |
41 | 41 |
42 sparse_base_chol_rep (const chol_type& a, | 42 sparse_base_chol_rep (const chol_type& a, |
43 const bool natural) : count (1) | 43 const bool natural) : count (1) |
44 { init (a, natural); } | 44 { init (a, natural); } |
45 | 45 |
46 sparse_base_chol_rep (const chol_type& a, octave_idx_type& info, | 46 sparse_base_chol_rep (const chol_type& a, octave_idx_type& info, |
47 const bool natural) : count (1) | 47 const bool natural) : count (1) |
48 { info = init (a, natural); } | 48 { info = init (a, natural); } |
49 | 49 |
50 ~sparse_base_chol_rep (void) | 50 ~sparse_base_chol_rep (void) |
51 { if (is_pd) CHOLMOD_NAME(free_sparse) (&Lsparse, &Common); } | 51 { if (is_pd) CHOLMOD_NAME(free_sparse) (&Lsparse, &Common); } |
52 | 52 |
53 cholmod_sparse * L (void) const { return Lsparse; } | 53 cholmod_sparse * L (void) const { return Lsparse; } |
54 | 54 |
55 octave_idx_type P (void) const | 55 octave_idx_type P (void) const |
56 { return (minor_p == static_cast<octave_idx_type>(Lsparse->ncol) ? | 56 { return (minor_p == static_cast<octave_idx_type>(Lsparse->ncol) ? |
57 0 : minor_p + 1); } | 57 0 : minor_p + 1); } |
58 | 58 |
59 ColumnVector perm (void) const { return perms + 1; } | 59 ColumnVector perm (void) const { return perms + 1; } |
60 | 60 |
61 p_type Q (void) const; | 61 p_type Q (void) const; |
62 | 62 |
91 { | 91 { |
92 public: | 92 public: |
93 sparse_base_chol_rep (void) : count (1), is_pd (false), minor_p (0) { } | 93 sparse_base_chol_rep (void) : count (1), is_pd (false), minor_p (0) { } |
94 | 94 |
95 sparse_base_chol_rep (const chol_type& a, | 95 sparse_base_chol_rep (const chol_type& a, |
96 const bool natural) : count (1) | 96 const bool natural) : count (1) |
97 { init (a, natural); } | 97 { init (a, natural); } |
98 | 98 |
99 sparse_base_chol_rep (const chol_type& a, octave_idx_type& info, | 99 sparse_base_chol_rep (const chol_type& a, octave_idx_type& info, |
100 const bool natural) : count (1) | 100 const bool natural) : count (1) |
101 { info = init (a, natural); } | 101 { info = init (a, natural); } |
102 | 102 |
103 ~sparse_base_chol_rep (void) { } | 103 ~sparse_base_chol_rep (void) { } |
104 | 104 |
105 octave_idx_type P (void) const { return 0; } | 105 octave_idx_type P (void) const { return 0; } |
138 sparse_base_chol (void) : rep (new typename | 138 sparse_base_chol (void) : rep (new typename |
139 sparse_base_chol<chol_type, chol_elt, p_type>::sparse_base_chol_rep ()) { } | 139 sparse_base_chol<chol_type, chol_elt, p_type>::sparse_base_chol_rep ()) { } |
140 | 140 |
141 sparse_base_chol (const chol_type& a, const bool n) : rep (new typename | 141 sparse_base_chol (const chol_type& a, const bool n) : rep (new typename |
142 sparse_base_chol<chol_type, chol_elt, p_type>:: | 142 sparse_base_chol<chol_type, chol_elt, p_type>:: |
143 sparse_base_chol_rep (a, n)) { } | 143 sparse_base_chol_rep (a, n)) { } |
144 | 144 |
145 sparse_base_chol (const chol_type& a, octave_idx_type& info, const bool n) : | 145 sparse_base_chol (const chol_type& a, octave_idx_type& info, const bool n) : |
146 rep (new typename sparse_base_chol<chol_type, chol_elt, p_type>:: | 146 rep (new typename sparse_base_chol<chol_type, chol_elt, p_type>:: |
147 sparse_base_chol_rep (a, info, n)) { } | 147 sparse_base_chol_rep (a, info, n)) { } |
148 | 148 |
149 sparse_base_chol (const sparse_base_chol<chol_type, chol_elt, p_type>& a) : | 149 sparse_base_chol (const sparse_base_chol<chol_type, chol_elt, p_type>& a) : |
150 rep (a.rep) { rep->count++; } | 150 rep (a.rep) { rep->count++; } |
151 | 151 |
152 ~sparse_base_chol (void) | 152 ~sparse_base_chol (void) |
153 { | 153 { |
154 if (--rep->count <= 0) | 154 if (--rep->count <= 0) |
155 delete rep; | 155 delete rep; |
156 } | 156 } |
157 | 157 |
158 sparse_base_chol& operator = (const sparse_base_chol& a) | 158 sparse_base_chol& operator = (const sparse_base_chol& a) |
159 { | 159 { |
160 if (this != &a) | 160 if (this != &a) |
161 { | 161 { |
162 if (--rep->count <= 0) | 162 if (--rep->count <= 0) |
163 delete rep; | 163 delete rep; |
164 | 164 |
165 rep = a.rep; | 165 rep = a.rep; |
166 rep->count++; | 166 rep->count++; |
167 } | 167 } |
168 | 168 |
169 return *this; | 169 return *this; |
170 } | 170 } |
171 | 171 |
172 chol_type L (void) const; | 172 chol_type L (void) const; |