Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
precision.hpp File Reference

single / double / long double definitions More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAKE_FFTW_NAME(FUNC_NAME)   fftw_ ## FUNC_NAME
 
#define FFTW_PLAN_TYPE   MAKE_FFTW_NAME(plan)
 
#define FFTW_DEST_PLAN   MAKE_FFTW_NAME(destroy_plan)
 
#define FFTW_COMPLEX_TYPE   MAKE_FFTW_NAME(complex)
 
#define FFTW_PLAN_R2C   MAKE_FFTW_NAME(plan_dft_r2c_3d)
 
#define FFTW_PLAN_C2R   MAKE_FFTW_NAME(plan_dft_c2r_3d)
 
#define FFTW_PLAN_OMP   MAKE_FFTW_NAME(plan_with_nthreads)
 
#define FFTW_PLAN_OMP_INIT   MAKE_FFTW_NAME(init_threads)
 
#define FFTW_PLAN_OMP_CLEAN   MAKE_FFTW_NAME(cleanup_threads)
 
#define FFTW_EXEC_R2C   MAKE_FFTW_NAME(execute_dft_r2c)
 
#define FFTW_EXEC_C2R   MAKE_FFTW_NAME(execute_dft_c2r)
 

Typedefs

typedef double double
 

Functions

float pow (float base, unsigned long int exp)
 
template<typename T >
pow2 (T base)
 

Variables

constexpr double PI = double(3.14159265358979323846)
 

Detailed Description

single / double / long double definitions

Author
Michal Vrastil
Date
2018-07-11

Definition in file precision.hpp.

Macro Definition Documentation

#define FFTW_COMPLEX_TYPE   MAKE_FFTW_NAME(complex)

Definition at line 28 of file precision.hpp.

Referenced by Mesh::complex().

#define FFTW_DEST_PLAN   MAKE_FFTW_NAME(destroy_plan)

Definition at line 27 of file precision.hpp.

Referenced by TEST_CASE(), and App_Var< T >::~App_Var().

#define FFTW_EXEC_C2R   MAKE_FFTW_NAME(execute_dft_c2r)

Definition at line 35 of file precision.hpp.

Referenced by fftw_execute_dft_c2r().

#define FFTW_EXEC_R2C   MAKE_FFTW_NAME(execute_dft_r2c)

Definition at line 34 of file precision.hpp.

Referenced by fftw_execute_dft_r2c().

#define FFTW_PLAN_OMP   MAKE_FFTW_NAME(plan_with_nthreads)

Definition at line 31 of file precision.hpp.

Referenced by App_Var< T >::Impl< T >::fftw_prep(), and TEST_CASE().

#define FFTW_PLAN_OMP_CLEAN   MAKE_FFTW_NAME(cleanup_threads)

Definition at line 33 of file precision.hpp.

Referenced by TEST_CASE(), and App_Var< T >::~App_Var().

#define FFTW_PLAN_OMP_INIT   MAKE_FFTW_NAME(init_threads)

Definition at line 32 of file precision.hpp.

Referenced by App_Var< T >::Impl< T >::fftw_prep(), and TEST_CASE().

#define FFTW_PLAN_TYPE   MAKE_FFTW_NAME(plan)
#define MAKE_FFTW_NAME (   FUNC_NAME)    fftw_ ## FUNC_NAME

Definition at line 20 of file precision.hpp.

Typedef Documentation

typedef double double

Definition at line 19 of file precision.hpp.

Function Documentation

float pow ( float  base,
unsigned long int  exp 
)
inline

Definition at line 39 of file precision.hpp.

Referenced by bbks_power(), ccl_bcm_model_fka(), ccl_cosmology_compute_sigma(), ccl_get_class_As(), ccl_halo_b1(), ccl_halo_concentration(), ccl_j_bessel(), ccl_massfunc_m2r(), ccl_nu_masses(), ccl_omega_x(), ccl_Omeganuh2(), ccl_parameters_fill_initial(), ccl_pkemu(), ccl_sigmaM(), ccl_tracer_corr_fftlog(), ccl_tracer_corr_legendre(), anonymous_namespace{chameleon.cpp}::ChiSolver< T >::chi_a(), anonymous_namespace{chameleon.cpp}::ChiSolver< T >::chi_min(), cl_integrand(), compare_bbks(), compare_eh(), compare_halomod(), compare_massfunc(), compare_power_nu(), compare_power_nu_nl(), compute_wt_single(), corr_bessel_integrand(), dc_NakamuraSuto(), anonymous_namespace{chameleon.cpp}::ChiSolver< T >::dl_operator(), dNdz_smail(), Dv_BryanNorman(), eh_power(), eh_struct_new(), emuInit(), fftlog_ComputeXiLM(), fftw_execute_dft_r2c(), anonymous_namespace{mod_frozen_potential.cpp}::force_ref(), anonymous_namespace{mod_frozen_potential.cpp}::force_short(), gen_dens_binned(), gen_pow_spec_binned(), gen_pow_spec_binned_from_extrap(), gen_pow_spec_binned_init(), gen_rho_w_pow_k(), anonymous_namespace{chameleon.cpp}::ChiSolver< T >::get_chi_k(), anonymous_namespace{test_chameleon.cpp}::get_grav_pot(), get_rho_from_par(), get_vel_from_par(), anonymous_namespace{core_power.cpp}::growth_factor_integrand(), h_over_h0(), anonymous_namespace{core_power.cpp}::hubble_param(), if(), Box_Opt::init(), App_Var_Chi::ChiImpl::kick_step_w_chi(), kick_step_w_momentum(), kick_step_w_momentum_pm(), anonymous_namespace{mod_frozen_potential.cpp}::kick_step_w_pp(), anonymous_namespace{chameleon.cpp}::ChiSolver< T >::l_operator(), lin_pow_spec(), main(), massfunc_f(), non_lin_pow_spec(), Omega_lambda(), one_halo_integrand(), Extrap_Pk< T, N >::operator()(), power(), pwr_spec_k(), r_delta(), S2_shape(), FofrSolver< NDIM, T >::set_parameters(), anonymous_namespace{chameleon.cpp}::ChiSolver< T >::set_time(), sigmaR_integrand(), sigmaV_integrand(), test_angpow_precision(), tkEH_0(), tkEH_b(), tkEH_c(), transfer_wrap(), tsqr_BBKS(), tsqr_EH(), two_halo_integrand(), user_dNdz(), user_pz_probability(), vel_pwr_spec_k(), and write_wt_single().

40 {
41  float result = 1.f;
42  while (exp)
43  {
44  if (exp & 1)
45  result *= base;
46  exp >>= 1;
47  base *= base;
48  }
49  return result;
50 }