aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArun Isaac2021-02-23 16:21:51 +0530
committerArun Isaac2021-02-23 16:21:51 +0530
commit59c0f5d621d665a2ab48cc760b561a7b610ab5fd (patch)
tree71a71224b4d8061bd9abc1ea87ac24b2e454b883 /include
parentaa8f62acf46a3b9d05ca675044edac15213b7095 (diff)
downloadnsmc-59c0f5d621d665a2ab48cc760b561a7b610ab5fd.tar.gz
nsmc-59c0f5d621d665a2ab48cc760b561a7b610ab5fd.tar.lz
nsmc-59c0f5d621d665a2ab48cc760b561a7b610ab5fd.zip
Redefine integrand_t as a struct.
This change will make it easier for the scheme wrapper to curry integrands. * include/extent-sampling.h (integrand_t): Redefine type as struct. (integral): Pass pointer to integrand_t. * src/extent-sampling.sc (integral-per-direction, integral): Handle new integrand-t type. (invoke-integrand): New sc macro.
Diffstat (limited to 'include')
-rw-r--r--include/extent-sampling.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/extent-sampling.h b/include/extent-sampling.h
index 27314a3..ef64fe3 100644
--- a/include/extent-sampling.h
+++ b/include/extent-sampling.h
@@ -10,7 +10,10 @@ typedef struct {
void *params;
} extent_oracle_t;
-typedef double (*integrand_t) (double, const gsl_vector*);
+typedef struct {
+ double (*integrand) (double, const gsl_vector*, void*);
+ void *params;
+} integrand_t;
void init_random (void);
@@ -25,7 +28,7 @@ double volume_window
unsigned int* number_of_samples);
double integral
-(integrand_t integrand, extent_oracle_t *extent_oracle, double true_integral,
+(integrand_t *integrand, extent_oracle_t *extent_oracle, double true_integral,
const gsl_rng* r, unsigned int dimension, double rtol,
gsl_rstat_workspace* stats);