<br><br><div class="gmail_quote">On Tue, Apr 30, 2013 at 6:37 AM, Jordi Gutiérrez Hermoso <span dir="ltr"><<a href="mailto:jordigh@octave.org" target="_blank">jordigh@octave.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On 29 April 2013 17:51, Ed Meyer <<a href="mailto:eem2314@gmail.com">eem2314@gmail.com</a>> wrote:<br>
<br>
> I'm not saying numel() is to blame or should be changed, only that I<br>
> see no reason to ever use numel when handling sparse matrices unless<br>
> you are converting it to full in which case the current behavior is<br>
> ok.<br>
<br>
Well, look at the current implementation of trace (), in which numel<br>
is a perfectly reasonable function to call. If you don't want to ever<br>
call numel () for sparse matrices, then you would need to rewrite this<br>
function to check for sparsity as well as any other function that<br>
calls numel ().<br>
<br></blockquote><div><br></div><div>I think I see why numel() is getting called from trace(). isempty() is called which</div><div>calls is_empty() which should be virtual.  Were it to call the sparse version</div><div>of is_empty() there would be no problem because it tests the row & column</div>

<div>dimensions instead of calling numel(). So shouldn't is_empty() be virtual?</div><div><br></div></div>-- <br>Ed Meyer<br>