[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nnz and char

From: David Bateman
Subject: Re: nnz and char
Date: Tue, 31 Jan 2006 16:14:19 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20040923)

Andy Adler wrote:

On Tue, 31 Jan 2006, David Bateman wrote:
> This patch is not quite right. The problem is that there are two methods
> in Sparse<T> 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 used the "nonzero" method of
> Sparse<T>..


I'm embarassed to admit this, but I can't figure out what you said.

Could you explain what the difference is between cidx[ncol] and
length( ridx )?
Andy Adler <address@hidden> 1(613)562-5800x6218

In a compressed column sparse storage the actual number of elements stored in the matrix is cidx[ncol] where as the amount of memory actually allocated to store the elements might differ from this value. Within octave this doesn't cause a problem as the two always match. However, I have had matrices imported from matlab where this was not the case and that caused me much pain...


David Bateman                                address@hidden
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:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]