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

Ed Meyer eem2314 at gmail.com
Sun May 5 00:50:47 UTC 2013


On Tue, Apr 30, 2013 at 6:37 AM, Jordi Gutiérrez Hermoso <jordigh at octave.org
> wrote:

> On 29 April 2013 17:51, Ed Meyer <eem2314 at gmail.com> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-octave-devel/attachments/20130504/c099bcce/attachment.html>


More information about the Pkg-octave-devel mailing list