Can't call TSpectrumTransform::Transform(source,dest)


I try to run the example code in, and I get such error

[quote]Error: Can’t call TSpectrumTransform::Transform(source,dest) in current scope Transform.C:49:
Possible candidates are…
(in TSpectrumTransform)
~/root/lib/ -1:-1 0 public: void TSpectrumTransform::Transform(const float* source,float* destVector);
*** Interpreter error recovered ***

Then, I change

Double_t * source = new Double_t[nbins]; Double_t * dest = new Double_t[nbins];

Float_t * source = new Float_t[nbins]; Float_t* dest = new Float_t[nbins];

it works well.

So, is it an error in the example?


According to the doc this function uses double: … :Transform

[quote=“couet”]According to the doc this function uses double: … :Transform[/quote]

However, according to the source code,

void TSpectrumTransform::Transform(const float *source, float *destVector) { /////////////////////////////////////////////////////////////////////////////// // ONE-DIMENSIONAL TRANSFORM FUNCTION // This function transforms the source spectrum. The calling program // should fill in input parameters. // Transformed data are written into dest spectrum. // // Function parameters: // source-pointer to the vector of source spectrum, its length should // be size except for inverse FOURIER, FOUR-WALSH, FOUR-HAAR // transform. These need 2*size length to supply real and // imaginary coefficients.
we should use float instead of double (as well as the header file

Unless the code of TSpectrumTransform.cxx and TSpectrumTransform.h I found are the older version, that doc is wrong.

I see… It is a float in 534 but a double in the root-trunk.;a … 2845171ef2

[quote=“couet”]I see… It is a float in 534 but a double in the root-trunk.;a … 2845171ef2[/quote]

I will take a break.

Good day.