Mercurial > hg > octave-nkf
changeset 5591:e7e45fe274f1
[project @ 2006-01-10 21:20:34 by dbateman]
author | dbateman |
---|---|
date | Tue, 10 Jan 2006 21:20:34 +0000 |
parents | 1ad66ea35fe5 |
children | 61d6cebd243b |
files | src/ChangeLog src/DLD-FUNCTIONS/sparse.cc |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-01-10 David Bateman <dbateman@free.fr> + + * DLD-FUNCTIONS/sparse.cc (sparse_find): Use Sparse<T>::nonzero() + rather than Sparse<T>::nnz(), due to possibility of overallocation + of memory. + 2005-12-14 John W. Eaton <jwe@octave.org> * oct-stream.cc (octave_stream::invalid_stream_error): Delete.
--- a/src/DLD-FUNCTIONS/sparse.cc +++ b/src/DLD-FUNCTIONS/sparse.cc @@ -514,7 +514,7 @@ sparse_find (const SparseMatrix& v) { octave_value_list retval; - octave_idx_type nnz = v.nnz (); + octave_idx_type nnz = v.nonzero (); dim_vector dv = v.dims (); octave_idx_type nr = dv(0); octave_idx_type nc = dv (1); @@ -555,7 +555,7 @@ sparse_find (const SparseComplexMatrix& v) { octave_value_list retval; - octave_idx_type nnz = v.nnz (); + octave_idx_type nnz = v.nonzero (); dim_vector dv = v.dims (); octave_idx_type nr = dv(0); octave_idx_type nc = dv (1); @@ -596,7 +596,7 @@ sparse_find (const SparseBoolMatrix& v) { octave_value_list retval; - octave_idx_type nnz = v.nnz (); + octave_idx_type nnz = v.nonzero (); dim_vector dv = v.dims (); octave_idx_type nr = dv(0); octave_idx_type nc = dv (1);