JohannesBuchner / cuba

Cuba - a library for multidimensional numerical integration
http://www.feynarts.de/cuba/
GNU Lesser General Public License v3.0
17 stars 6 forks source link

userdata #4

Open mariuscristian123 opened 4 years ago

mariuscristian123 commented 4 years ago

I would like to ask a question about how to use userdata argument in cuba subroutines Please tell me if you can help me in this problem Thank you for your cooperation

JohannesBuchner commented 4 years ago

Just access the global variable from the function.

JohannesBuchner commented 4 years ago

Alternatively, you can also use a class method as a callback function, and access self.

mariuscristian123 commented 4 years ago

I have passed two parameter a(i),b(i) for i=1,n to function integrand via /common/ . I call in a cicle cuhre subroutine . For each a(i),b(i), cuhre subroutine computes very well integrand. I want to write a(i),b(i) and "integral" (in a file). Now cuhre does not write the results in the manner wanted by me ( It write more n lines ). Please excuse my english. I hope you understand what i want to say

JohannesBuchner commented 4 years ago

If you need help with cuba, please ask the author (Thomas Hahn). I only added a python interface (part of the pymultinest package).

mariuscristian123 commented 4 years ago

Thank you very much for your advice