Mercurial > octave-nkf
diff liboctave/sparse-base-chol.h @ 15264:94cdf82d4a0c
don't overload meaning of info in Sparse Cholesky factorization functions
* chol.cc (Fchol): New variable, force. Always pass natural
and force to SparseCHOL and SparseComplexCHOL constructors.
* SparsedbleCHOL.h, SparsedbleCHOL.cc (SparseCHOL::SparseCHOL):
New arg, force. Pass it to sparse_base_chol constructor.
* SparseCmplxCHOL.h, SparseCmplxCHOL.cc
(SparseComplexCHOL::SparseComplexCHOL): Likewise.
* sparse-base-chol.h (sparse_base_chol<>::sparse_base_chol_rep::init):
* sparse-base-chol.h, sparse-base-chol.cc
(sparse_base_chol<>::sparse_base_chol_rep::init): Replace nargout
argument with force. Check force, not nargout > 1.
* sparse-base-chol.h
(sparse_base_chol::sparse_base_chol_rep::sparse_base_chol_rep):
New arg, force. Pass it to init.
(sparse_base_chol::sparse_base_chol): New arg force. Pass it to rep
constructor.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 30 Aug 2012 16:57:24 -0400 |
parents | 82d51d6e470c |
children |
line wrap: on
line diff
--- a/liboctave/sparse-base-chol.h Thu Aug 30 20:52:40 2012 +0200 +++ b/liboctave/sparse-base-chol.h Thu Aug 30 16:57:24 2012 -0400 @@ -41,19 +41,19 @@ perms (), cond (0) { } - sparse_base_chol_rep (const chol_type& a, const bool natural) + sparse_base_chol_rep (const chol_type& a, bool natural, bool force) : count (1), Lsparse (0), Common (), is_pd (false), minor_p (0), perms (), cond (0) { - init (a, natural); + init (a, natural, force); } sparse_base_chol_rep (const chol_type& a, octave_idx_type& info, - const bool natural) + bool natural, bool force) : count (1), Lsparse (0), Common (), is_pd (false), minor_p (0), perms (), cond (0) { - info = init (a, natural, info); + info = init (a, natural, force); } ~sparse_base_chol_rep (void) @@ -93,8 +93,7 @@ double cond; - octave_idx_type init (const chol_type& a, bool natural = true, - octave_idx_type nargout = 1); + octave_idx_type init (const chol_type& a, bool natural, bool force); void drop_zeros (const cholmod_sparse* S); @@ -111,18 +110,17 @@ sparse_base_chol_rep (void) : count (1), is_pd (false), minor_p (0), perms (), cond (0) { } - sparse_base_chol_rep (const chol_type& a, - const bool natural) + sparse_base_chol_rep (const chol_type& a, bool natural, bool force) : count (1), is_pd (false), minor_p (0), perms (), cond (0) { - init (a, natural); + init (a, natural, force); } sparse_base_chol_rep (const chol_type& a, octave_idx_type& info, - const bool natural) + bool natural, bool force) : count (1), is_pd (false), minor_p (0), perms (), cond (0) { - info = init (a, natural, info); + info = init (a, natural, force); } ~sparse_base_chol_rep (void) { } @@ -148,8 +146,7 @@ double cond; - octave_idx_type init (const chol_type& a, bool natural = true, - octave_idx_type nargout = 0); + octave_idx_type init (const chol_type& a, bool natural, bool force); // No copying! @@ -169,13 +166,14 @@ sparse_base_chol<chol_type, chol_elt, p_type>::sparse_base_chol_rep ()) { } - sparse_base_chol (const chol_type& a, const bool n) + sparse_base_chol (const chol_type& a, bool natural, bool force) : rep (new typename - sparse_base_chol<chol_type, chol_elt, p_type>::sparse_base_chol_rep (a, n)) + sparse_base_chol<chol_type, chol_elt, p_type>::sparse_base_chol_rep (a, natural, force)) { } - sparse_base_chol (const chol_type& a, octave_idx_type& info, const bool n) - : rep (new typename sparse_base_chol<chol_type, chol_elt, p_type>::sparse_base_chol_rep (a, info, n)) + sparse_base_chol (const chol_type& a, octave_idx_type& info, + bool natural, bool force) + : rep (new typename sparse_base_chol<chol_type, chol_elt, p_type>::sparse_base_chol_rep (a, info, natural, force)) { } sparse_base_chol (const sparse_base_chol<chol_type, chol_elt, p_type>& a)