<br><br><div class="gmail_quote">On Mon, Apr 29, 2013 at 12:12 PM, 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">

<div class="im">On 29 April 2013 14:50, Ed Meyer <<a href="mailto:eem2314@gmail.com">eem2314@gmail.com</a>> wrote:<br>
> I'm not proposing using anything but octave_idx_type for indexing or<br>
> changing the return type of numel() - I just question why numel() is<br>
> used for sparse matrices. It should be irrelevant for anything but<br>
> ccs2full().<br>
<br>
</div>The numel function is just one example where this sparse matrix with<br>
big dimensions broke. Sparse matrices this large can still break in<br>
other ways. Furthermore, what do you propose to do if numel is called<br>
for sparse matrices, despite your suggestion to not call it for sparse<br>
matrices? A lot of code out there already assumes that you can treat a<br>
sparse matrix like any other matrix. I don't think numel is to blame.<br></blockquote><div> </div><div>I'm not saying numel() is to blame or should be changed, only that I see no reason</div><div>to ever use numel when handling sparse matrices unless you are converting it</div>

<div>to full in which case the current behavior is ok.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Another way I can think of would be that A(idx) would also break if<br>
idx is greater than the maximum index size. We would have to introduce<br>
special rules to handle that for sparse matrices of large dimensions.<br></blockquote><div><br></div><div>Here again, why would you ever want A(idx) for a sparse matrix?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<br>
The problem isn't the storage size, it's the index size, which is why<br>
for other matrices Octave's error message says out of memory or index<br>
too big. I really don't see a way around this other than introducing a<br>
special index type for sparse matrices, and I don't see this as hugely<br>
useful. It also looks like a lot of boring work.<br></blockquote><div><br></div><div>I agree that a special index type is the wrong approach; what I'm saying is</div><div>that with sparse matrices you should never run into this problem in the first</div>

<div>place if you don't try to treat them the same as full. Otherwise why have</div><div>sparse matrices at all?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<br>
But if you insist on doing this, don't let me discourage you. If you<br>
can figure out a consistent behaviour that doesn't break current code,<br>
you write the patch, and all tests pass, I'll happily apply it.<br></blockquote><div><br></div><div>this doesn't seem to be a burning issue so I'll shut up</div></div><br clear="all"><div><br></div>-- <br>Ed Meyer<br>