[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #43673] fft() gives incorrect result for 3-dim
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #43673] fft() gives incorrect result for 3-dim array with singleton 3rd dimension |
Date: |
Tue, 06 Jan 2015 17:26:01 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0 |
Follow-up Comment #10, bug #43673 (project octave):
Sorry, we're a skeleton crew that takes care of Octave. The patch generally
looks good. One question, in fft.cc if the desired dim is greater than the
dimensions of the existing object it resizes the dimensions of the object and
then passes it down to liboctave for the rest of the FFT processing.
if (dims(i) < 0)
return retval;
+ if (dim >= dims.length ())
+ {
+ dims = dims.redim (dim + 1);
+ }
+
Why not just short-circuit at this point and return the original argument?
+ if (dim >= dims.length ())
+ {
+ retval = arg;
+ return retval;
+ }
I agree that you also have to add the same code in dNDarray.cc and its
relatives because people can link directly against liboctave if they want too
without using the interpreter.
+ if (dim >= dv.length ())
+ {
+ ComplexNDArray retval (*this);
+ return retval;
+ }
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?43673>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/