octave-maintainers
[Top][All Lists]
Advanced

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

Re: [Pkg-octave-devel] Bug#706376: Bug#706376: octave: sparse matrix n*2


From: Ed Meyer
Subject: Re: [Pkg-octave-devel] Bug#706376: Bug#706376: octave: sparse matrix n*2^16
Date: Sat, 4 May 2013 17:50:47 -0700



On Tue, Apr 30, 2013 at 6:37 AM, Jordi Gutiérrez Hermoso <address@hidden> wrote:
On 29 April 2013 17:51, Ed Meyer <address@hidden> wrote:

> I'm not saying numel() is to blame or should be changed, only that I
> see no reason to ever use numel when handling sparse matrices unless
> you are converting it to full in which case the current behavior is
> ok.

Well, look at the current implementation of trace (), in which numel
is a perfectly reasonable function to call. If you don't want to ever
call numel () for sparse matrices, then you would need to rewrite this
function to check for sparsity as well as any other function that
calls numel ().


I think I see why numel() is getting called from trace(). isempty() is called which
calls is_empty() which should be virtual.  Were it to call the sparse version
of is_empty() there would be no problem because it tests the row & column
dimensions instead of calling numel(). So shouldn't is_empty() be virtual?

--
Ed Meyer

reply via email to

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