-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
suave not handling large maxevals #27
Comments
I believe this is an upstream issue and I can't do anything about it. When running the following program: #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include "cuba.h"
#define NDIM 1
#define NCOMP 1
#define USERDATA NULL
#define NVEC 1
#define EPSREL 1e-8
#define EPSABS 1e-8
#define VERBOSE 0
#define LAST 4
#define SEED 0
#define MINEVAL 0
#define MAXEVAL 4611686018427387904
#define STATEFILE NULL
#define SPIN NULL
#define NNEW 1000
#define NMIN 2
static int Integrand(const int *ndim, const double xx[],
const int *ncomp, double ff[], void *userdata) {
ff[0] = 3.14;
return 0;
}
int main() {
int comp, nregions, fail;
long long int neval;
double integral[NCOMP], error[NCOMP], prob[NCOMP];
float start, end;
llSuave(NDIM, NCOMP, Integrand, USERDATA, NVEC,
EPSREL, EPSABS, VERBOSE | LAST, SEED,
MINEVAL, MAXEVAL, NNEW, NMIN, 25.0,
STATEFILE, SPIN,
&nregions, &neval, &fail, integral, error, prob);
printf("Result: %g\n", integral[0]);
return 0;
} I get
Instead this works fine with #define MAXEVAL 4611686018427387903 Please, report the issue to the author of the Cuba library, you can find his email in his website. |
Thanks for looking into this. I will send something to the author. In the mean time, maybe an update to the docs is in order since they explicitly state :
|
Hello, the docs state:
However, suave() seems to have issues returning NaN for large
maxevals < typemax(Int64)
. I have not observed this issue with the other integrators in Cuba.jlMWE:
The text was updated successfully, but these errors were encountered: