Mercurial > hg > octave-nkf
diff liboctave/sparse-base-chol.cc @ 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.cc +++ b/liboctave/sparse-base-chol.cc @@ -80,9 +80,10 @@ template <class chol_type, class chol_elt, class p_type> octave_idx_type sparse_base_chol<chol_type, chol_elt, p_type>::sparse_base_chol_rep::init - (const chol_type& a, bool natural, octave_idx_type nargout) + (const chol_type& a, bool natural, bool force) { volatile octave_idx_type info = 0; + #ifdef HAVE_CHOLMOD octave_idx_type a_nr = a.rows (); octave_idx_type a_nc = a.cols (); @@ -170,7 +171,7 @@ is_pd = cm->status == CHOLMOD_OK; info = (is_pd ? 0 : cm->status); - if (is_pd || nargout > 1) + if (is_pd || force) { BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; cond = CHOLMOD_NAME(rcond) (Lfactor, cm);