Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regions -> True inside Cuba.jl? #13

Open
improbable-22 opened this issue Jul 19, 2017 · 3 comments
Open

Regions -> True inside Cuba.jl? #13

improbable-22 opened this issue Jul 19, 2017 · 3 comments
Labels

Comments

@improbable-22
Copy link

In the Mathematica interface to Cuba, I can obtain a list of the regions used by option Regions -> True. Is there any way to get this information in Julia?

After skimming the web page, it's unclear to me whether the C++ library exports this data, so perhaps this cannot be done.

@giordano
Copy link
Owner

I don't think this feature is exposed by the C library in the same way it is in Mathematica. A possibility is to use verbosity, this prints to screen many additional information including the list of subregions (but this is lee handy than what you're asking for). For example:

julia> cuhre((x, f) -> f[1] = cos(x[1]), flags = 3)
Cuhre input parameters:
  ndim 2
  ncomp 1
  nvec 1
  epsrel 0.0001
  epsabs 1e-12
  flags 3
  mineval 0
  maxeval 1000000
  key 0
  statefile ""

Region (0.000000) - (1.000000)
       (0.000000) - (1.000000)
[1] 0.841471 +- 2.22045e-16

Iteration 1:  65 integrand evaluations so far
[1] 0.841471 +- 2.22045e-16     chisq 0 (0 df)

Region (0.000000) - (0.500000)
       (0.000000) - (1.000000)
[1] 0.479426 +- 1.56691e-12

Region (0.500000) - (1.000000)
       (0.000000) - (1.000000)
[1] 0.362045 +- 1.1831e-12

Iteration 2:  195 integrand evaluations so far
[1] 0.841471 +- 2.22045e-16     chisq 1.86265e-09 (1 df)
Component:
 1: 0.8414709848078966 ± 2.2204460420128823e-16 (prob.: 3.443539937576958e-5)
Integrand evaluations: 195
Fail:                  0
Number of subregions:  2

@improbable-22
Copy link
Author

Thanks, I would not have thought of that.

Will experiment a bit...

@giordano
Copy link
Owner

In addition, Cuba library comes with a tool called partview which allows visualizing the tessellation. You can run a Julia script with verbosity = 3 from the command line and pipe the output to partview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants