TVirtualFFT and TFFTRealComplex GetPoints function

I’m not sure if I’m making a mistake, if this is a limit of CINT or if it’s a bug, but I’m having trouble using the GetPoints function in both TVirtualFFT (using r2c) and TFFTRealComplex.

Code:
In CINT, I have a Short_t array with size 4096, named sarr:

TVirtualFFT example:

  // sarr previously defined as Short_t[4096]

  Int_t N = 4096;
  TVirtualFFT *fft = TVirtualFFT::FFT(1, &N, "R2C");

  for(Int_t ii = 0; ii < 4096; ii++)
    fft->SetPoint(ii, (Double_t)sarr[ii]);  
  fft->Transform();

  Double_t *output;
  fft->GetPoints(output);

Then I end up with an error like this:
*** Break *** segmentation violation
Attaching to program: /proc/18217/exe, process 18217
[Thread debugging using libthread_db enabled]
[New Thread 0xb70b5b30 (LWP 18217)]
0xb7f3b410 in __kernel_vsyscall ()
error detected on stdin

Note:

This also fails in the same way in CINT if the last two lines are changed to:

  Double_t *oarr1, *oarr2;
  fft->GetPointsComplex(oarr1, oarr2);

As well as:

  Double_t *oarr1;
  fft->GetPointsComplex(oarr1);

Both with and without the last Boolean argument. Also, all code fails in both 5.18 and 5.22.

Hi,

As hinted at by the documentation:[quote]//Copies the output (or input) points into the provided array, that should
//be big enough[/quote]
You should initialize output, oarr1, oarr2 to point to arrays of double large enough … You are currently passing uninitialized memory.

Cheers,
Philippe.