octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #36099] diag(1,N,M) produces NaNs


From: Twan van Laarhoven
Subject: [Octave-bug-tracker] [bug #36099] diag(1,N,M) produces NaNs
Date: Thu, 05 Apr 2012 14:16:24 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0

Follow-up Comment #1, bug #36099 (project octave):

Probable cause seems to be:
+verbose+
return Array<ST> (dim_vector (1, 1), scalar).diag (k);
-verbose-
The diag() function of Array produces a dense matrix instead of DiagMatrix
object. I think an MArray<ST> should be used instead.

That would also fix the issue that a dense matrix is produced, while it
shouldn't be:
+verbose+
octave:1> length(diag([1,2],1e5,1e5))
ans =  100000
octave:2> length(diag([1],1e5,1e5))
error: memory exhausted or requested size too large for range of Octave's
index type -- trying to return to prompt
-verbose-

This doesn't explain why Array::diag or Array::resize messes things up,
though.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36099>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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