6 #include <gsl/gsl_errno.h> 7 #include <gsl/gsl_integration.h> 8 #include <gsl/gsl_sf_expint.h> 9 #include <gsl/gsl_roots.h> 20 double f1, f2, f3, fc;
38 f1 = sin(ks)*(gsl_sf_Si(ks*(1.+c))-gsl_sf_Si(ks));
39 f2 = cos(ks)*(gsl_sf_Ci(ks*(1.+c))-gsl_sf_Ci(ks));
40 f3 = sin(c*ks)/(ks*(1.+
c));
41 fc = log(1.+c)-c/(1.+
c);
54 double gz, g0, nu, delta_c, a_form;
71 nu = delta_c/
ccl_sigmaM(cosmo, halomass, a, status);
72 return 9.*
pow(nu,-0.29)*
pow(gz/g0,1.15);
85 return A*
pow(halomass/Mpiv,B)*
pow(a,-C);
87 }
else if (odelta == 200.) {
93 return A*
pow(halomass/Mpiv,B)*
pow(a,-C);
112 ccl_raise_exception(*status,
"ccl_halomod.c: concentration-mass relation specified incorrectly");
121 double rho_matter,
c, rv;
131 rv =
r_delta(cosmo, m, a, odelta, status);
137 return m*
u_nfw_c(cosmo, rv, c, k, status)/rho_matter;
161 double halomass =
pow(10,log10mass);
170 return dn_dlogM*
pow(wk,2);
176 int one_halo_integral_status = 0, qagstatus;
177 double result = 0, eresult;
178 double log10mmin = log10(
HM_MMIN);
179 double log10mmax = log10(
HM_MMAX);
182 gsl_integration_workspace *
w = gsl_integration_workspace_alloc(1000);
188 ipar.
status = &one_halo_integral_status;
196 gsl_integration_workspace_free(w);
199 if (qagstatus != GSL_SUCCESS) {
221 double halomass =
pow(10,log10mass);
233 return b*dn_dlogM*wk;
239 int two_halo_integral_status = 0, qagstatus;
240 double result = 0, eresult;
241 double log10mmin = log10(
HM_MMIN);
242 double log10mmax = log10(
HM_MMAX);
245 gsl_integration_workspace *
w = gsl_integration_workspace_alloc(1000);
251 ipar.
status = &two_halo_integral_status;
259 gsl_integration_workspace_free(w);
262 if (qagstatus != GSL_SUCCESS) {
static double u_nfw_c(ccl_cosmology *cosmo, double rv, double c, double k, int *status)
double r_delta(ccl_cosmology *cosmo, double halomass, double a, double odelta, int *status)
#define CCL_ERROR_HALOWIN
void ccl_raise_gsl_warning(int gslstatus, const char *msg,...)
#define CCL_ERROR_HALOCONC
halo_concentration_t halo_concentration_method
double ccl_growth_factor(ccl_cosmology *cosmo, double a, int *status)
double ccl_massfunc(ccl_cosmology *cosmo, double smooth_mass, double a, double odelta, int *status)
static double two_halo_integral(ccl_cosmology *cosmo, double k, double a, int *status)
double ccl_sigmaM(ccl_cosmology *cosmo, double smooth_mass, double a, int *status)
double ccl_onehalo_matter_power(ccl_cosmology *cosmo, double k, double a, int *status)
#define CCL_ERROR_TWO_HALO_INT
void ccl_cosmology_set_status_message(ccl_cosmology *cosmo, const char *status_message,...)
double ccl_linear_matter_power(ccl_cosmology *cosmo, double k, double a, int *status)
#define CCL_ERROR_CONC_DV
static double window_function(ccl_cosmology *cosmo, double m, double k, double a, double odelta, ccl_win_label label, int *status)
double ccl_rho_x(ccl_cosmology *cosmo, double a, ccl_species_x_label label, int is_comoving, int *status)
double ccl_halo_concentration(ccl_cosmology *cosmo, double halomass, double a, double odelta, int *status)
double ccl_halomodel_matter_power(ccl_cosmology *cosmo, double k, double a, int *status)
double ccl_halo_bias(ccl_cosmology *cosmo, double smooth_mass, double a, double odelta, int *status)
float pow(float base, unsigned long int exp)
#define CCL_ERROR_ONE_HALO_INT
double ccl_twohalo_matter_power(ccl_cosmology *cosmo, double k, double a, int *status)
double Dv_BryanNorman(ccl_cosmology *cosmo, double a, int *status)
void ccl_raise_exception(int err, const char *msg,...)
static double one_halo_integral(ccl_cosmology *cosmo, double k, double a, int *status)
static double w[2][28][111]
static double one_halo_integrand(double log10mass, void *params)
static double two_halo_integrand(double log10mass, void *params)