7 #define DISTANCES_TOLERANCE 1.0e-6 39 FILE * f = fopen(filename,
"r");
43 fscanf(f,
"%*[^\n]\n", NULL);
47 for(
int i_z=0; i_z<
N_Z; i_z++) {
48 for(
int i_model=0; i_model<N_MODEL+1; i_model++) {
49 int count = fscanf(f,
"%le", &val);
57 benchmark[i_z][i_model-1] = val;
76 double Omega_k[
N_MODEL] = { 0.0, 0.0, 0.0, 0.05, -0.05,
77 0.0, 0.0, 0.0, 0.05, -0.05 };
78 double w_0[
N_MODEL] = { -1.0, -0.9, -0.9, -0.9, -0.9,
79 -1.0, -0.9, -0.9, -0.9, -0.9 };
80 double w_a[
N_MODEL] = { 0.0, 0.0, 0.1, 0.1, 0.1,
81 0.0, 0.0, 0.1, 0.1, 0.1 };
94 double Neff[
N_MODEL] = {3.046, 3.046, 3.046, 3.046, 3.046,
95 3.013, 3.026, 3.040, 3.013, 3.026};
100 data->Omega_k[i] = Omega_k[i];
101 data->w_0[i] = w_0[i];
102 data->w_a[i] = w_a[i];
103 data->Neff[i] = Neff[i];
104 for(
int j=0; j<3; j++) {
105 data->mnu[i][j] = mnu[i][j];
110 read_benchmark_file(
"./tests/benchmark/chi_class_allz.txt", data->z_chi, data->chi_benchmark);
111 read_benchmark_file(
"./tests/benchmark/dm_class_allz.txt", data->z_dm, data->dm_benchmark);
126 data->
w_0[model], data->
w_a[model],
128 -1,-1,-1,-1,NULL,NULL, &status);
136 for(
int i=0; i<
N_Z; i++) {
138 double a = 1/(1.+data->
z_chi[i]);
143 if (fabs(absolute_tolerance)<1e-12) absolute_tolerance = 1e-12;
147 a = 1/(1.+data->
z_dm[i]);
152 if (fabs(absolute_tolerance)<1e-12) absolute_tolerance = 1e-12;
size_t count(InputIterator first, InputIterator last, T const &item)
#define CTEST_SETUP(sname)
#define CTEST_DATA(sname)
ccl_cosmology * ccl_cosmology_create(ccl_parameters params, ccl_configuration config)
double chi_benchmark[10][10]
void ccl_cosmology_free(ccl_cosmology *cosmo)
ccl_mnu_convention mnu_type
#define ASSERT_DBL_NEAR_TOL(exp, real, tol)
#define DISTANCES_TOLERANCE
const ccl_configuration default_config
static void compare_distances(int model, struct distances_class_data *data)
#define ASSERT_EQUAL(exp, real)
#define ASSERT_NOT_NULL(real)
double ccl_distance_modulus(ccl_cosmology *cosmo, double a, int *status)
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)
double ccl_comoving_radial_distance(ccl_cosmology *cosmo, double a, int *status)
#define CTEST2(sname, tname)
static void read_benchmark_file(const char *filename, double z[10], double benchmark[10][10])
double dm_benchmark[10][10]