From help-request at octave dot org Tue Jan 31 09:22:26 2006 Subject: Re: nnz and char From: David Bateman To: "John W. Eaton" Cc: help at octave dot org Date: Tue, 31 Jan 2006 16:17:55 +0100 John W. Eaton wrote: > On 31-Jan-2006, David Bateman wrote: > > | This patch is not quite right. The problem is that there are two > methods > | in Sparse for the number of non-zero elements. These are "nnz" and > | "nonzero". "nnz" returns the size of data and ridx, while nonzero > | returns "cidx[ncol]"... For matlab compatiablity for sparse matrices, > | Fnnz should return "cidx[ncol]" rather than the size of ridx and data, > | which is why the old Fnnz in sparse.cc used the "nonzero" method of > | Sparse.. > > Can we swap the internal function names so that the Sparse nnz > function implements what is expected by the user-level nnz function? > Otherwise, I think we invite unnecessary confusion. > > Thanks, > > jwe > Grrr, I already use these definitions in numerous places.. It would be much easier to do it for the newly introduced code (do a grep on nnz and nonzero is src and liboctave)... D. -- David Bateman David dot Bateman at motorola dot com Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax) The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------