MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
marley_gsl.hh
1// Unified GSL interface header for MARLEY.
2// When GSL is present on the system this header simply pulls in the real
3// GSL headers that MARLEY needs. When the built-in GSL fallback is in use
4// it provides the necessary declarations directly.
5
6#pragma once
7
8#ifdef MARLEY_FOUND_GSL
9
10// ---- System GSL: pull in only the headers actually used by MARLEY ----
11#include "gsl/gsl_errno.h"
12#include "gsl/gsl_sf_coulomb.h"
13#include "gsl/gsl_cdf.h"
14
15#else
16
17// ---- Built-in GSL fallback declarations ----
18
19#undef __BEGIN_DECLS
20#undef __END_DECLS
21#ifdef __cplusplus
22# define __BEGIN_DECLS extern "C" {
23# define __END_DECLS }
24#else
25# define __BEGIN_DECLS /* empty */
26# define __END_DECLS /* empty */
27#endif
28
29__BEGIN_DECLS
30
31enum {
32 GSL_SUCCESS = 0,
33 GSL_EOVRFLW = 16
34};
35
36typedef struct gsl_sf_result_struct {
37 double val;
38 double err;
39} gsl_sf_result;
40
41typedef void gsl_error_handler_t( const char* reason, const char* file,
42 int line, int gsl_errno );
43
44gsl_error_handler_t* gsl_set_error_handler( gsl_error_handler_t* new_handler );
45
46int gsl_sf_coulomb_wave_FG_e( const double eta, const double x,
47 const double lam_F, const int k_lam_G, gsl_sf_result* F, gsl_sf_result* Fp,
48 gsl_sf_result* G, gsl_sf_result* Gp, double* exp_F, double* exp_G );
49
50int gsl_sf_coulomb_wave_FG_array( double lam_min, int kmax, double eta,
51 double x, double* fc_array, double* gc_array, double* F_exponent,
52 double* G_exponent );
53
54double gsl_cdf_chisq_Q( const double x, const double nu );
55
56__END_DECLS
57
58#endif /* MARLEY_FOUND_GSL */