8 #define SIGMA_TOLERANCE 3e-5 9 #define INVSIGMA_TOLERANCE 1e-3 10 #define MASSFUNC_TOLERANCE 5e-5 28 double massfunc[3][13];
34 FILE * f = fopen(
"./tests/benchmark/model1_hmf.txt",
"r");
40 rtn = fgets(str, 1024, f);
43 for (
int i=0; i<13; i++) {
44 int count = fscanf(f,
"%le %le %le %le\n", &mass[i],
45 &massfunc[0][i], &massfunc[1][i], &massfunc[2][i]);
66 double Omega_v[1] = { 0.7 };
67 double w_0[1] = {-1.0 };
68 double w_a[1] = { 0.0 };
69 for (
int i=0; i<1; i++) {
70 data->Omega_v[i] = Omega_v[i];
71 data->w_0[i] = w_0[i];
73 data->Omega_k[i] = 1.0 - data->Omega_c - data->Omega_b - data->Omega_v[i];
86 data->
Neff, data->
mnu, data-> mnu_type, data->
w_0[model],
87 data->
w_a[model], data->
h,data->
A_s, data->
n_s,
88 -1, -1, -1, -1, NULL, NULL, status);
107 for (
int j=0; j<13; j++) {
108 double mass =
pow(10,logmass);
109 double sigma_j =
ccl_sigmaM(cosmo, mass, a, status);
110 double loginvsigma_j = log10(1./sigma_j);
111 double logmassfunc_j = log10(
ccl_massfunc(cosmo, mass, a, odelta, status)*mass/(rho_m*log(10.)));
114 if (fabs(absolute_tolerance)<1e-12) absolute_tolerance = 1e-12;
118 if (fabs(absolute_tolerance)<1e-12) absolute_tolerance = 1e-12;
122 if (fabs(absolute_tolerance)<1e-12) absolute_tolerance = 1e-12;
size_t count(InputIterator first, InputIterator last, T const &item)
double ccl_massfunc(ccl_cosmology *cosmo, double smooth_mass, double a, double odelta, int *status)
#define CTEST_SETUP(sname)
#define CTEST_DATA(sname)
double ccl_sigmaM(ccl_cosmology *cosmo, double smooth_mass, double a, int *status)
transfer_function_t transfer_function_method
#define MASSFUNC_TOLERANCE
ccl_cosmology * ccl_cosmology_create(ccl_parameters params, ccl_configuration config)
#define ASSERT_DBL_NEAR_TOL(exp, real, tol)
ccl_mnu_convention mnu_type
static void read_massfunc_test_file(double mass[13], double massfunc[3][13])
mass_function_t mass_function_method
const ccl_configuration default_config
float pow(float base, unsigned long int exp)
#define ASSERT_EQUAL(exp, real)
#define ASSERT_NOT_NULL(real)
#define INVSIGMA_TOLERANCE
ccl_parameters ccl_parameters_create(double Omega_c, double Omega_b, double Omega_k, double Neff, double *mnu, ccl_mnu_convention mnu_type, double w0, double wa, double h, double norm_pk, double n_s, double bcm_log10Mc, double bcm_etab, double bcm_ks, int nz_mgrowth, double *zarr_mgrowth, double *dfarr_mgrowth, int *status)
#define CTEST2(sname, tname)
static void compare_massfunc(int model, struct massfunc_data *data)