Constructing a function with imaginary numbers

Dear all,
I have a function that contains both real and imaginary part. For example y = a + _i_b. How can I construct such function using TF1 class?
Regards,
Haidar.


ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


You could map that into a 2d function, TF2.

@axel It seems to me the (s)he wants a function which returns a complex number.

That’s two TF2s, one for the real and one for the imaginary parts.

@moneta do we have a nicer way?

Yes, this what I want. Construct a function that can return a complex number.

You can write a simple standard C++ function which will use and return e.g. a std::complex<double> but you cannot “encapsulate” it into any ROOT “TF” object.

Eight years ago, @moneta wrote

I had a look on JIRA but I did not find any ticket asking for such feature. Maybe, it is time to open one in order to keep a track of this need.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.