Mercurial > jwe > octave
comparison libinterp/dldfcn/chol.cc @ 21145:307096fb67e1
revamp sparse Cholesky factorization classes
* sparse-chol.h, sparse-chol.cc: Rename from sparse-base-chol.h and
sparse-base-chol.cc, respectively.
(class sparse_chol): Rename from sparse_base_chol. Incorporate code
from SparseCmplxCHOL and SparsedbleCHOL classes into the sparse_chol
template. Hide representation and HAVE_CHOLMOD macro from public
interface.
* sparse-chol-inst.cc: New file.
* SparseCmplxCHOL.cc, SparseCmplxCHOL.h, SparsedbleCHOL.cc,
SparsedbleCHOL.h: Delete.
* chol.cc, symbfact.cc, CSparse.cc, dSparse.cc, eigs-base.cc: Change
all uses of SparsedbleCHOL and SparseCmplxCHOL to use new
sparse_chol template class.
* liboctave/numeric/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Jan 2016 16:30:54 -0500 |
parents | 538b57866b90 |
children | fcac5dbbf9ed |
comparison
equal
deleted
inserted
replaced
21144:76e0ef020dae | 21145:307096fb67e1 |
---|---|
29 | 29 |
30 #include "CmplxCHOL.h" | 30 #include "CmplxCHOL.h" |
31 #include "dbleCHOL.h" | 31 #include "dbleCHOL.h" |
32 #include "fCmplxCHOL.h" | 32 #include "fCmplxCHOL.h" |
33 #include "floatCHOL.h" | 33 #include "floatCHOL.h" |
34 #include "SparseCmplxCHOL.h" | 34 #include "sparse-chol.h" |
35 #include "SparsedbleCHOL.h" | |
36 #include "oct-spparms.h" | 35 #include "oct-spparms.h" |
37 #include "sparse-util.h" | 36 #include "sparse-util.h" |
38 | 37 |
39 #include "ov-re-sparse.h" | 38 #include "ov-re-sparse.h" |
40 #include "ov-cx-sparse.h" | 39 #include "ov-cx-sparse.h" |
192 | 191 |
193 if (arg.is_real_type ()) | 192 if (arg.is_real_type ()) |
194 { | 193 { |
195 SparseMatrix m = arg.sparse_matrix_value (); | 194 SparseMatrix m = arg.sparse_matrix_value (); |
196 | 195 |
197 SparseCHOL fact (m, info, natural, force); | 196 sparse_chol<SparseMatrix> fact (m, info, natural, force); |
198 | 197 |
199 if (nargout == 3) | 198 if (nargout == 3) |
200 { | 199 { |
201 if (vecout) | 200 if (vecout) |
202 retval(2) = fact.perm (); | 201 retval(2) = fact.perm (); |
217 } | 216 } |
218 else if (arg.is_complex_type ()) | 217 else if (arg.is_complex_type ()) |
219 { | 218 { |
220 SparseComplexMatrix m = arg.sparse_complex_matrix_value (); | 219 SparseComplexMatrix m = arg.sparse_complex_matrix_value (); |
221 | 220 |
222 SparseComplexCHOL fact (m, info, natural, force); | 221 sparse_chol<SparseComplexMatrix> fact (m, info, natural, force); |
223 | 222 |
224 if (nargout == 3) | 223 if (nargout == 3) |
225 { | 224 { |
226 if (vecout) | 225 if (vecout) |
227 retval(2) = fact.perm (); | 226 retval(2) = fact.perm (); |
356 | 355 |
357 if (arg.is_real_type ()) | 356 if (arg.is_real_type ()) |
358 { | 357 { |
359 SparseMatrix m = arg.sparse_matrix_value (); | 358 SparseMatrix m = arg.sparse_matrix_value (); |
360 | 359 |
361 SparseCHOL chol (m, info); | 360 sparse_chol<SparseMatrix> chol (m, info); |
362 | 361 |
363 if (info == 0) | 362 if (info == 0) |
364 retval = chol.inverse (); | 363 retval = chol.inverse (); |
365 else | 364 else |
366 error ("cholinv: A must be positive definite"); | 365 error ("cholinv: A must be positive definite"); |
367 } | 366 } |
368 else if (arg.is_complex_type ()) | 367 else if (arg.is_complex_type ()) |
369 { | 368 { |
370 SparseComplexMatrix m = arg.sparse_complex_matrix_value (); | 369 SparseComplexMatrix m = arg.sparse_complex_matrix_value (); |
371 | 370 |
372 SparseComplexCHOL chol (m, info); | 371 sparse_chol<SparseComplexMatrix> chol (m, info); |
373 | 372 |
374 if (info == 0) | 373 if (info == 0) |
375 retval = chol.inverse (); | 374 retval = chol.inverse (); |
376 else | 375 else |
377 error ("cholinv: A must be positive definite"); | 376 error ("cholinv: A must be positive definite"); |