This example shows how to convert redshifts into comoving distances
try {
if (system ("clear")) {}
int step = 10000;
double z_min = 0.1;
double z_max = 2.;
std::vector<double> redshift = cbl::linear_bin_vector<double>(step, z_min, z_max);
std::cout << "Computing comoving distances with a standard integration..." << std::endl;
time_t start, end;
double D_C;
time (&start);
for (auto &&zz : redshift)
D_C = cosmology.D_C(zz);
std::cout << "D_C = " << D_C << std::endl;
time (&end);
double T1 = difftime(end, start);
std::cout << "The computetional time is: " << T1 << " sec" << std::endl << std::endl;
std::cout << "Computing comoving distances with a faster method..." << std::endl;
time (&start);
for (auto &&zz : redshift)
D_C = cosmology.D_C_LCDM(zz);
std::cout << "D_C = " << D_C << std::endl;
time (&end);
double T2 = difftime(end, start);
std::cout << "The computational time is: " << T2 << " sec" << std::endl << std::endl;
}
return 0;
}
int main()
main function to create the logo of the CosmoBolognaLib
const char * what() const noexcept override
the error description
@ _Planck18_
Planck collaboration 2018, Paper VI: Table 2, TT,TE,EE+lowE+lensing.