From 192c5e51ca9fbe3cd2d71e702f8a1b3cf8499523 Mon Sep 17 00:00:00 2001 From: Sandro Dias Pinto Vitenti Date: Wed, 15 May 2024 18:06:24 -0300 Subject: [PATCH] Updating uncrustify configuration. (#157) * Updating uncrustify configuration. * Applying to all files in numcosmo/ numcosmo/math numcosmo/model numcosmo/xcor * Adding .clang-format for future reference. * Testing indentation on CI. * Removed uncrustify validation due to outdated uncrustify in conda-forge. * Testing another strategy to check indent on CI. * Updating package for arb. * Added break-system-packages to pip. --- .clang-format | 20 ++ .github/workflows/build_check.yml | 15 +- numcosmo/config_extra.h | 7 +- numcosmo/math/ncm_binsplit.h | 6 +- numcosmo/math/ncm_binsplit_eval.c | 122 +++---- numcosmo/math/ncm_bootstrap.h | 6 +- numcosmo/math/ncm_cfg.c | 6 +- numcosmo/math/ncm_cfg.h | 20 +- numcosmo/math/ncm_csq1d.c | 2 +- numcosmo/math/ncm_data_funnel.h | 1 + numcosmo/math/ncm_data_gauss_cov_mvnd.h | 1 + numcosmo/math/ncm_dtuple.h | 8 +- numcosmo/math/ncm_fit.c | 1 - numcosmo/math/ncm_flapack.h | 6 +- numcosmo/math/ncm_func_eval.h | 1 + numcosmo/math/ncm_gsl_blas_types.h | 36 +- numcosmo/math/ncm_integral_nd.h | 46 +-- numcosmo/math/ncm_integrate.c | 10 +- numcosmo/math/ncm_integrate.h | 1 + numcosmo/math/ncm_lapack.h | 3 +- numcosmo/math/ncm_model.h | 44 +-- numcosmo/math/ncm_model_funnel.h | 6 +- numcosmo/math/ncm_model_mvnd.h | 12 +- numcosmo/math/ncm_model_rosenbrock.h | 6 +- numcosmo/math/ncm_mpi_job_feval.h | 2 +- numcosmo/math/ncm_mpsf_0F1.h | 1 + numcosmo/math/ncm_mpsf_trig_int.h | 1 + numcosmo/math/ncm_mset.h | 20 +- numcosmo/math/ncm_mset_catalog.h | 6 +- numcosmo/math/ncm_nnls.h | 6 +- numcosmo/math/ncm_prior.h | 5 +- numcosmo/math/ncm_prior_gauss_func.h | 9 +- numcosmo/math/ncm_quaternion.h | 13 +- numcosmo/math/ncm_serialize.h | 4 +- numcosmo/math/ncm_sf_sbessel.h | 1 + numcosmo/math/ncm_sphere_map.h | 38 +-- numcosmo/math/ncm_sphere_map_block.c | 22 +- numcosmo/math/ncm_spline_func.c | 316 +++++++++--------- numcosmo/math/ncm_spline_func.h | 14 +- numcosmo/math/ncm_spline_rbf.h | 4 +- numcosmo/math/ncm_util.h | 163 ++++----- numcosmo/model/nc_hicosmo_de.c | 18 +- numcosmo/model/nc_hicosmo_de.h | 18 +- numcosmo/model/nc_hicosmo_de_jbp.h | 9 +- numcosmo/model/nc_hicosmo_de_reparam_cmb.h | 1 + numcosmo/model/nc_hicosmo_de_reparam_ok.h | 1 + numcosmo/model/nc_hicosmo_de_wspline.h | 1 + numcosmo/model/nc_hicosmo_de_xcdm.h | 11 +- numcosmo/model/nc_hicosmo_gcg.h | 9 +- numcosmo/model/nc_hicosmo_idem2.h | 7 +- numcosmo/model/nc_hicosmo_lcdm.h | 5 +- numcosmo/model/nc_hicosmo_qconst.h | 15 +- numcosmo/model/nc_hicosmo_qgrw.c | 118 +++---- numcosmo/model/nc_hicosmo_qgrw.h | 23 +- numcosmo/model/nc_hicosmo_qlinear.h | 13 +- numcosmo/model/nc_hicosmo_qrbf.h | 18 +- numcosmo/model/nc_hicosmo_qspline.h | 11 +- numcosmo/model/nc_hiprim_atan.h | 11 +- numcosmo/model/nc_hiprim_bpl.h | 13 +- numcosmo/model/nc_hiprim_expc.h | 13 +- numcosmo/model/nc_hiprim_power_law.h | 6 +- numcosmo/model/nc_hiprim_sbpl.h | 13 +- numcosmo/nc_cbe_precision.c | 112 +++---- numcosmo/nc_distance.c | 24 +- numcosmo/nc_distance.h | 9 +- numcosmo/nc_hicosmo.c | 24 +- numcosmo/nc_hicosmo_priors.c | 15 +- numcosmo/nc_hicosmo_priors.h | 7 +- numcosmo/nc_hiprim.c | 10 +- numcosmo/nc_hiprim.h | 2 +- numcosmo/nc_hiqg_1d.h | 16 +- numcosmo/nc_hireion.h | 6 +- numcosmo/nc_hireion_camb.h | 9 +- numcosmo/nc_hireion_camb_reparam_tau.h | 5 +- numcosmo/nc_planck_fi.h | 1 + numcosmo/nc_planck_fi_cor_tt.h | 3 +- numcosmo/nc_planck_fi_cor_ttteee.h | 177 +++++----- numcosmo/nc_powspec_ml_transfer.c | 44 +-- numcosmo/nc_recomb.h | 42 +-- numcosmo/nc_recomb_cbe.h | 4 +- numcosmo/nc_recomb_seager.h | 6 +- numcosmo/nc_scalefactor.h | 1 + numcosmo/ncm_build_inline.c | 1 + numcosmo/ncm_fit_nlopt_enum_meta.c | 1 - numcosmo/ncm_gir_scan.h | 7 +- numcosmo/xcor/nc_xcor_AB.h | 8 +- .../xcor/nc_xcor_limber_kernel_CMB_lensing.h | 6 +- numcosmo/xcor/nc_xcor_limber_kernel_gal.h | 12 +- .../xcor/nc_xcor_limber_kernel_weak_lensing.h | 14 +- numcosmo_uncrustify.cfg | 8 +- 90 files changed, 1013 insertions(+), 906 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..2aae96911 --- /dev/null +++ b/.clang-format @@ -0,0 +1,20 @@ +{ + BasedOnStyle: GNU, + UseTab: Never, + IndentWidth: 2, + TabWidth: 4, + BreakBeforeBraces: Allman, + AlignAfterOpenBracket: BlockIndent, + AllowShortIfStatementsOnASingleLine: false, + IndentCaseLabels: true, + ColumnLimit: 120, + AccessModifierOffset: -4, + NamespaceIndentation: All, + FixNamespaceComments: false, + AlignConsecutiveAssignments: true, + AlignConsecutiveMacros: true, + IndentPPDirectives: AfterHash, + SpaceAroundPointerQualifiers: Both, + SortIncludes: false, +} + diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 0fa3d8c6d..80bf2da0a 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -12,20 +12,26 @@ jobs: build-gcc-ubuntu: name: (ubuntu, apt) - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - name: Install pre-requisites run: | sudo apt-get update - sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libfyaml-dev libnlopt-dev libhdf5-dev gtk-doc-tools libopenmpi-dev - sudo pip install meson ninja pytest pytest-tap numpy + sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-dev libcfitsio-dev libfyaml-dev libnlopt-dev libhdf5-dev gtk-doc-tools libopenmpi-dev uncrustify + sudo pip install meson ninja pytest pytest-tap numpy --break-system-packages - name: Ensure clear Jupyter Notebooks uses: ResearchSoftwareActions/EnsureCleanNotebooksAction@1.1 - name: Configure NumCosmo run: meson setup build -Dbuildtype=release -Dnumcosmo_py=true -Dgtkdoc=disabled --prefix=/usr || (cat build/meson-logs/meson-log.txt && exit 1) - name: Building NumCosmo run: meson compile -C build + - name: Checking indentation + run: | + uncrustify -c numcosmo_uncrustify.cfg --check -q numcosmo/*.c numcosmo/*.h + uncrustify -c numcosmo_uncrustify.cfg --check -q numcosmo/math/*.c numcosmo/math/*.h + uncrustify -c numcosmo_uncrustify.cfg --check -q numcosmo/model/*.c numcosmo/model/*.h + uncrustify -c numcosmo_uncrustify.cfg --check -q numcosmo/xcor/*.c numcosmo/xcor/*.h - name: Test python examples run: | source build/numcosmo_export.sh @@ -163,6 +169,9 @@ jobs: - name: Running mypy run: | mypy -p numcosmo_py + #- name: Checking indentation + # run: | + # uncrustify -c numcosmo_uncrustify.cfg --check -q numcosmo/*.c numcosmo/*.h #- name: Running pylint # run: | # pylint --rcfile .pylintrc numcosmo_py diff --git a/numcosmo/config_extra.h b/numcosmo/config_extra.h index ff4d938b5..6f98c986d 100644 --- a/numcosmo/config_extra.h +++ b/numcosmo/config_extra.h @@ -36,18 +36,21 @@ #ifndef HAVE_SINCOS #include -static inline void +static inline void sincos (double x, double *s, double *c) { s[0] = sin (x); c[0] = cos (x); } + #endif /* HAVE_SINCOS */ #if HAVE_DECL_LGAMMA_R == 0 -double lgamma_r(double x, int *signp); +double lgamma_r (double x, int *signp); + #endif /* HAVE_DECL_LGAMMA_R == 0 */ #endif /* NUMCOSMO_GIR_SCAN */ #endif /* _CONFIG_EXTRA_H_ */ + diff --git a/numcosmo/math/ncm_binsplit.h b/numcosmo/math/ncm_binsplit.h index 0d7f351cf..26b3a5499 100644 --- a/numcosmo/math/ncm_binsplit.h +++ b/numcosmo/math/ncm_binsplit.h @@ -40,7 +40,7 @@ typedef struct _NcmBinSplit NcmBinSplit; /** * NcmBinSplit: - * + * * FIXME */ struct _NcmBinSplit @@ -73,8 +73,8 @@ void ncm_binsplit_get (NcmBinSplit *bs, mpfr_t res); void ncm_binsplit_get_q (NcmBinSplit *bs, mpq_t q); gdouble ncm_binsplit_get_d (NcmBinSplit *bs, mp_rnd_t rnd); -#define NCM_BINSPLIT_DECL(name,v,u,n,data) static inline void name (mpz_t v, mpz_t u, gulong n, gpointer data) -#define NCM_BINSPLIT_DENC_NULL(a,b,c,d) +#define NCM_BINSPLIT_DECL(name, v, u, n, data) static inline void name (mpz_t v, mpz_t u, gulong n, gpointer data) +#define NCM_BINSPLIT_DENC_NULL(a, b, c, d) G_END_DECLS diff --git a/numcosmo/math/ncm_binsplit_eval.c b/numcosmo/math/ncm_binsplit_eval.c index 4e1ed4cb9..1a2193807 100644 --- a/numcosmo/math/ncm_binsplit_eval.c +++ b/numcosmo/math/ncm_binsplit_eval.c @@ -1,9 +1,8 @@ - #ifndef NC_BINSPLIT_EVAL_NAME #error "To include binsplit_eval.c you must define NC_BINSPLIT_EVAL_NAME" #endif -#if !defined(_BINSPLIT_FUNC_P) || !defined(_BINSPLIT_FUNC_Q) +#if !defined (_BINSPLIT_FUNC_P) || !defined (_BINSPLIT_FUNC_Q) #error "To include binsplit_eval.c you must define at least the macros _BINSPLIT_FUNC_(P|Q)" #endif @@ -11,9 +10,11 @@ void NC_BINSPLIT_EVAL_NAME (NcmBinSplit *bs, gulong n1, gulong n2) { gulong nd = n2 - n1; + bs->n1 = n1; bs->n2 = n2; - //printf ("# nd [%lu %lu) %lu %d\n", n1, n2, nd, nd < 5); + + /*printf ("# nd [%lu %lu) %lu %d\n", n1, n2, nd, nd < 5); */ if (nd < 5) { _BINSPLIT_FUNC_P (bs->P, NCM_BINSPLIT_ONE, n1, bs->userdata); @@ -27,94 +28,94 @@ NC_BINSPLIT_EVAL_NAME (NcmBinSplit *bs, gulong n1, gulong n2) _BINSPLIT_FUNC_A (bs->T, bs->T, n1, bs->userdata); break; case 2: - _BINSPLIT_FUNC_P (bs->P, bs->P, n1+1L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1+1L, bs->userdata); - _BINSPLIT_FUNC_B (bs->B, bs->B, n1+1L, bs->userdata); + _BINSPLIT_FUNC_P (bs->P, bs->P, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->B, bs->B, n1 + 1L, bs->userdata); _BINSPLIT_FUNC_P (bs->temp1, NCM_BINSPLIT_ONE, n1, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1+1L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1 + 1L, bs->userdata); _BINSPLIT_FUNC_A (bs->temp1, bs->temp1, n1, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1+1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1 + 1L, bs->userdata); mpz_set (bs->temp2, bs->P); - _BINSPLIT_FUNC_A (bs->temp2, bs->temp2, n1+1L, bs->userdata); + _BINSPLIT_FUNC_A (bs->temp2, bs->temp2, n1 + 1L, bs->userdata); _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1, bs->userdata); mpz_add (bs->T, bs->temp1, bs->temp2); break; case 3: - _BINSPLIT_FUNC_P (bs->P, bs->P, n1+1L, bs->userdata); - _BINSPLIT_FUNC_P (bs->P, bs->P, n1+2L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1+1L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1+2L, bs->userdata); - _BINSPLIT_FUNC_B (bs->B, bs->B, n1+1L, bs->userdata); - _BINSPLIT_FUNC_B (bs->B, bs->B, n1+2L, bs->userdata); + _BINSPLIT_FUNC_P (bs->P, bs->P, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_P (bs->P, bs->P, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_B (bs->B, bs->B, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->B, bs->B, n1 + 2L, bs->userdata); _BINSPLIT_FUNC_P (bs->temp1, NCM_BINSPLIT_ONE, n1, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1+1L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1+2L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1 + 2L, bs->userdata); _BINSPLIT_FUNC_A (bs->temp1, bs->temp1, n1, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1+1L, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1+2L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1 + 2L, bs->userdata); _BINSPLIT_FUNC_P (bs->temp2, NCM_BINSPLIT_ONE, n1, bs->userdata); - _BINSPLIT_FUNC_P (bs->temp2, bs->temp2, n1+1L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp2, bs->temp2, n1+2L, bs->userdata); - _BINSPLIT_FUNC_A (bs->temp2, bs->temp2, n1+1L, bs->userdata); + _BINSPLIT_FUNC_P (bs->temp2, bs->temp2, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp2, bs->temp2, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_A (bs->temp2, bs->temp2, n1 + 1L, bs->userdata); _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1+2L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1 + 2L, bs->userdata); mpz_set (bs->temp3, bs->P); - _BINSPLIT_FUNC_A (bs->temp3, bs->temp3, n1+2L, bs->userdata); + _BINSPLIT_FUNC_A (bs->temp3, bs->temp3, n1 + 2L, bs->userdata); _BINSPLIT_FUNC_B (bs->temp3, bs->temp3, n1, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp3, bs->temp3, n1+1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp3, bs->temp3, n1 + 1L, bs->userdata); mpz_add (bs->T, bs->temp1, bs->temp2); mpz_add (bs->T, bs->T, bs->temp3); break; case 4: - _BINSPLIT_FUNC_P (bs->P, bs->P, n1+1L, bs->userdata); - _BINSPLIT_FUNC_P (bs->P, bs->P, n1+2L, bs->userdata); - _BINSPLIT_FUNC_P (bs->P, bs->P, n1+3L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1+1L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1+2L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1+3L, bs->userdata); - _BINSPLIT_FUNC_B (bs->B, bs->B, n1+1L, bs->userdata); - _BINSPLIT_FUNC_B (bs->B, bs->B, n1+2L, bs->userdata); - _BINSPLIT_FUNC_B (bs->B, bs->B, n1+3L, bs->userdata); + _BINSPLIT_FUNC_P (bs->P, bs->P, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_P (bs->P, bs->P, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_P (bs->P, bs->P, n1 + 3L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->Q, bs->Q, n1 + 3L, bs->userdata); + _BINSPLIT_FUNC_B (bs->B, bs->B, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->B, bs->B, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_B (bs->B, bs->B, n1 + 3L, bs->userdata); _BINSPLIT_FUNC_P (bs->temp1, NCM_BINSPLIT_ONE, n1, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1+1L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1+2L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1+3L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp1, bs->temp1, n1 + 3L, bs->userdata); _BINSPLIT_FUNC_A (bs->temp1, bs->temp1, n1, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1+1L, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1+2L, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1+3L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp1, bs->temp1, n1 + 3L, bs->userdata); _BINSPLIT_FUNC_P (bs->temp2, NCM_BINSPLIT_ONE, n1, bs->userdata); - _BINSPLIT_FUNC_P (bs->temp2, bs->temp2, n1+1L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp2, bs->temp2, n1+2L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp2, bs->temp2, n1+3L, bs->userdata); - _BINSPLIT_FUNC_A (bs->temp2, bs->temp2, n1+1L, bs->userdata); + _BINSPLIT_FUNC_P (bs->temp2, bs->temp2, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp2, bs->temp2, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp2, bs->temp2, n1 + 3L, bs->userdata); + _BINSPLIT_FUNC_A (bs->temp2, bs->temp2, n1 + 1L, bs->userdata); _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1+2L, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1+3L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp2, bs->temp2, n1 + 3L, bs->userdata); _BINSPLIT_FUNC_P (bs->temp3, NCM_BINSPLIT_ONE, n1, bs->userdata); - _BINSPLIT_FUNC_P (bs->temp3, bs->temp3, n1+1L, bs->userdata); - _BINSPLIT_FUNC_P (bs->temp3, bs->temp3, n1+2L, bs->userdata); - _BINSPLIT_FUNC_Q (bs->temp3, bs->temp3, n1+3L, bs->userdata); - _BINSPLIT_FUNC_A (bs->temp3, bs->temp3, n1+2L, bs->userdata); + _BINSPLIT_FUNC_P (bs->temp3, bs->temp3, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_P (bs->temp3, bs->temp3, n1 + 2L, bs->userdata); + _BINSPLIT_FUNC_Q (bs->temp3, bs->temp3, n1 + 3L, bs->userdata); + _BINSPLIT_FUNC_A (bs->temp3, bs->temp3, n1 + 2L, bs->userdata); _BINSPLIT_FUNC_B (bs->temp3, bs->temp3, n1, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp3, bs->temp3, n1+1L, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp3, bs->temp3, n1+3L, bs->userdata); - + _BINSPLIT_FUNC_B (bs->temp3, bs->temp3, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp3, bs->temp3, n1 + 3L, bs->userdata); + mpz_set (bs->temp4, bs->P); - _BINSPLIT_FUNC_A (bs->temp4, bs->temp4, n1+3L, bs->userdata); + _BINSPLIT_FUNC_A (bs->temp4, bs->temp4, n1 + 3L, bs->userdata); _BINSPLIT_FUNC_B (bs->temp4, bs->temp4, n1, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp4, bs->temp4, n1+1L, bs->userdata); - _BINSPLIT_FUNC_B (bs->temp4, bs->temp4, n1+2L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp4, bs->temp4, n1 + 1L, bs->userdata); + _BINSPLIT_FUNC_B (bs->temp4, bs->temp4, n1 + 2L, bs->userdata); mpz_add (bs->T, bs->temp1, bs->temp2); mpz_add (bs->T, bs->T, bs->temp3); @@ -131,6 +132,7 @@ NC_BINSPLIT_EVAL_NAME (NcmBinSplit *bs, gulong n1, gulong n2) if (bs->bs[0] == NULL) bs->bs[0] = ncm_binsplit_alloc (bs->userdata); + if (bs->bs[1] == NULL) bs->bs[1] = ncm_binsplit_alloc (bs->userdata); @@ -146,13 +148,14 @@ NC_BINSPLIT_EVAL_NAME (NcmBinSplit *bs, gulong n1, gulong n2) mpz_mul (bs->temp2, bs->bs[0]->T, bs->bs[1]->Q); #ifdef _HAS_FUNC_B - mpz_mul (bs->temp1, bs->temp1, bs->bs[0]->B); + mpz_mul (bs->temp1, bs->temp1, bs->bs[0]->B); mpz_mul (bs->temp2, bs->temp2, bs->bs[1]->B); #endif - + mpz_add (bs->T, bs->temp1, bs->temp2); } -// mpfr_printf ("# NUC %.15g %Zd/(%Zd %Zd)\n", ncm_binsplit_get_d (bs, GMP_RNDD), bs->T, bs->Q, bs->B); + +/* mpfr_printf ("# NUC %.15g %Zd/(%Zd %Zd)\n", ncm_binsplit_get_d (bs, GMP_RNDD), bs->T, bs->Q, bs->B); */ } #undef NC_BINSPLIT_EVAL_NAME @@ -161,3 +164,4 @@ NC_BINSPLIT_EVAL_NAME (NcmBinSplit *bs, gulong n1, gulong n2) #undef _BINSPLIT_FUNC_A #undef _BINSPLIT_FUNC_B #undef _HAS_FUNC_B + diff --git a/numcosmo/math/ncm_bootstrap.h b/numcosmo/math/ncm_bootstrap.h index c2a470313..61d89aaef 100644 --- a/numcosmo/math/ncm_bootstrap.h +++ b/numcosmo/math/ncm_bootstrap.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * ncm_bootstrap.h * @@ -14,12 +15,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -65,3 +66,4 @@ gboolean ncm_bootstrap_is_init (NcmBootstrap *bstrap); G_END_DECLS #endif /* _NCM_BOOTSTRAP_H_ */ + diff --git a/numcosmo/math/ncm_cfg.c b/numcosmo/math/ncm_cfg.c index c2e813b81..ad5a1266a 100644 --- a/numcosmo/math/ncm_cfg.c +++ b/numcosmo/math/ncm_cfg.c @@ -246,14 +246,14 @@ static gboolean _enable_msg = TRUE; static gboolean _enable_msg_flush = TRUE; static gsl_error_handler_t *gsl_err = NULL; -# if (defined (__GNUC__) \ +# if (defined (__GNUC__) \ && ((__GNUC__ == 11 && __GNUC_MINOR__ >= 1) || (__GNUC__ >= 12))) \ || (defined (__clang__) && (__clang_major__ >= 12)) extern void __gcov_dump (void); extern void __gcov_reset (void); -# define __gcov_flush() \ - do { \ +# define __gcov_flush() \ + do { \ __gcov_dump (); __gcov_reset (); \ } while (0) # else diff --git a/numcosmo/math/ncm_cfg.h b/numcosmo/math/ncm_cfg.h index 025a4e302..38beadfc8 100644 --- a/numcosmo/math/ncm_cfg.h +++ b/numcosmo/math/ncm_cfg.h @@ -106,9 +106,9 @@ extern guint fftw_default_flags; #define NCM_CFG_DATA_DIR_ENV "NUMCOSMO_DATA_DIR" #ifdef NUMCOSMO_CHECK_PREPARE -#define NCM_CHECK_PREPARED(obj, name) \ - G_STMT_START { \ - if (!obj->prepared) \ +#define NCM_CHECK_PREPARED(obj, name) \ + G_STMT_START { \ + if (!obj->prepared) \ g_error ("calling method %s on an unprepared instance.", #name); \ } G_STMT_END #else /* NUMCOSMO_CHECK_PREPARE */ @@ -131,14 +131,14 @@ extern guint fftw_default_flags; #endif /* mpz_inits */ #ifndef NUMCOSMO_GIR_SCAN -#define NCM_FITS_ERROR(status) \ - G_STMT_START { \ - if (status) \ - { \ - gchar errormsg[30]; \ +#define NCM_FITS_ERROR(status) \ + G_STMT_START { \ + if (status) \ + { \ + gchar errormsg[30]; \ fits_get_errstatus (status, errormsg); \ - g_error ("FITS: %s", errormsg); \ - } \ + g_error ("FITS: %s", errormsg); \ + } \ } G_STMT_END #endif /* NUMCOSMO_GIR_SCAN */ diff --git a/numcosmo/math/ncm_csq1d.c b/numcosmo/math/ncm_csq1d.c index 78603b610..45622db5f 100644 --- a/numcosmo/math/ncm_csq1d.c +++ b/numcosmo/math/ncm_csq1d.c @@ -88,7 +88,7 @@ typedef enum _NcmCSQ1DEvolStop { - NCM_CSQ1D_EVOL_STOP_ERROR = -1, + NCM_CSQ1D_EVOL_STOP_ERROR = -1, NCM_CSQ1D_EVOL_STOP_FINISHED = 0, NCM_CSQ1D_EVOL_STOP_ADIABATIC_START, NCM_CSQ1D_EVOL_STOP_UP_START, diff --git a/numcosmo/math/ncm_data_funnel.h b/numcosmo/math/ncm_data_funnel.h index 788c68ab1..cdef4618c 100644 --- a/numcosmo/math/ncm_data_funnel.h +++ b/numcosmo/math/ncm_data_funnel.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * ncm_data_funnel.h * diff --git a/numcosmo/math/ncm_data_gauss_cov_mvnd.h b/numcosmo/math/ncm_data_gauss_cov_mvnd.h index b7cb0bca4..03a00c312 100644 --- a/numcosmo/math/ncm_data_gauss_cov_mvnd.h +++ b/numcosmo/math/ncm_data_gauss_cov_mvnd.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * ncm_data_gauss_cov_mvnd.h * diff --git a/numcosmo/math/ncm_dtuple.h b/numcosmo/math/ncm_dtuple.h index 8b3748d66..f2b90cbc5 100644 --- a/numcosmo/math/ncm_dtuple.h +++ b/numcosmo/math/ncm_dtuple.h @@ -97,8 +97,8 @@ void ncm_dtuple3_clear (NcmDTuple3 **dt3); * */ #define NCM_DTUPLE2_STATIC_INIT(x, y) \ - { \ - { x, y } \ + { \ + { x, y } \ } @@ -117,8 +117,8 @@ void ncm_dtuple3_clear (NcmDTuple3 **dt3); * */ #define NCM_DTUPLE3_STATIC_INIT(x, y, z) \ - { \ - { x, y, z } \ + { \ + { x, y, z } \ } /** diff --git a/numcosmo/math/ncm_fit.c b/numcosmo/math/ncm_fit.c index 2dc7c3885..513e25299 100644 --- a/numcosmo/math/ncm_fit.c +++ b/numcosmo/math/ncm_fit.c @@ -2592,7 +2592,6 @@ ncm_fit_fisher (NcmFit *fit) _ncm_fit_fisher_to_covar (fit, IM, FALSE); ncm_matrix_clear (&IM); - } /** diff --git a/numcosmo/math/ncm_flapack.h b/numcosmo/math/ncm_flapack.h index 0e554a45a..92a1c2103 100644 --- a/numcosmo/math/ncm_flapack.h +++ b/numcosmo/math/ncm_flapack.h @@ -1,4 +1,3 @@ - #ifndef NUMCOSMO_GIR_SCAN extern double dasum_ (int *, double *, int *); @@ -22,8 +21,8 @@ extern void dsytrf_ (const gchar *uplo, gint *n, gdouble *a, gint *lda, gint *ip extern void dsytrs_ (const gchar *uplo, const gint *n, const gint *nrhs, gdouble *a, const gint *lda, const gint *ipiv, gdouble *b, const gint *ldb, gint *info); extern void dsytri_ (const gchar *uplo, const gint *n, gdouble *a, const gint *lda, const gint *ipiv, gdouble *work, gint *info); extern void dsysv_ (const gchar *uplo, const gint *n, const gint *nrhs, gdouble *a, const gint *lda, gint *ipiv, gdouble *b, const gint *ldb, gdouble *work, gint *lwork, gint *info); -extern void dsysvx_ (const gchar *fact, gchar *uplo, const gint* n, const gint *nrhs, gdouble *a, const gint *lda, gdouble *af, const gint *ldaf, gint *ipiv, gdouble *b, const gint *ldb, gdouble *x, const gint *ldx, gdouble *rcond, gdouble *ferr, gdouble *berr, gdouble *work, gint *lwork, gint *iwork, gint *info); -extern void dsysvxx_ (const gchar *fact, gchar *uplo, const gint* n, const gint *nrhs, gdouble *a, const gint *lda, gdouble *af, const gint *ldaf, gint *ipiv, gchar *equed, gdouble *s, gdouble *b, const gint *ldb, gdouble *x, const gint *ldx, gdouble *rcond, gdouble *rpvgrw, gdouble *berr, const gint *n_err_bnds, gdouble *err_bnds_norm, gdouble *err_bnds_comp, const gint *nparams, gdouble *params, gdouble *work, gint *iwork, gint *info); +extern void dsysvx_ (const gchar *fact, gchar *uplo, const gint *n, const gint *nrhs, gdouble *a, const gint *lda, gdouble *af, const gint *ldaf, gint *ipiv, gdouble *b, const gint *ldb, gdouble *x, const gint *ldx, gdouble *rcond, gdouble *ferr, gdouble *berr, gdouble *work, gint *lwork, gint *iwork, gint *info); +extern void dsysvxx_ (const gchar *fact, gchar *uplo, const gint *n, const gint *nrhs, gdouble *a, const gint *lda, gdouble *af, const gint *ldaf, gint *ipiv, gchar *equed, gdouble *s, gdouble *b, const gint *ldb, gdouble *x, const gint *ldx, gdouble *rcond, gdouble *rpvgrw, gdouble *berr, const gint *n_err_bnds, gdouble *err_bnds_norm, gdouble *err_bnds_comp, const gint *nparams, gdouble *params, gdouble *work, gint *iwork, gint *info); extern void dsyevr_ (const gchar *jobz, const gchar *range, const gchar *uplo, const gint *n, gdouble *a, const gint *lda, const gdouble *vl, const gdouble *vu, const gint *il, const gint *iu, const gdouble *abstol, gint *m, gdouble *w, double *z, const gint *ldz, gint *isuppz, gdouble *work, const gint *lwork, gint *iwork, const gint *liwork, gint *info); extern void dsyevd_ (const gchar *jobz, const gchar *uplo, const gint *n, gdouble *a, const gint *lda, gdouble *w, gdouble *work, const gint *lwork, gint *iwork, const gint *liwork, gint *info); @@ -43,3 +42,4 @@ extern void dgelsd_ (const gint *m, const gint *n, const gint *nrhs, gdouble *a, #endif /* NUMCOSMO_GIR_SCAN */ + diff --git a/numcosmo/math/ncm_func_eval.h b/numcosmo/math/ncm_func_eval.h index 99381efd8..72d0c61a8 100644 --- a/numcosmo/math/ncm_func_eval.h +++ b/numcosmo/math/ncm_func_eval.h @@ -42,3 +42,4 @@ void ncm_func_eval_log_pool_stats (void); G_END_DECLS #endif /* _NCM_FUNC_EVAL_H */ + diff --git a/numcosmo/math/ncm_gsl_blas_types.h b/numcosmo/math/ncm_gsl_blas_types.h index ea87f1a83..e6aab6d25 100644 --- a/numcosmo/math/ncm_gsl_blas_types.h +++ b/numcosmo/math/ncm_gsl_blas_types.h @@ -1,17 +1,17 @@ /* blas/gsl_blas_types.h - * + * * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or (at * your option) any later version. - * + * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -19,7 +19,7 @@ /* * Author: G. Jungman - * + * * Modified by Sandro Vitenti to make compatible with * other blas headers. */ @@ -34,10 +34,11 @@ #undef __END_DECLS #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { -# define __END_DECLS } +# define __END_DECLS \ + } #else # define __BEGIN_DECLS /* empty */ -# define __END_DECLS /* empty */ +# define __END_DECLS /* empty */ #endif __BEGIN_DECLS @@ -45,22 +46,23 @@ __BEGIN_DECLS #if defined (CBLAS_H) || defined (__GSL_CBLAS_H__) || defined (__GSL_CBLAS_H__) #ifdef NCM_BLAS_NOT_TYPEDEFED -typedef enum CBLAS_ORDER CBLAS_ORDER; +typedef enum CBLAS_ORDER CBLAS_ORDER; typedef enum CBLAS_TRANSPOSE CBLAS_TRANSPOSE; -typedef enum CBLAS_UPLO CBLAS_UPLO; -typedef enum CBLAS_DIAG CBLAS_DIAG; -typedef enum CBLAS_SIDE CBLAS_SIDE; +typedef enum CBLAS_UPLO CBLAS_UPLO; +typedef enum CBLAS_DIAG CBLAS_DIAG; +typedef enum CBLAS_SIDE CBLAS_SIDE; #endif /* NCM_BLAS_NOT_TYPEDEFED */ -typedef CBLAS_INDEX CBLAS_INDEX_t; -typedef CBLAS_ORDER CBLAS_ORDER_t; -typedef CBLAS_TRANSPOSE CBLAS_TRANSPOSE_t; -typedef CBLAS_UPLO CBLAS_UPLO_t; -typedef CBLAS_DIAG CBLAS_DIAG_t; -typedef CBLAS_SIDE CBLAS_SIDE_t; +typedef CBLAS_INDEX CBLAS_INDEX_t; +typedef CBLAS_ORDER CBLAS_ORDER_t; +typedef CBLAS_TRANSPOSE CBLAS_TRANSPOSE_t; +typedef CBLAS_UPLO CBLAS_UPLO_t; +typedef CBLAS_DIAG CBLAS_DIAG_t; +typedef CBLAS_SIDE CBLAS_SIDE_t; #endif __END_DECLS #endif /* __GSL_BLAS_TYPES_H__ */ + diff --git a/numcosmo/math/ncm_integral_nd.h b/numcosmo/math/ncm_integral_nd.h index b4fc9e56d..ea2d2d0ff 100644 --- a/numcosmo/math/ncm_integral_nd.h +++ b/numcosmo/math/ncm_integral_nd.h @@ -166,28 +166,28 @@ void ncm_integral_nd_eval (NcmIntegralND *intnd, const NcmVector *xi, const NcmV * A convenience macro to define a subclass of #NcmIntegralND with a custom user data type and a custom method to free the user data. */ #define NCM_INTEGRAL_ND_DEFINE_TYPE_WITH_FREE(MODULE, OBJ_NAME, ModuleObjName, module_obj_name, method_get_dimensions, method_integrand, user_data, user_data_free) \ - G_DECLARE_FINAL_TYPE (ModuleObjName, module_obj_name, MODULE, OBJ_NAME, NcmIntegralND) \ - struct _ ## ModuleObjName { NcmIntegralND parent_instance; user_data data; }; \ - G_DEFINE_TYPE (ModuleObjName, module_obj_name, NCM_TYPE_INTEGRAL_ND) \ - static void \ - module_obj_name ## _init (ModuleObjName * intnd) \ - { \ - } \ - static void \ - module_obj_name ## _finalize (GObject * object) \ - { \ - ModuleObjName *intnd = MODULE ## _ ## OBJ_NAME (object); \ - user_data_free (&intnd->data); \ - G_OBJECT_CLASS (module_obj_name ## _parent_class)->finalize (object); \ - } \ - static void module_obj_name ## _class_init (ModuleObjName ## Class * klass) \ - { \ - NcmIntegralNDClass *intnd_class = NCM_INTEGRAL_ND_CLASS (klass); \ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); \ - gobject_class->finalize = &module_obj_name ## _finalize; \ - intnd_class->get_dimensions = &method_get_dimensions; \ - intnd_class->integrand = &method_integrand; \ - } \ + G_DECLARE_FINAL_TYPE (ModuleObjName, module_obj_name, MODULE, OBJ_NAME, NcmIntegralND) \ + struct _ ## ModuleObjName { NcmIntegralND parent_instance; user_data data; }; \ + G_DEFINE_TYPE (ModuleObjName, module_obj_name, NCM_TYPE_INTEGRAL_ND) \ + static void \ + module_obj_name ## _init (ModuleObjName * intnd) \ + { \ + } \ + static void \ + module_obj_name ## _finalize (GObject * object) \ + { \ + ModuleObjName *intnd = MODULE ## _ ## OBJ_NAME (object); \ + user_data_free (&intnd->data); \ + G_OBJECT_CLASS (module_obj_name ## _parent_class)->finalize (object); \ + } \ + static void module_obj_name ## _class_init (ModuleObjName ## Class * klass) \ + { \ + NcmIntegralNDClass *intnd_class = NCM_INTEGRAL_ND_CLASS (klass); \ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); \ + gobject_class->finalize = &module_obj_name ## _finalize; \ + intnd_class->get_dimensions = &method_get_dimensions; \ + intnd_class->integrand = &method_integrand; \ + } \ /** @@ -202,7 +202,7 @@ void ncm_integral_nd_eval (NcmIntegralND *intnd, const NcmVector *xi, const NcmV * * A convenience macro to define a subclass of #NcmIntegralND with a custom user data type. */ -#define NCM_INTEGRAL_ND_DEFINE_TYPE(MODULE, OBJ_NAME, ModuleObjName, module_obj_name, method_get_dimensions, method_integrand, user_data) \ +#define NCM_INTEGRAL_ND_DEFINE_TYPE(MODULE, OBJ_NAME, ModuleObjName, module_obj_name, method_get_dimensions, method_integrand, user_data) \ NCM_INTEGRAL_ND_DEFINE_TYPE_WITH_FREE (MODULE, OBJ_NAME, ModuleObjName, module_obj_name, method_get_dimensions, method_integrand, user_data, (void)) \ G_END_DECLS diff --git a/numcosmo/math/ncm_integrate.c b/numcosmo/math/ncm_integrate.c index 422577930..65a231c75 100644 --- a/numcosmo/math/ncm_integrate.c +++ b/numcosmo/math/ncm_integrate.c @@ -491,7 +491,7 @@ ncm_integrate_2dim_divonne (NcmIntegrand2dim *integ, gdouble xi, gdouble yi, gdo return FALSE; -#endif //HAVE_LIBCUBA_4_0 +#endif /*HAVE_LIBCUBA_4_0 */ } /** @@ -555,7 +555,7 @@ ncm_integrate_2dim_divonne_peakfinder (NcmIntegrand2dim *integ, gdouble xi, gdou result, error, &prob); #else g_error ("ncm_integrate_2dim_divonne: Needs libcuba > 4.0."); -#endif //HAVE_LIBCUBA_4_0 +#endif /*HAVE_LIBCUBA_4_0 */ if (neval >= maxeval) g_warning ("ncm_integrate_2dim_divonne_peakfinder: number of evaluations %d >= maximum number of evaluations %d.\n", neval, maxeval); @@ -608,7 +608,7 @@ ncm_integrate_2dim_vegas (NcmIntegrand2dim *integ, gdouble xi, gdouble yi, gdoub nstart, nincrease, nbatch, gridno, NULL, NULL, &neval, &fail, result, error, &prob); #else g_error ("ncm_integrate_2dim_vegas: Needs libcuba > 4.0."); -#endif //HAVE_LIBCUBA_4_0 +#endif /*HAVE_LIBCUBA_4_0 */ if (neval >= maxeval) g_warning ("ncm_integrate_2dim_vegas: number of evaluations %d >= maximum number of evaluations %d.\n", neval, maxeval); @@ -680,7 +680,7 @@ ncm_integrate_3dim_divonne (NcmIntegrand3dim *integ, gdouble xi, gdouble yi, gdo result, error, &prob); #else g_error ("ncm_integrate_3dim_divonne: Needs libcuba > 4.0."); -#endif //HAVE_LIBCUBA_4_0 +#endif /*HAVE_LIBCUBA_4_0 */ if (neval >= maxeval) g_warning ("ncm_integrate_3dim_divonne: number of evaluations %d >= maximum number of evaluations %d.\n", neval, maxeval); @@ -735,7 +735,7 @@ ncm_integrate_3dim_vegas (NcmIntegrand3dim *integ, gdouble xi, gdouble yi, gdoub nstart, nincrease, nbatch, gridno, NULL, NULL, &neval, &fail, result, error, &prob); #else g_error ("ncm_integrate_3dim_vegas: Needs libcuba > 4.0."); -#endif //HAVE_LIBCUBA_4_0 +#endif /*HAVE_LIBCUBA_4_0 */ if (neval >= maxeval) g_warning ("ncm_integrate_3dim_vegas: number of evaluations %d >= maximum number of evaluations %d.\n", neval, maxeval); diff --git a/numcosmo/math/ncm_integrate.h b/numcosmo/math/ncm_integrate.h index db40c1d4e..5ffa993b2 100644 --- a/numcosmo/math/ncm_integrate.h +++ b/numcosmo/math/ncm_integrate.h @@ -120,3 +120,4 @@ gdouble ncm_integral_fixed_integ_posdef_mult (NcmIntegralFixed *intf, gsl_functi G_END_DECLS #endif /* _NC_INTEGRAL_H */ + diff --git a/numcosmo/math/ncm_lapack.h b/numcosmo/math/ncm_lapack.h index bfd798967..7bc02257b 100644 --- a/numcosmo/math/ncm_lapack.h +++ b/numcosmo/math/ncm_lapack.h @@ -79,7 +79,7 @@ gint ncm_lapack_dggglm_run (GArray *ws, NcmMatrix *L, NcmMatrix *X, NcmVector *p gint ncm_lapack_dgels (gchar trans, const gint m, const gint n, const gint nrhs, gdouble *a, const gint lda, gdouble *b, const gint ldb, double *work, const gint lwork); gint ncm_lapack_dgelsd (const gint m, const gint n, const gint nrhs, gdouble *a, const gint lda, gdouble *b, const gint ldb, gdouble *s, gdouble *rcond, gint *rank, NcmLapackWS *ws); -#define NCM_LAPACK_CHECK_INFO(func,info) G_STMT_START { if ((info) != 0) g_error ("# NcmLapack[%s] error %4d", func, (info)); } G_STMT_END +#define NCM_LAPACK_CHECK_INFO(func, info) G_STMT_START { if ((info) != 0) g_error ("# NcmLapack[%s] error %4d", func, (info)); } G_STMT_END G_END_DECLS @@ -97,3 +97,4 @@ G_END_DECLS #endif /* __GTK_DOC_IGNORE__ */ #endif /* NUMCOSMO_HAVE_INLINE */ #endif /* _NCM_LAPACK_INLINE_H_ */ + diff --git a/numcosmo/math/ncm_model.h b/numcosmo/math/ncm_model.h index 53b7cdb2a..d885085d7 100644 --- a/numcosmo/math/ncm_model.h +++ b/numcosmo/math/ncm_model.h @@ -215,66 +215,66 @@ void ncm_model___setitem__ (NcmModel *model, gchar *param, gdouble val, GError * /* * Model set functions */ -#define NCM_MODEL_SET_IMPL_FUNC(NS_NAME, NsName, ns_name, type, name) \ - void \ - ns_name ## _set_ ## name ## _impl (NsName ## Class * model_class, type f) \ - { \ +#define NCM_MODEL_SET_IMPL_FUNC(NS_NAME, NsName, ns_name, type, name) \ + void \ + ns_name ## _set_ ## name ## _impl (NsName ## Class * model_class, type f) \ + { \ ncm_model_class_add_impl_opts (NCM_MODEL_CLASS (model_class), NS_NAME ## _IMPL_ ## name, -1); \ - model_class->name = f; \ + model_class->name = f; \ } /* * Constant model functions call accessor */ -#define NCM_MODEL_FUNC0_IMPL(NS_NAME, NsName, ns_name, name) \ - gdouble ns_name ## _ ## name (NsName * m) \ - { \ +#define NCM_MODEL_FUNC0_IMPL(NS_NAME, NsName, ns_name, name) \ + gdouble ns_name ## _ ## name (NsName * m) \ + { \ return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m)); \ } /* * Model functions call */ -#define NCM_MODEL_FUNC1_IMPL(NS_NAME, NsName, ns_name, name, var) \ +#define NCM_MODEL_FUNC1_IMPL(NS_NAME, NsName, ns_name, name, var) \ gdouble ns_name ## _ ## name (NsName * m, const gdouble var) \ - { \ + { \ return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m), var); \ } /* * Model functions 2d call */ -#define NCM_MODEL_FUNC2_IMPL(NS_NAME, NsName, ns_name, name) \ +#define NCM_MODEL_FUNC2_IMPL(NS_NAME, NsName, ns_name, name) \ gdouble ns_name ## _ ## name (NsName * m, const gdouble x, const gdouble y) \ - { \ - return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m), x, y); \ + { \ + return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m), x, y); \ } /* * Constant model vector functions call accessor */ -#define NCM_MODEL_VFUNC0_IMPL(NS_NAME, NsName, ns_name, name) \ - gdouble ns_name ## _ ## name (NsName * m, const guint n) \ - { \ +#define NCM_MODEL_VFUNC0_IMPL(NS_NAME, NsName, ns_name, name) \ + gdouble ns_name ## _ ## name (NsName * m, const guint n) \ + { \ return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m), n); \ } /* * Model vector functions call */ -#define NCM_MODEL_VFUNC1_IMPL(NS_NAME, NsName, ns_name, name, var) \ +#define NCM_MODEL_VFUNC1_IMPL(NS_NAME, NsName, ns_name, name, var) \ gdouble ns_name ## _ ## name (NsName * m, const guint n, const gdouble var) \ - { \ - return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m), n, var); \ + { \ + return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m), n, var); \ } /* * Model functions 2d call */ -#define NCM_MODEL_VFUNC2_IMPL(NS_NAME, NsName, ns_name, name) \ +#define NCM_MODEL_VFUNC2_IMPL(NS_NAME, NsName, ns_name, name) \ gdouble ns_name ## _ ## name (NsName * m, const guint n, const gdouble x, const gdouble y) \ - { \ - return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m), n, x, y); \ + { \ + return NS_NAME ## _GET_CLASS (m)->name (NS_NAME (m), n, x, y); \ } G_END_DECLS diff --git a/numcosmo/math/ncm_model_funnel.h b/numcosmo/math/ncm_model_funnel.h index 62bcae06d..d812e560c 100644 --- a/numcosmo/math/ncm_model_funnel.h +++ b/numcosmo/math/ncm_model_funnel.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * ncm_model_funnel.h * @@ -14,12 +15,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -77,3 +78,4 @@ void ncm_model_funnel_clear (NcmModelFunnel **mfu); G_END_DECLS #endif /* _NCM_MODEL_FUNNEL_H_ */ + diff --git a/numcosmo/math/ncm_model_mvnd.h b/numcosmo/math/ncm_model_mvnd.h index 05bd9b73a..a8d494ee1 100644 --- a/numcosmo/math/ncm_model_mvnd.h +++ b/numcosmo/math/ncm_model_mvnd.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * ncm_model_mvnd.h * @@ -14,12 +15,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -42,13 +43,13 @@ G_DECLARE_FINAL_TYPE (NcmModelMVND, ncm_model_mvnd, NCM, MODEL_MVND, NcmModel) /** * NcmModelMVNDVParams: * @NCM_MODEL_MVND_MEAN: Mean vector - * + * * MVND model parameters - * + * */ typedef enum _NcmModelMVNDVParams { - NCM_MODEL_MVND_MEAN, + NCM_MODEL_MVND_MEAN, /* < private > */ NNCM_MODEL_MVND_VPARAM_LEN, /*< skip >*/ } NcmModelMVNDVParams; @@ -65,3 +66,4 @@ void ncm_model_mvnd_mean (NcmModelMVND *model_mvnd, NcmVector *y); G_END_DECLS #endif /* _NCM_MODEL_MVND_H_ */ + diff --git a/numcosmo/math/ncm_model_rosenbrock.h b/numcosmo/math/ncm_model_rosenbrock.h index b172a5f24..5b3ffb54c 100644 --- a/numcosmo/math/ncm_model_rosenbrock.h +++ b/numcosmo/math/ncm_model_rosenbrock.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * ncm_model_rosenbrock.h * @@ -14,12 +15,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -65,3 +66,4 @@ void ncm_model_rosenbrock_clear (NcmModelRosenbrock **mrb); G_END_DECLS #endif /* _NCM_MODEL_ROSENBROCK_H_ */ + diff --git a/numcosmo/math/ncm_mpi_job_feval.h b/numcosmo/math/ncm_mpi_job_feval.h index f5328e690..91ad318a3 100644 --- a/numcosmo/math/ncm_mpi_job_feval.h +++ b/numcosmo/math/ncm_mpi_job_feval.h @@ -40,7 +40,7 @@ G_BEGIN_DECLS G_DECLARE_FINAL_TYPE (NcmMPIJobFEval, ncm_mpi_job_feval, NCM, MPI_JOB_FEVAL, NcmMPIJob) -NcmMPIJobFEval *ncm_mpi_job_feval_new (NcmFit *fit, NcmObjArray *func_oa); +NcmMPIJobFEval *ncm_mpi_job_feval_new (NcmFit * fit, NcmObjArray * func_oa); NcmMPIJobFEval *ncm_mpi_job_feval_ref (NcmMPIJobFEval *mjfeval); void ncm_mpi_job_feval_free (NcmMPIJobFEval *mjfeval); diff --git a/numcosmo/math/ncm_mpsf_0F1.h b/numcosmo/math/ncm_mpsf_0F1.h index 1c1b6ed56..07608296d 100644 --- a/numcosmo/math/ncm_mpsf_0F1.h +++ b/numcosmo/math/ncm_mpsf_0F1.h @@ -37,6 +37,7 @@ G_BEGIN_DECLS void ncm_mpsf_0F1_q (mpq_t b, mpq_t q, mpfr_ptr res, mp_rnd_t rnd); + void ncm_mpsf_0F1_d (gdouble b, gdouble x, mpfr_ptr res, mp_rnd_t rnd); gdouble ncm_sf_0F1 (gdouble b, gdouble x); diff --git a/numcosmo/math/ncm_mpsf_trig_int.h b/numcosmo/math/ncm_mpsf_trig_int.h index d1c27cdea..296866e9d 100644 --- a/numcosmo/math/ncm_mpsf_trig_int.h +++ b/numcosmo/math/ncm_mpsf_trig_int.h @@ -37,6 +37,7 @@ G_BEGIN_DECLS void ncm_mpsf_sin_int_mpfr (mpq_t q, mpfr_ptr res, mp_rnd_t rnd); + gdouble ncm_sf_sin_int (gdouble x); G_END_DECLS diff --git a/numcosmo/math/ncm_mset.h b/numcosmo/math/ncm_mset.h index 50dbb4d64..97502b174 100644 --- a/numcosmo/math/ncm_mset.h +++ b/numcosmo/math/ncm_mset.h @@ -121,17 +121,17 @@ void ncm_mset_model_register_id (NcmModelClass *model_class, const gchar *ns, co * This macro should be used in the source file of the model. * */ -#define NCM_MSET_MODEL_REGISTER_ID(model_ns, typemacro) \ - NcmModelID NCM_MSET_MODEL_ID_FUNC (model_ns) (void) \ - { \ - static NcmModelID id = -1; \ - if (id == -1) \ - { \ +#define NCM_MSET_MODEL_REGISTER_ID(model_ns, typemacro) \ + NcmModelID NCM_MSET_MODEL_ID_FUNC (model_ns) (void) \ + { \ + static NcmModelID id = -1; \ + if (id == -1) \ + { \ NcmModelClass *model_class = g_type_class_ref (typemacro); \ - id = model_class->model_id; \ - g_type_class_unref (model_class); \ - } \ - return id; \ + id = model_class->model_id; \ + g_type_class_unref (model_class); \ + } \ + return id; \ } NcmMSetPIndex *ncm_mset_pindex_new (NcmModelID mid, guint pid); diff --git a/numcosmo/math/ncm_mset_catalog.h b/numcosmo/math/ncm_mset_catalog.h index 185bf2b43..cb5e872c3 100644 --- a/numcosmo/math/ncm_mset_catalog.h +++ b/numcosmo/math/ncm_mset_catalog.h @@ -69,10 +69,10 @@ typedef enum _NcmMSetCatalogSync */ typedef enum _NcmMSetCatalogTrimType { - NCM_MSET_CATALOG_TRIM_TYPE_ESS = 1 << 0, + NCM_MSET_CATALOG_TRIM_TYPE_ESS = 1 << 0, NCM_MSET_CATALOG_TRIM_TYPE_HEIDEL = 1 << 1, - NCM_MSET_CATALOG_TRIM_TYPE_CK = 1 << 2, - NCM_MSET_CATALOG_TRIM_TYPE_ALL = (1 << 3) - 1, + NCM_MSET_CATALOG_TRIM_TYPE_CK = 1 << 2, + NCM_MSET_CATALOG_TRIM_TYPE_ALL = (1 << 3) - 1, } NcmMSetCatalogTrimType; /** diff --git a/numcosmo/math/ncm_nnls.h b/numcosmo/math/ncm_nnls.h index 59626c491..2d64e6cb7 100644 --- a/numcosmo/math/ncm_nnls.h +++ b/numcosmo/math/ncm_nnls.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * ncm_nnls.h * @@ -14,12 +15,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -86,3 +87,4 @@ NcmVector *ncm_nnls_get_residuals (NcmNNLS *nnls); G_END_DECLS #endif /* _NCM_NNLS_H_ */ + diff --git a/numcosmo/math/ncm_prior.h b/numcosmo/math/ncm_prior.h index 8bfc99285..def217bf5 100644 --- a/numcosmo/math/ncm_prior.h +++ b/numcosmo/math/ncm_prior.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -55,3 +55,4 @@ gboolean ncm_prior_is_m2lnL (NcmPrior *prior); G_END_DECLS #endif /* _NCM_PRIOR_H_ */ + diff --git a/numcosmo/math/ncm_prior_gauss_func.h b/numcosmo/math/ncm_prior_gauss_func.h index 53efb1f6c..02839334f 100644 --- a/numcosmo/math/ncm_prior_gauss_func.h +++ b/numcosmo/math/ncm_prior_gauss_func.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -35,9 +35,9 @@ G_BEGIN_DECLS #define NCM_TYPE_PRIOR_GAUSS_FUNC (ncm_prior_gauss_func_get_type ()) -G_DECLARE_FINAL_TYPE(NcmPriorGaussFunc, ncm_prior_gauss_func, NCM, PRIOR_GAUSS_FUNC, NcmPriorGauss) +G_DECLARE_FINAL_TYPE (NcmPriorGaussFunc, ncm_prior_gauss_func, NCM, PRIOR_GAUSS_FUNC, NcmPriorGauss) -NcmPriorGaussFunc *ncm_prior_gauss_func_new (NcmMSetFunc *mean_func, gdouble mu, gdouble sigma, gdouble var); +NcmPriorGaussFunc *ncm_prior_gauss_func_new (NcmMSetFunc * mean_func, gdouble mu, gdouble sigma, gdouble var); NcmPriorGaussFunc *ncm_prior_gauss_func_ref (NcmPriorGaussFunc *pgf); void ncm_prior_gauss_func_free (NcmPriorGaussFunc *pgf); @@ -46,3 +46,4 @@ void ncm_prior_gauss_func_clear (NcmPriorGaussFunc **pgf); G_END_DECLS #endif /* _NCM_PRIOR_GAUSS_FUNC_H_ */ + diff --git a/numcosmo/math/ncm_quaternion.h b/numcosmo/math/ncm_quaternion.h index 49835fc87..e3d1b034b 100644 --- a/numcosmo/math/ncm_quaternion.h +++ b/numcosmo/math/ncm_quaternion.h @@ -107,14 +107,23 @@ void ncm_quaternion_inv_rotate (NcmQuaternion *q, NcmTriVec *v); * NCM_QUATERNION_INIT: * */ -#define NCM_QUATERNION_INIT {0.0, {{0.0, 0.0, 0.0}}} +#define NCM_QUATERNION_INIT \ + {0.0, { \ + {0.0, 0.0, 0.0} \ + } \ + } /** * NCM_QUATERNION_INIT_I: * */ -#define NCM_QUATERNION_INIT_I {1.0, {{0.0, 0.0, 0.0}}} +#define NCM_QUATERNION_INIT_I \ + {1.0, { \ + {0.0, 0.0, 0.0} \ + } \ + } G_END_DECLS #endif /* _NCM_QUATERNION_H */ + diff --git a/numcosmo/math/ncm_serialize.h b/numcosmo/math/ncm_serialize.h index a20a1613c..cb3f5ba14 100644 --- a/numcosmo/math/ncm_serialize.h +++ b/numcosmo/math/ncm_serialize.h @@ -50,10 +50,10 @@ G_DECLARE_FINAL_TYPE (NcmSerialize, ncm_serialize, NCM, SERIALIZE, GObject) */ typedef enum _NcmSerializeOpt { - NCM_SERIALIZE_OPT_NONE = 0, + NCM_SERIALIZE_OPT_NONE = 0, NCM_SERIALIZE_OPT_AUTOSAVE_SER = 1 << 0, NCM_SERIALIZE_OPT_AUTONAME_SER = 1 << 1, - NCM_SERIALIZE_OPT_CLEAN_DUP = NCM_SERIALIZE_OPT_AUTOSAVE_SER | NCM_SERIALIZE_OPT_AUTONAME_SER, + NCM_SERIALIZE_OPT_CLEAN_DUP = NCM_SERIALIZE_OPT_AUTOSAVE_SER | NCM_SERIALIZE_OPT_AUTONAME_SER, } NcmSerializeOpt; NcmSerialize *ncm_serialize_new (NcmSerializeOpt sopt); diff --git a/numcosmo/math/ncm_sf_sbessel.h b/numcosmo/math/ncm_sf_sbessel.h index 3f07e43d3..738ed61e9 100644 --- a/numcosmo/math/ncm_sf_sbessel.h +++ b/numcosmo/math/ncm_sf_sbessel.h @@ -33,6 +33,7 @@ G_BEGIN_DECLS gdouble ncm_sf_sbessel (gulong l, gdouble x); + void ncm_sf_sbessel_taylor (gulong l, gdouble x, gdouble *djl); NcmSpline *ncm_sf_sbessel_spline (gulong l, gdouble xi, gdouble xf, gdouble reltol); diff --git a/numcosmo/math/ncm_sphere_map.h b/numcosmo/math/ncm_sphere_map.h index 449515899..5467b10a8 100644 --- a/numcosmo/math/ncm_sphere_map.h +++ b/numcosmo/math/ncm_sphere_map.h @@ -72,8 +72,8 @@ typedef enum _NcmSphereMapOrder */ typedef enum _NcmSphereMapCoordSys { - NCM_SPHERE_MAP_COORD_SYS_GALACTIC = 'G', - NCM_SPHERE_MAP_COORD_SYS_ECLIPTIC = 'E', + NCM_SPHERE_MAP_COORD_SYS_GALACTIC = 'G', + NCM_SPHERE_MAP_COORD_SYS_ECLIPTIC = 'E', NCM_SPHERE_MAP_COORD_SYS_CELESTIAL = 'C', /* < private > */ NCM_SPHERE_MAP_COORD_SYS_LEN, /*< skip >*/ @@ -146,27 +146,27 @@ void ncm_sphere_map_alm2map (NcmSphereMap *smap); NcmSpline *ncm_sphere_map_calc_Ctheta (NcmSphereMap *smap, const gdouble reltol); #define NCM_SPHERE_MAP_N(nside) (12 * (nside) * (nside)) -#define NCM_SPHERE_MAP_INT_TO_XY(i, x, y) \ - G_STMT_START { \ - gint shift = 0, shifted = i; \ - x = y = 0; \ - do { \ - x |= ((shifted & 1) << shift); \ +#define NCM_SPHERE_MAP_INT_TO_XY(i, x, y) \ + G_STMT_START { \ + gint shift = 0, shifted = i; \ + x = y = 0; \ + do { \ + x |= ((shifted & 1) << shift); \ y |= (((shifted & 2) >> 1) << shift); \ - shift++; \ - } while (shifted >>= 2); \ + shift++; \ + } while (shifted >>= 2); \ } G_STMT_END -#define NCM_SPHERE_MAP_XY_TO_INT(x, y, i) \ - G_STMT_START { \ - gint shift = 0, shifted_x = x, shifted_y = y; \ - g_assert (shifted_x >= 0 && shifted_y >= 0); \ - i = 0; \ - do { \ - i |= ((shifted_x & 1) << (shift + 0)); \ - i |= ((shifted_y & 1) << (shift + 1)); \ +#define NCM_SPHERE_MAP_XY_TO_INT(x, y, i) \ + G_STMT_START { \ + gint shift = 0, shifted_x = x, shifted_y = y; \ + g_assert (shifted_x >= 0 && shifted_y >= 0); \ + i = 0; \ + do { \ + i |= ((shifted_x & 1) << (shift + 0)); \ + i |= ((shifted_y & 1) << (shift + 1)); \ shift += 2; shifted_x >>= 1; shifted_y >>= 1; \ - } while (shifted_x || shifted_y); \ + } while (shifted_x || shifted_y); \ } G_STMT_END #define NCM_SPHERE_MAP_HEALPIX_NULLVAL (-1.6375e30) diff --git a/numcosmo/math/ncm_sphere_map_block.c b/numcosmo/math/ncm_sphere_map_block.c index 1838ed505..c327a6e9c 100644 --- a/numcosmo/math/ncm_sphere_map_block.c +++ b/numcosmo/math/ncm_sphere_map_block.c @@ -27,7 +27,7 @@ */ static void -NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_run_over_l) (NcmSphereMap * pix, NcmSFSphericalHarmonicsY *sphaY, NcmComplex *restrict alm, const NcmComplex *Fim_i) +NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_run_over_l) (NcmSphereMap *pix, NcmSFSphericalHarmonicsY *sphaY, NcmComplex *restrict alm, const NcmComplex *Fim_i) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); const gint lmax = self->lmax; @@ -84,7 +84,7 @@ NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_run_over_l) (NcmSphereMap * pix, NcmSF } static void -NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_run_over_l_array) (NcmSphereMap * pix, NcmSFSphericalHarmonicsYArray *sphaYa, NcmComplex *restrict alm, const NcmComplex *restrict Fim_i) +NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_run_over_l_array) (NcmSphereMap *pix, NcmSFSphericalHarmonicsYArray *sphaYa, NcmComplex *restrict alm, const NcmComplex *restrict Fim_i) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); const gint lmax = self->lmax; @@ -165,7 +165,7 @@ NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_run_over_l_array) (NcmSphereMap * pix, } static void -NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_prepare_circle) (NcmSphereMap * pix, const gint64 r_i, const gint64 i, _fft_complex *restrict *restrict Fima, gdouble *theta, gdouble *phi, gint64 *ring_size, gint64 *ring_size_2) +NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_prepare_circle) (NcmSphereMap *pix, const gint64 r_i, const gint64 i, _fft_complex *restrict *restrict Fima, gdouble *theta, gdouble *phi, gint64 *ring_size, gint64 *ring_size_2) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); const gint64 ring_fi = ncm_sphere_map_get_ring_first_index (pix, r_i); @@ -179,7 +179,7 @@ NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_prepare_circle) (NcmSphereMap * pix, c } static gboolean -NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_get_alm_from_apcircles) (NcmSphereMap * pix, NcmSFSphericalHarmonicsYArray *sphaYa, NcmComplex *restrict alm, const gint64 r_ini, const gint64 nrings, const gint64 mmax) +NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_get_alm_from_apcircles) (NcmSphereMap *pix, NcmSFSphericalHarmonicsYArray *sphaYa, NcmComplex *restrict alm, const gint64 r_ini, const gint64 nrings, const gint64 mmax) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); const gint lmax = self->lmax; @@ -258,7 +258,7 @@ NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_get_alm_from_apcircles) (NcmSphereMap } static void -NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_get_alm_from_circle) (NcmSphereMap * pix, NcmSFSphericalHarmonicsY *sphaY, NcmComplex *restrict alm, gint64 r_i) +NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_get_alm_from_circle) (NcmSphereMap *pix, NcmSFSphericalHarmonicsY *sphaY, NcmComplex *restrict alm, gint64 r_i) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); const gint lmax = self->lmax; @@ -353,7 +353,7 @@ NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_get_alm_from_circle) (NcmSphereMap * p } static void -NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_map2alm_run) (NcmSphereMap * pix) +NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_map2alm_run) (NcmSphereMap *pix) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); NcmSFSphericalHarmonicsY *sphaY = ncm_sf_spherical_harmonics_Y_new (self->spha, NCM_SF_SPHERICAL_HARMONICS_DEFAULT_ABSTOL); @@ -413,7 +413,7 @@ NCM_SPHERE_MAP_BLOCK_DEC (_ncm_sphere_map_map2alm_run) (NcmSphereMap * pix) } static void -NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_D_m) (NcmSphereMap * pix, NcmSFSphericalHarmonicsY *sphaY, NcmComplex *restrict *restrict alm_ptr, const gint ring_size, const gint m, NcmComplex *D_m) +NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_D_m) (NcmSphereMap *pix, NcmSFSphericalHarmonicsY *sphaY, NcmComplex *restrict *restrict alm_ptr, const gint ring_size, const gint m, NcmComplex *D_m) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); const gint lmaxmstepm2 = self->lmax - NCM_SPHERE_MAP_BLOCK_INV_STEPM2; @@ -465,7 +465,7 @@ NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_D_m) (NcmSphereMap * pix, NcmS } static void -NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_D_m_array) (NcmSphereMap * pix, NcmSFSphericalHarmonicsYArray *sphaYa, NcmComplex *restrict *restrict alm_ptr, const gint m, NcmComplex *D_m) +NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_D_m_array) (NcmSphereMap *pix, NcmSFSphericalHarmonicsYArray *sphaYa, NcmComplex *restrict *restrict alm_ptr, const gint m, NcmComplex *D_m) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); const gint lmaxmstepm2 = self->lmax - NCM_SPHERE_MAP_BLOCK_INV_STEPM2; @@ -527,7 +527,7 @@ NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_D_m_array) (NcmSphereMap * pix } static void -NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_circle_from_alm) (NcmSphereMap * pix, gint64 r_i) +NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_circle_from_alm) (NcmSphereMap *pix, gint64 r_i) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); NcmSFSphericalHarmonicsY *sphaY = ncm_sf_spherical_harmonics_Y_new (self->spha, NCM_SF_SPHERICAL_HARMONICS_DEFAULT_ABSTOL); @@ -600,7 +600,7 @@ NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_circle_from_alm) (NcmSphereMap } static void -NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_apcircles_from_alm) (NcmSphereMap * pix, const gint64 r_ini, const gint64 nrings) +NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_apcircles_from_alm) (NcmSphereMap *pix, const gint64 r_ini, const gint64 nrings) { NcmSphereMapPrivate * const self = ncm_sphere_map_get_instance_private (pix); NcmSFSphericalHarmonicsYArray *sphaYa = ncm_sf_spherical_harmonics_Y_array_new (self->spha, NCM_SPHERE_MAP_BLOCK_INV_NCT, NCM_SF_SPHERICAL_HARMONICS_ARRAY_DEFAULT_ABSTOL); @@ -695,7 +695,7 @@ NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_get_apcircles_from_alm) (NcmSphere } static void -NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_alm2map_run) (NcmSphereMap * pix) +NCM_SPHERE_MAP_BLOCK_INV_DEC (_ncm_sphere_map_alm2map_run) (NcmSphereMap *pix) { const gint64 nrings = ncm_sphere_map_get_nrings (pix); const gint64 nrings_2 = nrings / 2; diff --git a/numcosmo/math/ncm_spline_func.c b/numcosmo/math/ncm_spline_func.c index 4107bff56..cc93cc3dc 100644 --- a/numcosmo/math/ncm_spline_func.c +++ b/numcosmo/math/ncm_spline_func.c @@ -109,23 +109,25 @@ #include #endif /* NUMCOSMO_GIR_SCAN */ -typedef struct { gdouble x; - gdouble y; - gint ok; +typedef struct +{ + gdouble x; + gdouble y; + gint ok; } _BIVec; -#define BIVEC_LIST_APPEND(dlist, xX, yY) \ - do { \ - _BIVec *bv = g_slice_new (_BIVec); \ - bv->x = (xX); bv->y = (yY); bv->ok = FALSE; \ - dlist = g_list_append (dlist, bv); \ - } while (FALSE) -#define BIVEC_LIST_INSERT_BEFORE(dlist, node, xX, yY) \ - do { \ - _BIVec *bv = g_slice_new (_BIVec); \ - bv->x = (xX); bv->y = (yY); bv->ok = FALSE; \ - dlist = g_list_insert_before (dlist, node, bv); \ - } while (FALSE) +#define BIVEC_LIST_APPEND(dlist, xX, yY) \ + do { \ + _BIVec *bv = g_slice_new (_BIVec); \ + bv->x = (xX); bv->y = (yY); bv->ok = FALSE; \ + dlist = g_list_append (dlist, bv); \ + } while (FALSE) +#define BIVEC_LIST_INSERT_BEFORE(dlist, node, xX, yY) \ + do { \ + _BIVec *bv = g_slice_new (_BIVec); \ + bv->x = (xX); bv->y = (yY); bv->ok = FALSE; \ + dlist = g_list_insert_before (dlist, node, bv); \ + } while (FALSE) #define BIVEC_LIST_X(dlist) (((_BIVec *) (dlist)->data)->x) #define BIVEC_LIST_Y(dlist) (((_BIVec *) (dlist)->data)->y) @@ -135,31 +137,31 @@ static void _test_and_eval_interior_4 (GList *nodes, gsl_function *F, const gdouble yinterp1, const gdouble yinterp2, const gdouble rel_error, const gdouble f_scale, gboolean ok) { gint i; - + GList *wnodes[3]; gdouble poly3_dd[4]; gdouble poly3_x[4]; gdouble poly3_y[4]; gdouble step, sub_step; gboolean go_ok = FALSE; - + poly3_x[0] = BIVEC_LIST_X (nodes); poly3_x[3] = BIVEC_LIST_X (nodes->next); poly3_y[0] = BIVEC_LIST_Y (nodes); poly3_y[3] = BIVEC_LIST_Y (nodes->next); - + step = (poly3_x[3] - poly3_x[0]) / 3.0; sub_step = step / 3.0; poly3_x[1] = poly3_x[0] + step; poly3_x[2] = poly3_x[1] + step; poly3_y[1] = GSL_FN_EVAL (F, poly3_x[1]); poly3_y[2] = GSL_FN_EVAL (F, poly3_x[2]); - + BIVEC_LIST_INSERT_BEFORE (nodes, nodes->next, poly3_x[2], poly3_y[2]); BIVEC_LIST_INSERT_BEFORE (nodes, nodes->next, poly3_x[1], poly3_y[1]); - + gsl_poly_dd_init (poly3_dd, poly3_x, poly3_y, 4); - + if ((fabs (poly3_y[1] - yinterp1) < ((fabs (poly3_y[1]) + f_scale) * rel_error)) && (fabs (poly3_y[2] - yinterp2) < ((fabs (poly3_y[2]) + f_scale) * rel_error))) { @@ -168,15 +170,15 @@ _test_and_eval_interior_4 (GList *nodes, gsl_function *F, const gdouble yinterp1 else go_ok = TRUE; } - + wnodes[0] = nodes; wnodes[1] = wnodes[0]->next; wnodes[2] = wnodes[1]->next; - + for (i = 0; i < 3; i++) { gdouble try_yinterp1, try_yinterp2; - + try_yinterp1 = gsl_poly_dd_eval (poly3_dd, poly3_x, 4, poly3_x[i] + sub_step); try_yinterp2 = gsl_poly_dd_eval (poly3_dd, poly3_x, 4, poly3_x[i] + 2.0 * sub_step); _test_and_eval_interior_4 (wnodes[i], F, try_yinterp1, try_yinterp2, rel_error, f_scale, go_ok); @@ -203,49 +205,49 @@ ncm_spline_new_function_4 (NcmSpline *s, gsl_function *F, const gdouble xi, cons GArray *x_array; GArray *y_array; gsize n_elem; - + max_nodes = (max_nodes <= 0) ? G_MAXUINT64 : max_nodes; g_assert_cmpfloat (f_scale, >=, 0.0); - + for (i = 0; i < 4; i++) { poly3_x[i] = xi + i * step; poly3_y[i] = GSL_FN_EVAL (F, poly3_x[i]); BIVEC_LIST_APPEND (nodes, poly3_x[i], poly3_y[i]); } - + gsl_poly_dd_init (poly3_dd, poly3_x, poly3_y, 4); - + wnodes[0] = nodes; wnodes[1] = wnodes[0]->next; wnodes[2] = wnodes[1]->next; - + for (i = 0; i < 3; i++) { gdouble yinterp1, yinterp2; - + yinterp1 = gsl_poly_dd_eval (poly3_dd, poly3_x, 4, poly3_x[i] + sub_step); yinterp2 = gsl_poly_dd_eval (poly3_dd, poly3_x, 4, poly3_x[i] + 2.0 * sub_step); - + _test_and_eval_interior_4 (wnodes[i], F, yinterp1, yinterp2, rel_error, f_scale, FALSE); } - + n_elem = g_list_length (nodes); x_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), n_elem); y_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), n_elem); - + wnodes[0] = nodes; - + do { g_array_append_val (x_array, BIVEC_LIST_X (nodes)); g_array_append_val (y_array, BIVEC_LIST_Y (nodes)); nodes = nodes->next; } while (nodes != NULL); - + g_list_free_full (wnodes[0], _BIVec_free); - + ncm_spline_set_array (s, x_array, y_array, TRUE); - + g_array_unref (x_array); g_array_unref (y_array); @@ -255,74 +257,74 @@ ncm_spline_new_function_4 (NcmSpline *s, gsl_function *F, const gdouble xi, cons static void ncm_spline_new_function_spline (NcmSpline *s, gsl_function *F, const gdouble xi, const gdouble xf, gsize max_nodes, const gdouble rel_error, const gdouble f_scale, gint refine, gdouble refine_ns) { - GArray *x_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); - GArray *y_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); + GArray *x_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); + GArray *y_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GArray *xt_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GArray *yt_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GList *nodes = NULL, *wnodes = NULL; NcmStatsVec *dx_stats = ncm_stats_vec_new (1, NCM_STATS_VEC_VAR, FALSE); - gsize n = ncm_spline_min_size (s); + gsize n = ncm_spline_min_size (s); gdouble max_dx, min_dx; guint i; - + n = (n < 3) ? 3 : n; - + ncm_assert_cmpdouble_e (xf, >, xi, DBL_EPSILON, 0.0); g_assert_cmpfloat (f_scale, >=, 0.0); - + max_nodes = (max_nodes <= 0) ? G_MAXUINT64 : max_nodes; - + g_array_set_size (xt_array, n); g_array_set_size (yt_array, n); - + for (i = 0; i < n; i++) { const gdouble x = xi + (xf - xi) / (n - 1.0) * i; const gdouble y = GSL_FN_EVAL (F, x); - + BIVEC_LIST_APPEND (nodes, x, y); BIVEC_LIST_OK (nodes) = 0; - + g_array_append_val (x_array, x); g_array_append_val (y_array, y); g_assert (gsl_finite (x)); g_assert (gsl_finite (y)); } - + ncm_spline_set_array (s, x_array, y_array, TRUE); - -#define SWAP_PTR(a, b) \ - do { \ - const gpointer tmp = (b); (b) = (a); (a) = tmp; \ - } while (FALSE) - + +#define SWAP_PTR(a, b) \ + do { \ + const gpointer tmp = (b); (b) = (a); (a) = tmp; \ + } while (FALSE) + while (TRUE) { gsize improves = 0; - + wnodes = nodes; g_array_set_size (xt_array, 0); g_array_set_size (yt_array, 0); - + ncm_stats_vec_reset (dx_stats, TRUE); - + max_dx = 0.0; min_dx = 1.0e300; - + do { const gdouble x0 = BIVEC_LIST_X (wnodes); const gdouble x1 = BIVEC_LIST_X (wnodes->next); const gdouble dx = x1 - x0; - + max_dx = MAX (max_dx, dx); min_dx = MIN (min_dx, dx); - + g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); - + ncm_stats_vec_set (dx_stats, 0, x1 - x0); ncm_stats_vec_update (dx_stats); - + if (BIVEC_LIST_OK (wnodes) == 1) { continue; @@ -346,13 +348,13 @@ ncm_spline_new_function_spline (NcmSpline *s, gsl_function *F, const gdouble xi, y0, y, y1, fabs (y0 / y - 1.0), fabs (y1 / y - 1.0)); - + BIVEC_LIST_INSERT_BEFORE (nodes, wnodes->next, x, y); wnodes = g_list_next (wnodes); g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); BIVEC_LIST_OK (wnodes) = BIVEC_LIST_OK (wnodes->prev); - + if (test_p && test_I) { BIVEC_LIST_OK (wnodes->prev)++; @@ -364,28 +366,30 @@ ncm_spline_new_function_spline (NcmSpline *s, gsl_function *F, const gdouble xi, } } } while ((wnodes = g_list_next (wnodes)) && wnodes->next); - + if (wnodes != NULL) { g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); } - + SWAP_PTR (x_array, xt_array); SWAP_PTR (y_array, yt_array); - + ncm_spline_set_array (s, x_array, y_array, TRUE); - + if (x_array->len > max_nodes) { g_warning ("ncm_spline_new_function_spline: cannot archive requested precision with at most %zu nodes", max_nodes); break; } - + if (improves == 0) { if (refine < 1) + { break; + } else { const gdouble dx_mean = ncm_stats_vec_get_mean (dx_stats, 0); @@ -414,24 +418,24 @@ ncm_spline_new_function_spline (NcmSpline *s, gsl_function *F, const gdouble xi, } } } - + g_list_free_full (nodes, _BIVec_free); - + g_array_unref (x_array); g_array_unref (xt_array); g_array_unref (y_array); g_array_unref (yt_array); - + ncm_stats_vec_clear (&dx_stats); - + return; } static void ncm_spline_new_function_spline_lnknot (NcmSpline *s, gsl_function *F, const gdouble xi, const gdouble xf, gsize max_nodes, gdouble rel_error, const gdouble f_scale) { - GArray *x_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); - GArray *y_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); + GArray *x_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); + GArray *y_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GArray *xt_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GArray *yt_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GList *nodes = NULL, *wnodes = NULL; @@ -439,47 +443,47 @@ ncm_spline_new_function_spline_lnknot (NcmSpline *s, gsl_function *F, const gdou guint i; const gdouble lnxi = log (xi); const gdouble lnxf = log (xf); - + n = (n < 3) ? 3 : n; - + max_nodes = (max_nodes <= 0) ? G_MAXUINT64 : max_nodes; - + g_assert (xi > 0.0 && xf > xi); g_assert_cmpfloat (f_scale, >=, 0.0); - + g_array_set_size (xt_array, n); g_array_set_size (yt_array, n); - + for (i = 0; i < n; i++) { gdouble x = exp (lnxi + (lnxf - lnxi) / (n - 1.0) * i); gdouble y = GSL_FN_EVAL (F, x); - + BIVEC_LIST_APPEND (nodes, x, y); BIVEC_LIST_OK (nodes) = 0; g_array_append_val (x_array, x); g_array_append_val (y_array, y); } - + ncm_spline_set_array (s, x_array, y_array, TRUE); - -#define SWAP_PTR(a, b) \ - do { \ - const gpointer tmp = (b); (b) = (a); (a) = tmp; \ - } while (FALSE) - + +#define SWAP_PTR(a, b) \ + do { \ + const gpointer tmp = (b); (b) = (a); (a) = tmp; \ + } while (FALSE) + while (TRUE) { gsize improves = 0; - + wnodes = nodes; g_array_set_size (xt_array, 0); g_array_set_size (yt_array, 0); - + do { g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); - + if (BIVEC_LIST_OK (wnodes) == 1) { continue; @@ -501,7 +505,7 @@ ncm_spline_new_function_spline_lnknot (NcmSpline *s, gsl_function *F, const gdou const gdouble Iys = ncm_spline_eval_integ (s, x0, x1); const gboolean test_p = fabs (y - ys) <= rel_error * (fabs (y) + f_scale); const gboolean test_I = fabs (Iyc - Iys) <= rel_error * (fabs (Iyc) + f_scale * (x1 - x0)); - + if (fabs ((x - x0) / x) < NCM_SPLINE_KNOT_DIFF_TOL) g_error ("Tolerance of the difference between knots was reached. Interpolated function is probably discontinuous at x = (% 20.15g, % 20.15g, % 20.15g).\n" "\tFunction value at f(x0) = % 22.15g, f(x) = % 22.15g and f(x1) = % 22.15g, cmp (%e, %e).", @@ -509,13 +513,13 @@ ncm_spline_new_function_spline_lnknot (NcmSpline *s, gsl_function *F, const gdou y0, y, y1, fabs (y0 / y - 1.0), fabs (y1 / y - 1.0)); - + BIVEC_LIST_INSERT_BEFORE (nodes, wnodes->next, x, y); wnodes = g_list_next (wnodes); g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); BIVEC_LIST_OK (wnodes) = BIVEC_LIST_OK (wnodes->prev); - + if (test_p && test_I) { BIVEC_LIST_OK (wnodes->prev)++; @@ -527,43 +531,43 @@ ncm_spline_new_function_spline_lnknot (NcmSpline *s, gsl_function *F, const gdou } } } while ((wnodes = g_list_next (wnodes)) && wnodes->next); - + if (wnodes != NULL) { g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); } - + SWAP_PTR (x_array, xt_array); SWAP_PTR (y_array, yt_array); - + ncm_spline_set_array (s, x_array, y_array, TRUE); - + if (x_array->len > max_nodes) { g_warning ("ncm_spline_new_function_spline: cannot archive requested precision with at most %zu nodes", max_nodes); break; } - + if (improves == 0) break; } - + g_list_free_full (nodes, _BIVec_free); - + g_array_unref (x_array); g_array_unref (xt_array); g_array_unref (y_array); g_array_unref (yt_array); - + return; } static void ncm_spline_new_function_spline_sinhknot (NcmSpline *s, gsl_function *F, const gdouble xi, const gdouble xf, gsize max_nodes, const gdouble rel_error, const gdouble f_scale) { - GArray *x_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); - GArray *y_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); + GArray *x_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); + GArray *y_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GArray *xt_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GArray *yt_array = g_array_sized_new (FALSE, FALSE, sizeof (gdouble), 1000); GList *nodes = NULL, *wnodes = NULL; @@ -571,47 +575,47 @@ ncm_spline_new_function_spline_sinhknot (NcmSpline *s, gsl_function *F, const gd guint i; const gdouble axi = asinh (xi); const gdouble axf = asinh (xf); - + g_assert_cmpfloat (f_scale, >=, 0.0); - + n = (n < 3) ? 3 : n; - + max_nodes = (max_nodes <= 0) ? G_MAXUINT64 : max_nodes; - + g_array_set_size (xt_array, n); g_array_set_size (yt_array, n); - + for (i = 0; i < n; i++) { gdouble x = sinh (axi + (axf - axi) / (n - 1.0) * i); gdouble y = GSL_FN_EVAL (F, x); - + BIVEC_LIST_APPEND (nodes, x, y); BIVEC_LIST_OK (nodes) = 0; - + g_array_append_val (x_array, x); g_array_append_val (y_array, y); } - + ncm_spline_set_array (s, x_array, y_array, TRUE); - -#define SWAP_PTR(a, b) \ - do { \ - const gpointer tmp = (b); (b) = (a); (a) = tmp; \ - } while (FALSE) - + +#define SWAP_PTR(a, b) \ + do { \ + const gpointer tmp = (b); (b) = (a); (a) = tmp; \ + } while (FALSE) + while (TRUE) { gsize improves = 0; - + wnodes = nodes; g_array_set_size (xt_array, 0); g_array_set_size (yt_array, 0); - + do { g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); - + if (BIVEC_LIST_OK (wnodes) == 1) { continue; @@ -633,7 +637,7 @@ ncm_spline_new_function_spline_sinhknot (NcmSpline *s, gsl_function *F, const gd const gdouble Iys = ncm_spline_eval_integ (s, x0, x1); const gboolean test_p = fabs (y - ys) <= rel_error * (fabs (y) + f_scale); const gboolean test_I = fabs (Iyc - Iys) <= rel_error * (fabs (Iyc) + f_scale * (x1 - x0)); - + if (fabs ((x - x0) / x) < NCM_SPLINE_KNOT_DIFF_TOL) g_error ("Tolerance of the difference between knots was reached. Interpolated function is probably discontinuous at x = (% 20.15g, % 20.15g, % 20.15g).\n" "\tFunction value at f(x0) = % 22.15g, f(x) = % 22.15g and f(x1) = % 22.15g, cmp (%e, %e).", @@ -641,13 +645,13 @@ ncm_spline_new_function_spline_sinhknot (NcmSpline *s, gsl_function *F, const gd y0, y, y1, fabs (y0 / y - 1.0), fabs (y1 / y - 1.0)); - + BIVEC_LIST_INSERT_BEFORE (nodes, wnodes->next, x, y); wnodes = g_list_next (wnodes); g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); BIVEC_LIST_OK (wnodes) = BIVEC_LIST_OK (wnodes->prev); - + if (test_p && test_I) { BIVEC_LIST_OK (wnodes->prev)++; @@ -659,35 +663,35 @@ ncm_spline_new_function_spline_sinhknot (NcmSpline *s, gsl_function *F, const gd } } } while ((wnodes = g_list_next (wnodes)) && wnodes->next); - + if (wnodes != NULL) { g_array_append_val (xt_array, BIVEC_LIST_X (wnodes)); g_array_append_val (yt_array, BIVEC_LIST_Y (wnodes)); } - + SWAP_PTR (x_array, xt_array); SWAP_PTR (y_array, yt_array); - + ncm_spline_set_array (s, x_array, y_array, TRUE); - + if (x_array->len > max_nodes) { g_warning ("ncm_spline_new_function_spline: cannot achive requested precision with at most %zu nodes", max_nodes); break; } - + if (improves == 0) break; } - + g_list_free_full (nodes, _BIVec_free); - + g_array_unref (x_array); g_array_unref (xt_array); g_array_unref (y_array); g_array_unref (yt_array); - + return; } @@ -707,7 +711,7 @@ void ncm_spline_set_func (NcmSpline *s, NcmSplineFuncType ftype, gsl_function *F, const gdouble xi, const gdouble xf, gsize max_nodes, const gdouble rel_error) { ncm_assert_cmpdouble_e (xf, >, xi, DBL_EPSILON, 0.0); - + switch (ftype) { case NCM_SPLINE_FUNCTION_4POINTS: @@ -724,7 +728,7 @@ ncm_spline_set_func (NcmSpline *s, NcmSplineFuncType ftype, gsl_function *F, con break; default: g_assert_not_reached (); - + return; } } @@ -748,7 +752,7 @@ void ncm_spline_set_func_scale (NcmSpline *s, NcmSplineFuncType ftype, gsl_function *F, const gdouble xi, const gdouble xf, gsize max_nodes, const gdouble rel_error, const gdouble scale, const gint refine, gdouble refine_ns) { ncm_assert_cmpdouble_e (xf, >, xi, DBL_EPSILON, 0.0); - + switch (ftype) { case NCM_SPLINE_FUNCTION_4POINTS: @@ -765,7 +769,7 @@ ncm_spline_set_func_scale (NcmSpline *s, NcmSplineFuncType ftype, gsl_function * break; default: g_assert_not_reached (); - + return; } } @@ -788,8 +792,8 @@ ncm_spline_set_func_scale (NcmSpline *s, NcmSplineFuncType ftype, gsl_function * void ncm_spline_set_func1 (NcmSpline *s, NcmSplineFuncType ftype, NcmSplineFuncF F, GObject *obj, gdouble xi, gdouble xf, gsize max_nodes, gdouble rel_error) { - gsl_function gslF = {(gdouble (*)(gdouble, gpointer))F, obj}; - + gsl_function gslF = {(gdouble (*)(gdouble, gpointer)) F, obj}; + ncm_spline_set_func (s, ftype, &gslF, xi, xf, max_nodes, rel_error); } @@ -799,24 +803,24 @@ _ncm_spline_new_function_grid_linear (NcmSpline *s, gsl_function *F, const gdoub guint i; NcmVector *xv = ncm_vector_new (nnodes); NcmVector *yv = ncm_vector_new (nnodes); - + for (i = 0; i < nnodes; i++) { const gdouble x = xi + (xf - xi) / (nnodes - 1.0) * i; const gdouble y = GSL_FN_EVAL (F, x); - + g_assert (gsl_finite (x)); g_assert (gsl_finite (y)); - + ncm_vector_set (xv, i, x); ncm_vector_set (yv, i, y); } - + ncm_spline_set (s, xv, yv, TRUE); - + ncm_vector_free (xv); ncm_vector_free (yv); - + return; } @@ -828,26 +832,26 @@ _ncm_spline_new_function_grid_log (NcmSpline *s, gsl_function *F, const gdouble const gdouble lnxf = log (xf); NcmVector *xv = ncm_vector_new (nnodes); NcmVector *yv = ncm_vector_new (nnodes); - + g_assert (xi > 0.0); - + for (i = 0; i < nnodes; i++) { const gdouble x = exp (lnxi + (lnxf - lnxi) / (nnodes - 1.0) * i); const gdouble y = GSL_FN_EVAL (F, x); - + g_assert (gsl_finite (x)); g_assert (gsl_finite (y)); - + ncm_vector_set (xv, i, x); ncm_vector_set (yv, i, y); } - + ncm_spline_set (s, xv, yv, TRUE); - + ncm_vector_free (xv); ncm_vector_free (yv); - + return; } @@ -868,10 +872,10 @@ void ncm_spline_set_func_grid (NcmSpline *s, NcmSplineFuncType ftype, gsl_function *F, const gdouble xi, const gdouble xf, gsize nnodes) { ncm_assert_cmpdouble_e (xf, >, xi, DBL_EPSILON, 0.0); - + g_assert_cmpuint (nnodes, <, NCM_SPLINE_FUNC_DEFAULT_MAX_NODES); g_assert_cmpuint (nnodes, >, ncm_spline_min_size (s)); - + switch (ftype) { case NCM_SPLINE_FUNC_GRID_LINEAR: @@ -882,7 +886,7 @@ ncm_spline_set_func_grid (NcmSpline *s, NcmSplineFuncType ftype, gsl_function *F break; default: g_assert_not_reached (); - + return; } } @@ -908,8 +912,8 @@ ncm_spline_set_func_grid (NcmSpline *s, NcmSplineFuncType ftype, gsl_function *F void ncm_spline_set_func_grid1 (NcmSpline *s, NcmSplineFuncType ftype, NcmSplineFuncF F, GObject *obj, gdouble xi, gdouble xf, gsize nnodes) { - gsl_function gslF = {(gdouble (*)(gdouble, gpointer))F, obj}; - + gsl_function gslF = {(gdouble (*)(gdouble, gpointer)) F, obj}; + ncm_spline_set_func_grid (s, ftype, &gslF, xi, xf, nnodes); } diff --git a/numcosmo/math/ncm_spline_func.h b/numcosmo/math/ncm_spline_func.h index 84f6001b9..508b4c146 100644 --- a/numcosmo/math/ncm_spline_func.h +++ b/numcosmo/math/ncm_spline_func.h @@ -39,18 +39,18 @@ G_BEGIN_DECLS /** * NcmSplineFuncType: - * @NCM_SPLINE_FUNCTION_4POINTS: FIXME - * @NCM_SPLINE_FUNCTION_SPLINE: The knots are evenly distributed on a linear base at each step. The test points are place at $\overline{\mathbf{x}} = \frac{\mathbf{x}^{i+1} + \mathbf{x}^{i}}{2}$. + * @NCM_SPLINE_FUNCTION_4POINTS: FIXME + * @NCM_SPLINE_FUNCTION_SPLINE: The knots are evenly distributed on a linear base at each step. The test points are place at $\overline{\mathbf{x}} = \frac{\mathbf{x}^{i+1} + \mathbf{x}^{i}}{2}$. * @NCM_SPLINE_FUNCTION_SPLINE_LNKNOT: The knots are evenly distributed on a logarithm base at each step. The test points are place at $\overline{\mathbf{x}} = \mathrm{exp}\left( \frac{\ln \mathbf{x}^{i+1} + \ln \mathbf{x}^{i}}{2} \right)$. This method is only applied for positive intervals and is indicated for functions that changes orders of magnitude across the interval. * @NCM_SPLINE_FUNCTION_SPLINE_SINHKNOT: The knots are evenly distributed on a hyperbolic sine base at each step. The test points are place at $\overline{\mathbf{x}} = \sinh \left[ \frac{\sinh^{-1} \left( \mathbf{x}^{i+1} \right) + \sinh^{-1} \left( \mathbf{x}^{i} \right)}{2} \right]$. This method is indicated for functions that changes orders of magnitude across the interval. * @NCM_SPLINE_FUNC_GRID_LINEAR: The knots are evenly distributed on a linear base in the entire range [@xi, @xf]. - * @NCM_SPLINE_FUNC_GRID_LOG: The knots are evenly distributed on a natural logarithmic base in the entire range [@xi > 0, @xf > xi > 0]. + * @NCM_SPLINE_FUNC_GRID_LOG: The knots are evenly distributed on a natural logarithmic base in the entire range [@xi > 0, @xf > xi > 0]. * - * Enumeration to choose which of the functions to be applied when interpolating the input #gsl_function *@F, $f$, - * with the desired @rel_error in the range [@xi, @xf]. - * The interpolation knots, $\mathbf{x}$, are automatically defined internally by the functions. + * Enumeration to choose which of the functions to be applied when interpolating the input #gsl_function *@F, $f$, + * with the desired @rel_error in the range [@xi, @xf]. + * The interpolation knots, $\mathbf{x}$, are automatically defined internally by the functions. * For more details see [description][numcosmo-NcmSplineFunc.description] above. - * + * */ typedef enum _NcmSplineFuncType { diff --git a/numcosmo/math/ncm_spline_rbf.h b/numcosmo/math/ncm_spline_rbf.h index b679f131d..bb9f03b2b 100644 --- a/numcosmo/math/ncm_spline_rbf.h +++ b/numcosmo/math/ncm_spline_rbf.h @@ -42,8 +42,8 @@ G_DECLARE_FINAL_TYPE (NcmSplineRBF, ncm_spline_rbf, NCM, SPLINE_RBF, NcmSpline) /** * NcmSplineRBFType: - * @NCM_SPLINE_RBF_TYPE_POSDEF_GAUSS: Gaussian [RBF](https://en.wikipedia.org/wiki/Radial_basis_function) interpolation method for positive defined functions. - * @NCM_SPLINE_RBF_TYPE_GAUSS: Gaussian [RBF](https://en.wikipedia.org/wiki/Radial_basis_function) interpolation method for any kind of function. + * @NCM_SPLINE_RBF_TYPE_POSDEF_GAUSS: Gaussian [RBF](https://en.wikipedia.org/wiki/Radial_basis_function) interpolation method for positive defined functions. + * @NCM_SPLINE_RBF_TYPE_GAUSS: Gaussian [RBF](https://en.wikipedia.org/wiki/Radial_basis_function) interpolation method for any kind of function. * * Enumeration to choose which Gaussian [RBF](https://en.wikipedia.org/wiki/Radial_basis_function) interpolation method to be applied by the object. * diff --git a/numcosmo/math/ncm_util.h b/numcosmo/math/ncm_util.h index 15e784c3a..fafa3c9b9 100644 --- a/numcosmo/math/ncm_util.h +++ b/numcosmo/math/ncm_util.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * ncm_util.h * @@ -119,100 +120,100 @@ NCM_INLINE gdouble ncm_util_great_circle_distance (gdouble ra1, gdouble dec1, gd #define ncm_util_exp10(x) (exp ((x) * M_LN10)) -#define NCM_GARRAY_MEMCPY(dest, src) \ - G_STMT_START { \ - g_assert_cmpuint ((src)->len, ==, (dest)->len); \ - g_assert_cmpuint (g_array_get_element_size (src), ==, g_array_get_element_size (dest)); \ - memcpy ((dest)->data, (src)->data, (src)->len * g_array_get_element_size (src)); \ - } G_STMT_END - -#define NCM_GARRAY_DUP(dest, src) \ - G_STMT_START { \ - dest = g_array_sized_new (FALSE, FALSE, g_array_get_element_size (src), (src)->len); \ - g_array_set_size ((dest), (src)->len); \ - memcpy ((dest)->data, (src)->data, (src)->len * g_array_get_element_size (src)); \ - } G_STMT_END - -#define ncm_assert_cmpdouble(n1, cmp, n2) \ - do { \ - if (ncm_cmp ((n1), (n2), GSL_DBL_EPSILON, 0.0) cmp 0); else \ - _ncm_assertion_message_cmpdouble (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ - #n1 " " #cmp " " #n2, (n1), #cmp, (n2), GSL_DBL_EPSILON, 0.0); \ - } while (0) - -#define ncm_assert_cmpdouble_e(n1, cmp, n2, epsilon, abstol) \ - do { \ - if (ncm_cmp ((n1), (n2), (epsilon), (abstol)) cmp 0); else \ - _ncm_assertion_message_cmpdouble (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ - #n1 " " #cmp " " #n2, (n1), #cmp, (n2), (epsilon), (abstol)); \ - } while (0) +#define NCM_GARRAY_MEMCPY(dest, src) \ + G_STMT_START { \ + g_assert_cmpuint ((src)->len, ==, (dest)->len); \ + g_assert_cmpuint (g_array_get_element_size (src), ==, g_array_get_element_size (dest)); \ + memcpy ((dest)->data, (src)->data, (src)->len * g_array_get_element_size (src)); \ + } G_STMT_END + +#define NCM_GARRAY_DUP(dest, src) \ + G_STMT_START { \ + dest = g_array_sized_new (FALSE, FALSE, g_array_get_element_size (src), (src)->len); \ + g_array_set_size ((dest), (src)->len); \ + memcpy ((dest)->data, (src)->data, (src)->len * g_array_get_element_size (src)); \ + } G_STMT_END + +#define ncm_assert_cmpdouble(n1, cmp, n2) \ + do { \ + if (ncm_cmp ((n1), (n2), GSL_DBL_EPSILON, 0.0) cmp 0); else \ + _ncm_assertion_message_cmpdouble (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + #n1 " " #cmp " " #n2, (n1), #cmp, (n2), GSL_DBL_EPSILON, 0.0); \ + } while (0) + +#define ncm_assert_cmpdouble_e(n1, cmp, n2, epsilon, abstol) \ + do { \ + if (ncm_cmp ((n1), (n2), (epsilon), (abstol)) cmp 0); else \ + _ncm_assertion_message_cmpdouble (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ + #n1 " " #cmp " " #n2, (n1), #cmp, (n2), (epsilon), (abstol)); \ + } while (0) #define NCM_TEST_GSL_RESULT(func, ret) \ - if (ret != GSL_SUCCESS) g_error ("%s: %s", func, gsl_strerror (ret)) + if (ret != GSL_SUCCESS) g_error ("%s: %s", func, gsl_strerror (ret)) #define NCM_COMPLEX_ZERO \ - { \ - {0.0, 0.0} \ - } + { \ + {0.0, 0.0} \ + } #define NCM_COMPLEX(p) ((NcmComplex *) (p)) #define NCM_COMPLEX_PTR(p) ((NcmComplex **) (p)) -#define ncm_g_string_clear(s) \ - G_STMT_START \ - if (*(s) != NULL) \ - { \ - g_string_free (*(s), TRUE); *(s) = NULL; \ - } \ - G_STMT_END +#define ncm_g_string_clear(s) \ + G_STMT_START \ + if (*(s) != NULL) \ + { \ + g_string_free (*(s), TRUE); *(s) = NULL; \ + } \ + G_STMT_END #define NCM_UNUSED(x) (void) (x) void _ncm_util_set_destroyed (gpointer b); -#define NCM_TEST_FREE(cmd, obj) \ - G_STMT_START { \ - gboolean destroyed = FALSE; \ - g_object_set_data_full (G_OBJECT (obj), "test-destroy", &destroyed, _ncm_util_set_destroyed); \ - cmd (obj); \ - g_assert (destroyed); \ - } G_STMT_END - -#define NCM_TEST_FAIL(cmd) \ - G_STMT_START { \ - if (g_test_subprocess ()) \ - { \ - cmd; \ - exit (0); \ - } \ - else \ - { \ - g_test_trap_subprocess (NULL, 0, 0); \ - g_test_trap_assert_failed (); \ - } \ - } G_STMT_END - -#define NCM_TEST_PASS(cmd) \ - G_STMT_START { \ - if (g_test_subprocess ()) \ - { \ - cmd; \ - exit (0); \ - } \ - else \ - { \ - g_test_trap_subprocess (NULL, 0, 0); \ - g_test_trap_assert_passed (); \ - } \ - } G_STMT_END - - -#define NCM_CVODE_CHECK(chk, name, val, ret) \ - G_STMT_START { \ - if (!ncm_util_cvode_check_flag (chk, name, val)) \ - return ret; \ - } \ - G_STMT_END +#define NCM_TEST_FREE(cmd, obj) \ + G_STMT_START { \ + gboolean destroyed = FALSE; \ + g_object_set_data_full (G_OBJECT (obj), "test-destroy", &destroyed, _ncm_util_set_destroyed); \ + cmd (obj); \ + g_assert (destroyed); \ + } G_STMT_END + +#define NCM_TEST_FAIL(cmd) \ + G_STMT_START { \ + if (g_test_subprocess ()) \ + { \ + cmd; \ + exit (0); \ + } \ + else \ + { \ + g_test_trap_subprocess (NULL, 0, 0); \ + g_test_trap_assert_failed (); \ + } \ + } G_STMT_END + +#define NCM_TEST_PASS(cmd) \ + G_STMT_START { \ + if (g_test_subprocess ()) \ + { \ + cmd; \ + exit (0); \ + } \ + else \ + { \ + g_test_trap_subprocess (NULL, 0, 0); \ + g_test_trap_assert_passed (); \ + } \ + } G_STMT_END + + +#define NCM_CVODE_CHECK(chk, name, val, ret) \ + G_STMT_START { \ + if (!ncm_util_cvode_check_flag (chk, name, val)) \ + return ret; \ + } \ + G_STMT_END G_END_DECLS #endif /* _NCM_UTIL_H_ */ diff --git a/numcosmo/model/nc_hicosmo_de.c b/numcosmo/model/nc_hicosmo_de.c index 47264acf4..8af880d6e 100644 --- a/numcosmo/model/nc_hicosmo_de.c +++ b/numcosmo/model/nc_hicosmo_de.c @@ -1032,16 +1032,16 @@ _nc_hicosmo_de_w_de (NcHICosmoDE *cosmo_de, gdouble z) return 0.0; } -#define NC_HICOSMO_DE_SET_IMPL_FUNC(name) \ - void \ +#define NC_HICOSMO_DE_SET_IMPL_FUNC(name) \ + void \ nc_hicosmo_de_set_ ## name ## _impl (NcHICosmoDEClass * cosmo_de_class, NcmFuncF f, NcmFuncPF pf, NcmFuncDF df) \ - { \ - ncm_model_class_add_impl_opts (NCM_MODEL_CLASS (cosmo_de_class), NC_HICOSMO_DE_IMPL_ ## name, -1); \ - g_assert (f != NULL); \ - cosmo_de_class->name = *ncm_func_stub; \ - cosmo_de_class->name.f = f; \ - cosmo_de_class->name.pf = pf; \ - cosmo_de_class->name.df = df; \ + { \ + ncm_model_class_add_impl_opts (NCM_MODEL_CLASS (cosmo_de_class), NC_HICOSMO_DE_IMPL_ ## name, -1); \ + g_assert (f != NULL); \ + cosmo_de_class->name = *ncm_func_stub; \ + cosmo_de_class->name.f = f; \ + cosmo_de_class->name.pf = pf; \ + cosmo_de_class->name.df = df; \ } /** diff --git a/numcosmo/model/nc_hicosmo_de.h b/numcosmo/model/nc_hicosmo_de.h index 062f3c4db..52359f5f8 100644 --- a/numcosmo/model/nc_hicosmo_de.h +++ b/numcosmo/model/nc_hicosmo_de.h @@ -49,7 +49,7 @@ typedef struct _NcHICosmoDEPrivate NcHICosmoDEPrivate; /** * NcHICosmoDEImpl: * @NC_HICOSMO_DE_IMPL_E2Omega_de: dark energy (DE) component of the normalized Hubble function (squared) $E^2(z)$ - * @NC_HICOSMO_DE_IMPL_dE2Omega_de_dz: DE component of the first derivative of $E^2(z)$ with respect to the redshift $z$ + * @NC_HICOSMO_DE_IMPL_dE2Omega_de_dz: DE component of the first derivative of $E^2(z)$ with respect to the redshift $z$ * @NC_HICOSMO_DE_IMPL_d2E2Omega_de_dz2: DE component of the second derivative of $E^2(z)$ with respect to $z$ * @NC_HICOSMO_DE_IMPL_w_de: DE equation of state * @@ -61,7 +61,7 @@ typedef enum /*< flags,underscore_name=NC_HICOSMO_DE_IMPL >*/ NC_HICOSMO_DE_IMPL_E2Omega_de = NC_HICOSMO_IMPL_LAST, NC_HICOSMO_DE_IMPL_dE2Omega_de_dz, NC_HICOSMO_DE_IMPL_d2E2Omega_de_dz2, - NC_HICOSMO_DE_IMPL_w_de, + NC_HICOSMO_DE_IMPL_w_de, /* < private > */ NC_HICOSMO_DE_IMPL_LAST, /*< skip >*/ } NcHICosmoDEImpl; @@ -100,7 +100,7 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_SPARAMS >*/ * @NC_HICOSMO_DE_MASSNU_T: massive neutrino temperatures * @NC_HICOSMO_DE_MASSNU_MU: massive neutrino chemical potentials * @NC_HICOSMO_DE_MASSNU_G: massive neutrino degeneracy factors - * + * * FIXME * */ @@ -109,7 +109,7 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_VPARAMS >*/ NC_HICOSMO_DE_MASSNU_M = 0, NC_HICOSMO_DE_MASSNU_T, NC_HICOSMO_DE_MASSNU_MU, - NC_HICOSMO_DE_MASSNU_G, + NC_HICOSMO_DE_MASSNU_G, /* < private > */ NC_HICOSMO_DE_VPARAM_LEN, /*< skip >*/ } NcHICosmoDEVParams; @@ -171,11 +171,10 @@ G_END_DECLS #ifndef __GTK_DOC_IGNORE__ G_BEGIN_DECLS - -NCM_MODEL_FUNC1_IMPL (NC_HICOSMO_DE,NcHICosmoDE,nc_hicosmo_de,E2Omega_de,z) -NCM_MODEL_FUNC1_IMPL (NC_HICOSMO_DE,NcHICosmoDE,nc_hicosmo_de,dE2Omega_de_dz,z) -NCM_MODEL_FUNC1_IMPL (NC_HICOSMO_DE,NcHICosmoDE,nc_hicosmo_de,d2E2Omega_de_dz2,z) -NCM_MODEL_FUNC1_IMPL (NC_HICOSMO_DE,NcHICosmoDE,nc_hicosmo_de,w_de,z) +NCM_MODEL_FUNC1_IMPL (NC_HICOSMO_DE, NcHICosmoDE, nc_hicosmo_de, E2Omega_de, z) +NCM_MODEL_FUNC1_IMPL (NC_HICOSMO_DE, NcHICosmoDE, nc_hicosmo_de, dE2Omega_de_dz, z) +NCM_MODEL_FUNC1_IMPL (NC_HICOSMO_DE, NcHICosmoDE, nc_hicosmo_de, d2E2Omega_de_dz2, z) +NCM_MODEL_FUNC1_IMPL (NC_HICOSMO_DE, NcHICosmoDE, nc_hicosmo_de, w_de, z) NCM_INLINE gdouble nc_hicosmo_de_E2Omega_de_onepw (NcHICosmoDE *cosmo_de, gdouble z) @@ -188,3 +187,4 @@ G_END_DECLS #endif /* __GTK_DOC_IGNORE__ */ #endif /* NUMCOSMO_HAVE_INLINE */ #endif /* _NC_HICOSMO_DE_INLINE_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_de_jbp.h b/numcosmo/model/nc_hicosmo_de_jbp.h index f1b3b3558..46b82232e 100644 --- a/numcosmo/model/nc_hicosmo_de_jbp.h +++ b/numcosmo/model/nc_hicosmo_de_jbp.h @@ -46,19 +46,19 @@ typedef struct _NcHICosmoDEJbp NcHICosmoDEJbp; * @NC_HICOSMO_DE_JBP_W0: constant parameter * @NC_HICOSMO_DE_JBP_W1: constant parameter which multiplies the redshift term * - * Dark Energy equation of state: $w(z) = w_0 + w_1 \frac{z}{(1.0 + z)^2}$ - * + * Dark Energy equation of state: $w(z) = w_0 + w_1 \frac{z}{(1.0 + z)^2}$ + * */ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_JBP_SPARAMS >*/ { NC_HICOSMO_DE_JBP_W0 = NC_HICOSMO_DE_SPARAM_LEN, - NC_HICOSMO_DE_JBP_W1, + NC_HICOSMO_DE_JBP_W1, /* < private > */ NC_HICOSMO_DE_JBP_SPARAM_LEN, /*< skip >*/ } NcHICosmoDEJbpSParams; #define NC_HICOSMO_DE_JBP_DEFAULT_W0 (-1.0) -#define NC_HICOSMO_DE_JBP_DEFAULT_W1 ( 0.0) +#define NC_HICOSMO_DE_JBP_DEFAULT_W1 (0.0) #define NC_HICOSMO_DE_PM_N (NC_HICOSMO_DE_JBP_W1 + 1 - NC_HICOSMO_DE_BASE_N @@ -81,3 +81,4 @@ NcHICosmoDEJbp *nc_hicosmo_de_jbp_new (void); G_END_DECLS #endif /* _NC_HICOSMO_DE_JBP_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_de_reparam_cmb.h b/numcosmo/model/nc_hicosmo_de_reparam_cmb.h index 2b2fb8423..c1dc781da 100644 --- a/numcosmo/model/nc_hicosmo_de_reparam_cmb.h +++ b/numcosmo/model/nc_hicosmo_de_reparam_cmb.h @@ -63,3 +63,4 @@ NcHICosmoDEReparamCMB *nc_hicosmo_de_reparam_cmb_new (guint length); G_END_DECLS #endif /* _NC_HICOSMO_DE_REPARAM_CMB_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_de_reparam_ok.h b/numcosmo/model/nc_hicosmo_de_reparam_ok.h index 909172038..496cb3267 100644 --- a/numcosmo/model/nc_hicosmo_de_reparam_ok.h +++ b/numcosmo/model/nc_hicosmo_de_reparam_ok.h @@ -63,3 +63,4 @@ NcHICosmoDEReparamOk *nc_hicosmo_de_reparam_ok_new (guint length); G_END_DECLS #endif /* _NC_HICOSMO_DE_REPARAM_OK_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_de_wspline.h b/numcosmo/model/nc_hicosmo_de_wspline.h index dfe7ec2e3..889327248 100644 --- a/numcosmo/model/nc_hicosmo_de_wspline.h +++ b/numcosmo/model/nc_hicosmo_de_wspline.h @@ -85,3 +85,4 @@ NcmVector *nc_hicosmo_de_wspline_get_alpha (NcHICosmoDEWSpline *wspline); G_END_DECLS #endif /* _NC_HICOSMO_DE_WSPLINE_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_de_xcdm.h b/numcosmo/model/nc_hicosmo_de_xcdm.h index 2e53e2dad..4b7f99cca 100644 --- a/numcosmo/model/nc_hicosmo_de_xcdm.h +++ b/numcosmo/model/nc_hicosmo_de_xcdm.h @@ -8,11 +8,11 @@ /* * numcosmo * Copyright (C) Sandro Dias Pinto Vitenti 2012 - * numcosmo is free software: you can redistribute it and/or modify it + * numcosmo is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -47,13 +47,13 @@ typedef struct _NcHICosmoDEXcdm NcHICosmoDEXcdm; * @NC_HICOSMO_DE_XCDM_W: constant parameter * * Dark Energy equation of state: $w(z) = w$. - * + * */ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_XCDM_SPARAMS >*/ { - NC_HICOSMO_DE_XCDM_W = NC_HICOSMO_DE_SPARAM_LEN, + NC_HICOSMO_DE_XCDM_W = NC_HICOSMO_DE_SPARAM_LEN, /* < private > */ - NC_HICOSMO_DE_XCDM_SPARAM_LEN, /*< skip >*/ + NC_HICOSMO_DE_XCDM_SPARAM_LEN, /*< skip >*/ } NcHICosmoDEXCDMSParams; #define NC_HICOSMO_DE_XCDM_DEFAULT_W0 (-1.0) @@ -79,3 +79,4 @@ NcHICosmoDEXcdm *nc_hicosmo_de_xcdm_new (void); G_END_DECLS #endif /* _NC_HICOSMO_DE_XCDM_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_gcg.h b/numcosmo/model/nc_hicosmo_gcg.h index a86e597fe..5e1a331a1 100644 --- a/numcosmo/model/nc_hicosmo_gcg.h +++ b/numcosmo/model/nc_hicosmo_gcg.h @@ -70,8 +70,8 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_GCG_SPARAMS >*/ NC_HICOSMO_GCG_T_GAMMA0, NC_HICOSMO_GCG_HE_YP, NC_HICOSMO_GCG_ENNU, - NC_HICOSMO_GCG_OMEGA_B, - NC_HICOSMO_GCG_GAMMA, + NC_HICOSMO_GCG_OMEGA_B, + NC_HICOSMO_GCG_GAMMA, /* < private > */ NC_HICOSMO_GCG_SPARAM_LEN, /*< skip >*/ } NcHICosmoGCGSParams; @@ -82,7 +82,7 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_GCG_SPARAMS >*/ * @NC_HICOSMO_GCG_MASSNU_T: FIXME * @NC_HICOSMO_GCG_MASSNU_MU: FIXME * @NC_HICOSMO_GCG_MASSNU_G: FIXME - * + * * FIXME * */ @@ -91,7 +91,7 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_GCG_VPARAMS >*/ NC_HICOSMO_GCG_MASSNU_M = 0, NC_HICOSMO_GCG_MASSNU_T, NC_HICOSMO_GCG_MASSNU_MU, - NC_HICOSMO_GCG_MASSNU_G, + NC_HICOSMO_GCG_MASSNU_G, /* < private > */ NC_HICOSMO_GCG_VPARAM_LEN, /*< skip >*/ } NcHICosmoGCGVParams; @@ -190,3 +190,4 @@ NcHICosmoGCGReparamOk *nc_hicosmo_gcg_reparam_ok_new (guint length); G_END_DECLS #endif /* _NC_HICOSMO_GCG_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_idem2.h b/numcosmo/model/nc_hicosmo_idem2.h index 09603095b..5219ad699 100644 --- a/numcosmo/model/nc_hicosmo_idem2.h +++ b/numcosmo/model/nc_hicosmo_idem2.h @@ -70,8 +70,8 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_IDEM2_SPARAMS >*/ NC_HICOSMO_IDEM2_T_GAMMA0, NC_HICOSMO_IDEM2_HE_YP, NC_HICOSMO_IDEM2_ENNU, - NC_HICOSMO_IDEM2_OMEGA_B, - NC_HICOSMO_IDEM2_GAMMA, + NC_HICOSMO_IDEM2_OMEGA_B, + NC_HICOSMO_IDEM2_GAMMA, /* < private > */ NC_HICOSMO_IDEM2_SPARAM_LEN, /*< skip >*/ } NcHICosmoIDEM2SParams; @@ -82,7 +82,7 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_DE_IDEM2_SPARAMS >*/ * @NC_HICOSMO_IDEM2_MASSNU_T: FIXME * @NC_HICOSMO_IDEM2_MASSNU_MU: FIXME * @NC_HICOSMO_IDEM2_MASSNU_G: FIXME - * + * * FIXME * */ @@ -190,3 +190,4 @@ NcHICosmoIDEM2ReparamOk *nc_hicosmo_idem2_reparam_ok_new (guint length); G_END_DECLS #endif /* _NC_HICOSMO_IDEM2_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_lcdm.h b/numcosmo/model/nc_hicosmo_lcdm.h index 0ff5dadc8..c29f6800e 100644 --- a/numcosmo/model/nc_hicosmo_lcdm.h +++ b/numcosmo/model/nc_hicosmo_lcdm.h @@ -8,11 +8,11 @@ /* * numcosmo * Copyright (C) Sandro Dias Pinto Vitenti 2012 - * numcosmo is free software: you can redistribute it and/or modify it + * numcosmo is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -60,3 +60,4 @@ NcHICosmoLCDM *nc_hicosmo_lcdm_new (void); G_END_DECLS #endif /* _NC_HICOSMO_LCDM_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_qconst.h b/numcosmo/model/nc_hicosmo_qconst.h index 34bc80ab4..db0a99212 100644 --- a/numcosmo/model/nc_hicosmo_qconst.h +++ b/numcosmo/model/nc_hicosmo_qconst.h @@ -8,11 +8,11 @@ /* * numcosmo * Copyright (C) Sandro Dias Pinto Vitenti 2012 - * numcosmo is free software: you can redistribute it and/or modify it + * numcosmo is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -59,17 +59,17 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_QCONST_SPARAMS >*/ NC_HICOSMO_QCONST_CD, NC_HICOSMO_QCONST_E, NC_HICOSMO_QCONST_Q, - NC_HICOSMO_QCONST_Z1, + NC_HICOSMO_QCONST_Z1, /* < private > */ NC_HICOSMO_QCONST_SPARAM_LEN, /*< skip >*/ } NcHICosmoQConstSParams; #define NC_HICOSMO_QCONST_DEFAULT_H0 ncm_c_hubble_cte_planck6_base () -#define NC_HICOSMO_QCONST_DEFAULT_OMEGA_T ( 1.0) -#define NC_HICOSMO_QCONST_DEFAULT_CD ( 0.0) -#define NC_HICOSMO_QCONST_DEFAULT_E ( 1.0) +#define NC_HICOSMO_QCONST_DEFAULT_OMEGA_T (1.0) +#define NC_HICOSMO_QCONST_DEFAULT_CD (0.0) +#define NC_HICOSMO_QCONST_DEFAULT_E (1.0) #define NC_HICOSMO_QCONST_DEFAULT_Q (-0.5) -#define NC_HICOSMO_QCONST_DEFAULT_Z1 ( 0.0) +#define NC_HICOSMO_QCONST_DEFAULT_Z1 (0.0) struct _NcHICosmoQConstClass { @@ -90,3 +90,4 @@ NcHICosmoQConst *nc_hicosmo_qconst_new (void); G_END_DECLS #endif /* _NC_HICOSMO_QCONST_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_qgrw.c b/numcosmo/model/nc_hicosmo_qgrw.c index 3e597c253..0b17a25a1 100644 --- a/numcosmo/model/nc_hicosmo_qgrw.c +++ b/numcosmo/model/nc_hicosmo_qgrw.c @@ -286,52 +286,52 @@ _nc_hicosmo_qgrw_xb (NcHICosmo *cosmo) #define _d2ln(pn) (d2 ## pn / pn - d1ln ## pn * d1ln ## pn) #define _d3ln(pn) (d3 ## pn / pn - d1ln ## pn * d1ln ## pn * d1ln ## pn - 3.0 * d1ln ## pn * d2ln ## pn) -#define _NC_HICOSMO_QGRW_WKB_COMMON1 \ - const gdouble w2 = 1.0 / 3.0; \ - const gdouble alpha2 = alpha * alpha; \ - const gdouble alpha2_2 = alpha2 * 0.5; \ - const gdouble w = W; \ - const gdouble Omegar = OMEGA_R; \ - const gdouble Omegaw = OMEGA_W; \ - \ - const gdouble x = nc_hicosmo_x_alpha (cosmo, alpha); \ - const gdouble x2 = x * x; \ - const gdouble x3 = x2 * x; \ - const gdouble x3w = pow (x3, w); \ - \ - const gdouble onepw = 1.0 + w; \ - const gdouble threex1mw = 3.0 * (1.0 - w); \ - const gdouble onepw2 = 4.0 / 3.0; \ - \ - const gdouble R = Omegar * x / (Omegaw * x3w); \ +#define _NC_HICOSMO_QGRW_WKB_COMMON1 \ + const gdouble w2 = 1.0 / 3.0; \ + const gdouble alpha2 = alpha * alpha; \ + const gdouble alpha2_2 = alpha2 * 0.5; \ + const gdouble w = W; \ + const gdouble Omegar = OMEGA_R; \ + const gdouble Omegaw = OMEGA_W; \ + \ + const gdouble x = nc_hicosmo_x_alpha (cosmo, alpha); \ + const gdouble x2 = x * x; \ + const gdouble x3 = x2 * x; \ + const gdouble x3w = pow (x3, w); \ + \ + const gdouble onepw = 1.0 + w; \ + const gdouble threex1mw = 3.0 * (1.0 - w); \ + const gdouble onepw2 = 4.0 / 3.0; \ + \ + const gdouble R = Omegar * x / (Omegaw * x3w); \ const gdouble p2f1 = 0.5 * threex1mw * ncm_exprel (-threex1mw * alpha2_2); \ - const gdouble p2f2 = R * ncm_exprel (-2.0 * alpha2_2); \ - const gdouble p2 = p2f1 + p2f2; \ + const gdouble p2f2 = R * ncm_exprel (-2.0 * alpha2_2); \ + const gdouble p2 = p2f1 + p2f2; \ const gdouble p4 = onepw + onepw2 * R; -#define _NC_HICOSMO_QGRW_WKB_COMMON2 \ - const gdouble onem3w = 1.0 - 3.0 * w; \ - \ - const gdouble d1R = onem3w * R; \ - \ - const gdouble d1p2f1 = 0.5 * gsl_pow_2 (threex1mw) * ncm_d1exprel (-threex1mw * alpha2_2); \ +#define _NC_HICOSMO_QGRW_WKB_COMMON2 \ + const gdouble onem3w = 1.0 - 3.0 * w; \ + \ + const gdouble d1R = onem3w * R; \ + \ + const gdouble d1p2f1 = 0.5 * gsl_pow_2 (threex1mw) * ncm_d1exprel (-threex1mw * alpha2_2); \ const gdouble d1p2f2 = 2.0 * R * ncm_d1exprel (-2.0 * alpha2_2) + d1R * ncm_exprel (-2.0 * alpha2_2); \ - const gdouble d1p2 = d1p2f1 + d1p2f2; \ - const gdouble d1p4 = onepw2 * d1R; \ - \ - const gdouble d1lnp2 = _d1ln (p2); \ + const gdouble d1p2 = d1p2f1 + d1p2f2; \ + const gdouble d1p4 = onepw2 * d1R; \ + \ + const gdouble d1lnp2 = _d1ln (p2); \ const gdouble d1lnp4 = _d1ln (p4); #define _NC_HICOSMO_QGRW_WKB_COMMON22 \ const gdouble d2R = onem3w * d1R; -#define _NC_HICOSMO_QGRW_WKB_COMMON222 \ - const gdouble d2p2f1 = 0.5 * gsl_pow_3 (threex1mw) * ncm_d2exprel (-threex1mw * alpha2_2); \ +#define _NC_HICOSMO_QGRW_WKB_COMMON222 \ + const gdouble d2p2f1 = 0.5 * gsl_pow_3 (threex1mw) * ncm_d2exprel (-threex1mw * alpha2_2); \ const gdouble d2p2f2 = 4.0 * R * ncm_d2exprel (-2.0 * alpha2_2) + 4.0 * d1R * ncm_d1exprel (-2.0 * alpha2_2) + d2R * ncm_exprel (-2.0 * alpha2_2); \ - const gdouble d2p2 = d2p2f1 + d2p2f2; \ + const gdouble d2p2 = d2p2f1 + d2p2f2; \ const gdouble d2lnp2 = _d2ln (p2); -#define _NC_HICOSMO_QGRW_WKB_COMMON2222 \ +#define _NC_HICOSMO_QGRW_WKB_COMMON2222 \ const gdouble d2p4 = onepw2 * d2R; \ const gdouble d2lnp4 = _d2ln (p4); @@ -342,22 +342,22 @@ _nc_hicosmo_qgrw_xb (NcHICosmo *cosmo) const gdouble p5 = sqrt (x3 / (x3w * Omegaw)) / 3.0; #define _NC_HICOSMO_QGRW_WKB_COMMON4 \ - const gdouble k2 = k * k; \ + const gdouble k2 = k * k; \ const gdouble p0 = k2 / (Omegaw * x * x3w); #define _NC_HICOSMO_QGRW_WKB_COMMON44 \ const gdouble p3 = w2 * onepw + w * onepw2 * R; -#define _NC_HICOSMO_QGRW_WKB_COMMON5 \ +#define _NC_HICOSMO_QGRW_WKB_COMMON5 \ const gdouble onep3w = 1.0 + 3.0 * w; \ - const gdouble d1p0 = -onep3w * p0; \ + const gdouble d1p0 = -onep3w * p0; \ const gdouble d1lnp0 = _d1ln (p0); -#define _NC_HICOSMO_QGRW_WKB_COMMON51 \ +#define _NC_HICOSMO_QGRW_WKB_COMMON51 \ const gdouble d1p1 = w2 * onepw2 * d1R; \ const gdouble d1lnp1 = _d1ln (p1); -#define _NC_HICOSMO_QGRW_WKB_COMMON53 \ +#define _NC_HICOSMO_QGRW_WKB_COMMON53 \ const gdouble d1p3 = w * onepw2 * d1R; \ const gdouble d1lnp3 = _d1ln (p3); @@ -367,7 +367,7 @@ _nc_hicosmo_qgrw_xb (NcHICosmo *cosmo) #define _NC_HICOSMO_QGRW_WKB_D1LNSQRTNUZETA \ const gdouble d1lnsqrtnuzeta = 0.25 * (d1lnp0 + d1lnp1 - d1lnp2 - d1lnp4); -#define _NC_HICOSMO_QGRW_WKB_COMMON56 \ +#define _NC_HICOSMO_QGRW_WKB_COMMON56 \ const gdouble onep3w_2 = onep3w * 0.5; \ const gdouble d1lnp6 = onep3w_2; @@ -377,28 +377,28 @@ _nc_hicosmo_qgrw_xb (NcHICosmo *cosmo) #define _NC_HICOSMO_QGRW_WKB_COMMON555 \ const gdouble d2lnp0 = 0.0; -#define _NC_HICOSMO_QGRW_WKB_COMMON5555 \ +#define _NC_HICOSMO_QGRW_WKB_COMMON5555 \ const gdouble d2lnp3 = _d2ln (p3); \ const gdouble d2lnp6 = 0.0; #define _NC_HICOSMO_QGRW_WKB_NUZETA2 \ const gdouble nuzeta2 = p0 * p1 / (p2 * p4); -#define _NC_HICOSMO_QGRW_WKB_D1LNP5 \ - const gdouble threex1mw_2 = threex1mw * 0.5; \ +#define _NC_HICOSMO_QGRW_WKB_D1LNP5 \ + const gdouble threex1mw_2 = threex1mw * 0.5; \ const gdouble d1p5 = threex1mw_2 * p5; \ const gdouble d1lnp5 = _d1ln (p5); #define _NC_HICOSMO_QGRW_WKB_DLNSQRTMZETANUZETA \ - _NC_HICOSMO_QGRW_WKB_D1LNP5; \ + _NC_HICOSMO_QGRW_WKB_D1LNP5; \ const gdouble d1lnsqrtmzetanuzeta = 0.75 * d1lnp4 + 0.25 * d1lnp0 - 0.25 * d1lnp1 - 0.5 * d1lnp2 - 0.5 * d1lnp5 + 1.0 / alpha2; -#define _NC_HICOSMO_QGRW_WKB_VZETA \ - const gdouble d2p1 = w2 * onepw2 * d2R; \ - const gdouble d2lnp1 = _d2ln (p1); \ - const gdouble d2lnp5 = 0.0; \ +#define _NC_HICOSMO_QGRW_WKB_VZETA \ + const gdouble d2p1 = w2 * onepw2 * d2R; \ + const gdouble d2lnp1 = _d2ln (p1); \ + const gdouble d2lnp5 = 0.0; \ const gdouble d2lnsqrtmzetanuzeta = 0.75 * d2lnp4 + 0.25 * d2lnp0 - 0.25 * d2lnp1 - 0.5 * d2lnp2 - 0.5 * d2lnp5 + 2.0 / (alpha2 * alpha2); \ - const gdouble d2sqrtmzetanuzeta_sqrtmzetanuzeta = d1lnsqrtmzetanuzeta * d1lnsqrtmzetanuzeta + d2lnsqrtmzetanuzeta; \ + const gdouble d2sqrtmzetanuzeta_sqrtmzetanuzeta = d1lnsqrtmzetanuzeta * d1lnsqrtmzetanuzeta + d2lnsqrtmzetanuzeta; \ const gdouble Vzeta = (alpha2 * d2sqrtmzetanuzeta_sqrtmzetanuzeta - d1lnsqrtmzetanuzeta) - 2.0 * alpha2 * d1lnsqrtmzetanuzeta * d1lnsqrtnuzeta; #define _NC_HICOSMO_QGRW_WKB_NUA2 \ @@ -413,9 +413,9 @@ _nc_hicosmo_qgrw_xb (NcHICosmo *cosmo) #define _NC_HICOSMO_QGRW_WKB_DLNSQRTMSNUS \ const gdouble d1lnsqrtmSnuS = (0.25 * d1lnp0 + 0.5 * d1lnp6) * 0.0 + 0.75 * d1lnp4 - 0.25 * d1lnp3; -#define _NC_HICOSMO_QGRW_WKB_VS \ +#define _NC_HICOSMO_QGRW_WKB_VS \ const gdouble d2lnsqrtmSnuS = 0.25 * d2lnp0 + 0.75 * d2lnp4 + 0.5 * d2lnp6 - 0.25 * d2lnp3; \ - const gdouble d2sqrtmSnuS_sqrtmSnuS = d1lnsqrtmSnuS * d1lnsqrtmSnuS + d2lnsqrtmSnuS; \ + const gdouble d2sqrtmSnuS_sqrtmSnuS = d1lnsqrtmSnuS * d1lnsqrtmSnuS + d2lnsqrtmSnuS; \ const gdouble VS = (alpha2 * d2sqrtmSnuS_sqrtmSnuS - d1lnsqrtmSnuS) - 2.0 * alpha2 * d1lnsqrtmSnuS * d1lnsqrtnuS; #define _NC_HICOSMO_QGRW_WKB_NUB2 \ @@ -424,21 +424,21 @@ _nc_hicosmo_qgrw_xb (NcHICosmo *cosmo) #define _NC_HICOSMO_QGRW_WKB_P6 \ const gdouble p6 = sqrt (x3 / (x3w * Omegaw)) / (3.0 * onepw * onepw2 * R); -#define _NC_HICOSMO_QGRW_WKB_MS \ +#define _NC_HICOSMO_QGRW_WKB_MS \ _NC_HICOSMO_QGRW_WKB_P6; \ const gdouble mS = sqrt (p2) * p4 * p4 * p6 / p3; #define _NC_HICOSMO_QGRW_ONE_M_Y2 \ const gdouble one_m_y2 = w * w2 * gsl_pow_2 (onepw + onepw2 * R) / (p1 * p3); -#define _NC_HICOSMO_QGRW_ODE_FULL_DIFF \ - /*const gdouble d1lnp1mp3 = -onepw2 * d1R / (onepw - onepw2 * R);*/ \ - const gdouble dlnmzetanuzeta2 = -2.0 / alpha - alpha * (d1lnp0 - 1.5 * d1lnp2 - d1lnp5); \ - const gdouble dlnmSnuS2 = -alpha * (d1lnp0 - 0.5 * d1lnp2 + d1lnp4 + d1lnp6); \ +#define _NC_HICOSMO_QGRW_ODE_FULL_DIFF \ + /*const gdouble d1lnp1mp3 = -onepw2 * d1R / (onepw - onepw2 * R);*/ \ + const gdouble dlnmzetanuzeta2 = -2.0 / alpha - alpha * (d1lnp0 - 1.5 * d1lnp2 - d1lnp5); \ + const gdouble dlnmSnuS2 = -alpha * (d1lnp0 - 0.5 * d1lnp2 + d1lnp4 + d1lnp6); \ const gdouble dlnmzetanuzeta2_mSnuS2 = -2.0 / alpha + alpha * (d1lnp2 + d1lnp4 + d1lnp5 + d1lnp6); \ - const gdouble dlnlambda_s2_lambda_zeta2 = -alpha * d1R / R; \ - /*const gdouble dlnnu_plus2 = - alpha * (d1lnp0 - d1lnp2);*/ \ - const gdouble dlnnu_minus2 = -alpha * (d1lnp0 - d1lnp2); \ + const gdouble dlnlambda_s2_lambda_zeta2 = -alpha * d1R / R; \ + /*const gdouble dlnnu_plus2 = - alpha * (d1lnp0 - d1lnp2);*/ \ + const gdouble dlnnu_minus2 = -alpha * (d1lnp0 - d1lnp2); \ const gdouble dlnmSnuS2_dlnnu_plus = -alpha * (d1lnp4 + 0.0 * (0.5 * d1lnp0 + d1lnp6)); /**************************************************************************** diff --git a/numcosmo/model/nc_hicosmo_qgrw.h b/numcosmo/model/nc_hicosmo_qgrw.h index b8eaf6daa..9ba7ce9e8 100644 --- a/numcosmo/model/nc_hicosmo_qgrw.h +++ b/numcosmo/model/nc_hicosmo_qgrw.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -54,50 +54,50 @@ typedef struct _NcHICosmoQGRW NcHICosmoQGRW; * @NC_HICOSMO_QGRW_X_B: Redshift at the bounce. * * Parameter of the Quantum Gravity Radiation W model. - * + * */ typedef enum /*< enum,underscore_name=NC_HICOSMO_QGRW_SPARAMS >*/ { NC_HICOSMO_QGRW_H0 = 0, NC_HICOSMO_QGRW_OMEGA_R, NC_HICOSMO_QGRW_OMEGA_W, - NC_HICOSMO_QGRW_W, - NC_HICOSMO_QGRW_X_B, + NC_HICOSMO_QGRW_W, + NC_HICOSMO_QGRW_X_B, /* < private > */ NC_HICOSMO_QGRW_SPARAM_LEN, /*< skip >*/ } NcHICosmoQGRWSParams; /** * NC_HICOSMO_QGRW_DEFAULT_H0: (value 73.0) - * + * * Default value for $H_0$. - */ + */ #define NC_HICOSMO_QGRW_DEFAULT_H0 ncm_c_hubble_cte_planck6_base () /** * NC_HICOSMO_QGRW_DEFAULT_OMEGA_R: (value 1.0e-5) - * + * * Default $\Omega_{r0}$. */ #define NC_HICOSMO_QGRW_DEFAULT_OMEGA_R (1.0e-5) /** * NC_HICOSMO_QGRW_DEFAULT_OMEGA_W: (value 0.99999) - * + * * Default $\Omega_{w0}$. */ #define NC_HICOSMO_QGRW_DEFAULT_OMEGA_W (1.0 - NC_HICOSMO_QGRW_DEFAULT_OMEGA_R) /** * NC_HICOSMO_QGRW_DEFAULT_W: (value 1.0e-12) - * + * * Default $w$. */ #define NC_HICOSMO_QGRW_DEFAULT_W (1.0e-12) /** * NC_HICOSMO_QGRW_DEFAULT_OMEGA_X_B: (value 1.0e30) - * + * * Default $x_b$. */ #define NC_HICOSMO_QGRW_DEFAULT_X_B (1.0e30) @@ -124,3 +124,4 @@ NcHICosmoQGRW *nc_hicosmo_qgrw_new (void); G_END_DECLS #endif /* _NC_HICOSMO_QGRW_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_qlinear.h b/numcosmo/model/nc_hicosmo_qlinear.h index d72364678..cd6c085a9 100644 --- a/numcosmo/model/nc_hicosmo_qlinear.h +++ b/numcosmo/model/nc_hicosmo_qlinear.h @@ -60,18 +60,18 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_QLINEAR_SPARAMS >*/ NC_HICOSMO_QLINEAR_E, NC_HICOSMO_QLINEAR_Q, NC_HICOSMO_QLINEAR_QP, - NC_HICOSMO_QLINEAR_Z1, + NC_HICOSMO_QLINEAR_Z1, /* < private > */ NC_HICOSMO_QLINEAR_SPARAM_LEN, /*< skip >*/ } NcHICosmoQLinearSParams; #define NC_HICOSMO_QLINEAR_DEFAULT_H0 ncm_c_hubble_cte_planck6_base () -#define NC_HICOSMO_QLINEAR_DEFAULT_OMEGA_T ( 1.0) -#define NC_HICOSMO_QLINEAR_DEFAULT_CD ( 0.0) -#define NC_HICOSMO_QLINEAR_DEFAULT_E ( 1.0) +#define NC_HICOSMO_QLINEAR_DEFAULT_OMEGA_T (1.0) +#define NC_HICOSMO_QLINEAR_DEFAULT_CD (0.0) +#define NC_HICOSMO_QLINEAR_DEFAULT_E (1.0) #define NC_HICOSMO_QLINEAR_DEFAULT_Q (-0.5) -#define NC_HICOSMO_QLINEAR_DEFAULT_QP ( 1.0) -#define NC_HICOSMO_QLINEAR_DEFAULT_Z1 ( 0.0) +#define NC_HICOSMO_QLINEAR_DEFAULT_QP (1.0) +#define NC_HICOSMO_QLINEAR_DEFAULT_Z1 (0.0) struct _NcHICosmoQLinearClass { @@ -93,3 +93,4 @@ gdouble nc_hicosmo_qlinear_dE (gdouble z2, gdouble z1, gdouble q, gdouble qp); G_END_DECLS #endif /* _NC_HICOSMO_QLINEAR_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_qrbf.h b/numcosmo/model/nc_hicosmo_qrbf.h index 4122f1b74..735c50afd 100644 --- a/numcosmo/model/nc_hicosmo_qrbf.h +++ b/numcosmo/model/nc_hicosmo_qrbf.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * nc_hicosmo_qrbf.h * @@ -58,13 +59,13 @@ typedef struct _NcHICosmoQRBFPrivate NcHICosmoQRBFPrivate; * @NC_HICOSMO_QRBF_H0: Hubble constant * @NC_HICOSMO_QRBF_OMEGA_T: Total energy density of the universe * @NC_HICOSMO_QRBF_AS_DRAG: FIXME - * @NC_HICOSMO_QRBF_RBF_H: the rbf wave-length + * @NC_HICOSMO_QRBF_RBF_H: the rbf wave-length * */ typedef enum /*< enum,underscore_name=NC_HICOSMO_QRBF_SPARAMS >*/ { NC_HICOSMO_QRBF_H0 = 0, - NC_HICOSMO_QRBF_OMEGA_T, + NC_HICOSMO_QRBF_OMEGA_T, NC_HICOSMO_QRBF_AS_DRAG, NC_HICOSMO_QRBF_RBF_H, /* < private > */ @@ -86,13 +87,13 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_QRBF_VPARAMS >*/ } NcHICosmoQRBFVParams; #define NC_HICOSMO_QRBF_DEFAULT_H0 (73.0) -#define NC_HICOSMO_QRBF_DEFAULT_OMEGA_T ( 1.0) -#define NC_HICOSMO_QRBF_DEFAULT_AS_DRAG ( 0.035) -#define NC_HICOSMO_QRBF_DEFAULT_RBF_H ( 0.5) -#define NC_HICOSMO_QRBF_DEFAULT_RBF_CENTERS ( 1.0) -#define NC_HICOSMO_QRBF_DEFAULT_RBF_CENTERS_LEN ( 3 ) +#define NC_HICOSMO_QRBF_DEFAULT_OMEGA_T (1.0) +#define NC_HICOSMO_QRBF_DEFAULT_AS_DRAG (0.035) +#define NC_HICOSMO_QRBF_DEFAULT_RBF_H (0.5) +#define NC_HICOSMO_QRBF_DEFAULT_RBF_CENTERS (1.0) +#define NC_HICOSMO_QRBF_DEFAULT_RBF_CENTERS_LEN (3) #define NC_HICOSMO_QRBF_DEFAULT_RBF_COEFFS (+0.5) -#define NC_HICOSMO_QRBF_DEFAULT_RBF_COEFFS_LEN ( 3 ) +#define NC_HICOSMO_QRBF_DEFAULT_RBF_COEFFS_LEN (3) struct _NcHICosmoQRBFClass { @@ -147,3 +148,4 @@ NcHICosmoQRBFRprior *nc_hicosmo_qrbf_rprior_new (gdouble lambda); G_END_DECLS #endif /* _NC_HICOSMO_QRBF_H_ */ + diff --git a/numcosmo/model/nc_hicosmo_qspline.h b/numcosmo/model/nc_hicosmo_qspline.h index 39983454b..530ac27bb 100644 --- a/numcosmo/model/nc_hicosmo_qspline.h +++ b/numcosmo/model/nc_hicosmo_qspline.h @@ -60,8 +60,8 @@ typedef struct _NcHICosmoQSplineContPrior NcHICosmoQSplineContPrior; typedef enum /*< enum,underscore_name=NC_HICOSMO_QSPLINE_SPARAMS >*/ { NC_HICOSMO_QSPLINE_H0 = 0, - NC_HICOSMO_QSPLINE_OMEGA_T, - NC_HICOSMO_QSPLINE_AS_DRAG, + NC_HICOSMO_QSPLINE_OMEGA_T, + NC_HICOSMO_QSPLINE_AS_DRAG, /* < private > */ NC_HICOSMO_QSPLINE_SPARAM_LEN, /*< skip >*/ } NcHICosmoQSplineSParams; @@ -73,14 +73,14 @@ typedef enum /*< enum,underscore_name=NC_HICOSMO_QSPLINE_SPARAMS >*/ */ typedef enum /*< enum,underscore_name=NC_HICOSMO_QSPLINE_VPARAMS >*/ { - NC_HICOSMO_QSPLINE_Q, + NC_HICOSMO_QSPLINE_Q, /* < private > */ NC_HICOSMO_QSPLINE_VPARAM_LEN, /*< skip >*/ } NcHICosmoQSplineVParams; #define NC_HICOSMO_QSPLINE_DEFAULT_H0 ncm_c_hubble_cte_planck6_base () -#define NC_HICOSMO_QSPLINE_DEFAULT_OMEGA_T ( 1.0) -#define NC_HICOSMO_QSPLINE_DEFAULT_AS_DRAG ( 0.035) +#define NC_HICOSMO_QSPLINE_DEFAULT_OMEGA_T (1.0) +#define NC_HICOSMO_QSPLINE_DEFAULT_AS_DRAG (0.035) #define NC_HICOSMO_QSPLINE_DEFAULT_Q (-0.5) #define NC_HICOSMO_QSPLINE_DEFAULT_Q_LEN (3) @@ -176,3 +176,4 @@ NcPriorQSplineCont *nc_prior_qspline_cont_new (void); G_END_DECLS #endif /* _NC_HICOSMO_QSPLINE_H_ */ + diff --git a/numcosmo/model/nc_hiprim_atan.h b/numcosmo/model/nc_hiprim_atan.h index 82e3f53f9..abb7b4fdf 100644 --- a/numcosmo/model/nc_hiprim_atan.h +++ b/numcosmo/model/nc_hiprim_atan.h @@ -57,14 +57,14 @@ typedef struct _NcHIPrimAtan NcHIPrimAtan; * * Primordial adiabatic scalar power spectrum: * $$ \mathcal{P}_{SA}(k) = \xi_\mathrm{neq}(k)\mathcal{P}_{\mathrm{F}}(k),$$ - * where + * where * $$ \mathcal{P}_{\mathrm{F}}(k) \equiv \mathcal{A}_\mathrm{s}\left(\frac{k}{k_\star}\right)^{n_s -1 } $$ - * and + * and * $$ \xi_\mathrm{neq}(k) = \arctan \left[ \left(\frac{k}{k_\mathrm{c}}\right)^\lambda + c_2\right] - \frac{\pi}{2} + c_3. $$ - * + * * Primordial tensor power spectrum: * $$ \mathcal{P}_T(k) = r \mathcal{A}_\mathrm{s} \left(\frac{k}{k_\star}\right)^{n_T -1 }.$$ - * + * */ typedef enum /*< enum,underscore_name=NC_HIPRIM_ATAN_SPARAMS >*/ { @@ -73,7 +73,7 @@ typedef enum /*< enum,underscore_name=NC_HIPRIM_ATAN_SPARAMS >*/ NC_HIPRIM_ATAN_LNKC, NC_HIPRIM_ATAN_C2, NC_HIPRIM_ATAN_C3, - NC_HIPRIM_ATAN_LAMBDA, + NC_HIPRIM_ATAN_LAMBDA, NC_HIPRIM_ATAN_T_SA_RATIO, NC_HIPRIM_ATAN_N_T, /* < private > */ @@ -108,3 +108,4 @@ NcHIPrimAtan *nc_hiprim_atan_new (void); G_END_DECLS #endif /* _NC_HIPRIM_ATAN_H_ */ + diff --git a/numcosmo/model/nc_hiprim_bpl.h b/numcosmo/model/nc_hiprim_bpl.h index 5401490e0..5677e1866 100644 --- a/numcosmo/model/nc_hiprim_bpl.h +++ b/numcosmo/model/nc_hiprim_bpl.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -52,18 +52,18 @@ typedef struct _NcHIPrimBPL NcHIPrimBPL; * @NC_HIPRIM_BPL_LNKB: Exp parameter $\ln(k_b)$ * @NC_HIPRIM_BPL_T_SA_RATIO: Tensor-to-scalar ratio * @NC_HIPRIM_BPL_N_T: Tensor spectral index - * + * * FIXME - * + * */ typedef enum /*< enum,underscore_name=NC_HIPRIM_BPL_SPARAMS >*/ { NC_HIPRIM_BPL_LN10E10ASA, NC_HIPRIM_BPL_N_SA, NC_HIPRIM_BPL_DELTA, - NC_HIPRIM_BPL_LNKB, + NC_HIPRIM_BPL_LNKB, NC_HIPRIM_BPL_T_SA_RATIO, - NC_HIPRIM_BPL_N_T, + NC_HIPRIM_BPL_N_T, /* < private > */ NC_HIPRIM_BPL_SPARAM_LEN, /*< skip >*/ } NcHIPrimBPLSParams; @@ -94,3 +94,4 @@ NcHIPrimBPL *nc_hiprim_bpl_new (void); G_END_DECLS #endif /* _NC_HIPRIM_BPL_H_ */ + diff --git a/numcosmo/model/nc_hiprim_expc.h b/numcosmo/model/nc_hiprim_expc.h index c9a644e5b..abd2f6355 100644 --- a/numcosmo/model/nc_hiprim_expc.h +++ b/numcosmo/model/nc_hiprim_expc.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -53,9 +53,9 @@ typedef struct _NcHIPrimExpc NcHIPrimExpc; * @NC_HIPRIM_EXPC_C: Exp cut parameter $c$ * @NC_HIPRIM_EXPC_T_SA_RATIO: Tensor-to-scalar ratio * @NC_HIPRIM_EXPC_N_T: Tensor spectral index - * + * * FIXME - * + * */ typedef enum /*< enum,underscore_name=NC_HIPRIM_EXPC_SPARAMS >*/ { @@ -63,9 +63,9 @@ typedef enum /*< enum,underscore_name=NC_HIPRIM_EXPC_SPARAMS >*/ NC_HIPRIM_EXPC_N_SA, NC_HIPRIM_EXPC_LAMBDAC, NC_HIPRIM_EXPC_LNKC, - NC_HIPRIM_EXPC_C, + NC_HIPRIM_EXPC_C, NC_HIPRIM_EXPC_T_SA_RATIO, - NC_HIPRIM_EXPC_N_T, + NC_HIPRIM_EXPC_N_T, /* < private > */ NC_HIPRIM_EXPC_SPARAM_LEN, /*< skip >*/ } NcHIPrimExpcSParams; @@ -97,3 +97,4 @@ NcHIPrimExpc *nc_hiprim_expc_new (void); G_END_DECLS #endif /* _NC_HIPRIM_EXPC_H_ */ + diff --git a/numcosmo/model/nc_hiprim_power_law.h b/numcosmo/model/nc_hiprim_power_law.h index 9a62ef1db..81bcf4c62 100644 --- a/numcosmo/model/nc_hiprim_power_law.h +++ b/numcosmo/model/nc_hiprim_power_law.h @@ -53,7 +53,7 @@ typedef struct _NcHIPrimPowerLaw NcHIPrimPowerLaw; * * Primordial adiabatic scalar power spectrum: * $$ \mathcal{P}_{SA}(k) = \mathcal{A}_\mathrm{s}\left(\frac{k}{k_\star}\right)^{n_s -1 }.$$ - * + * * Primordial tensor power spectrum: * $$ \mathcal{P}_T(k) = r \mathcal{A}_\mathrm{s} \left(\frac{k}{k_\star}\right)^{n_T -1 }.$$ * @@ -63,7 +63,7 @@ typedef enum /*< enum,underscore_name=NC_HIPRIM_POWER_LAW_SPARAMS >*/ NC_HIPRIM_POWER_LAW_LN10E10ASA, NC_HIPRIM_POWER_LAW_T_SA_RATIO, NC_HIPRIM_POWER_LAW_N_SA, - NC_HIPRIM_POWER_LAW_N_T, + NC_HIPRIM_POWER_LAW_N_T, /* < private > */ NC_HIPRIM_POWER_LAW_SPARAM_LEN, /*< skip >*/ } NcHIPrimPowerLawSParams; @@ -78,7 +78,6 @@ struct _NcHIPrimPowerLaw { /*< private >*/ NcHIPrim parent_instance; - }; GType nc_hiprim_power_law_get_type (void) G_GNUC_CONST; @@ -93,3 +92,4 @@ NcHIPrimPowerLaw *nc_hiprim_power_law_new (void); G_END_DECLS #endif /* _NC_HIPRIM_POWER_LAW_H_ */ + diff --git a/numcosmo/model/nc_hiprim_sbpl.h b/numcosmo/model/nc_hiprim_sbpl.h index dbaa7bd27..b9f2b5c5f 100644 --- a/numcosmo/model/nc_hiprim_sbpl.h +++ b/numcosmo/model/nc_hiprim_sbpl.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -54,20 +54,20 @@ typedef struct _NcHIPrimSBPL NcHIPrimSBPL; * @NC_HIPRIM_SBPL_LAMBDA: Exp parameter $\lambda$ * @NC_HIPRIM_SBPL_T_SA_RATIO: Tensor-to-scalar ratio * @NC_HIPRIM_SBPL_N_T: Tensor spectral index - * + * * FIXME - * + * */ typedef enum /*< enum,underscore_name=NC_HIPRIM_SBPL_SPARAMS >*/ { NC_HIPRIM_SBPL_LN10E10ASA, NC_HIPRIM_SBPL_N_SA, NC_HIPRIM_SBPL_DELTA, - NC_HIPRIM_SBPL_RA, + NC_HIPRIM_SBPL_RA, NC_HIPRIM_SBPL_LNKB, NC_HIPRIM_SBPL_LAMBDA, NC_HIPRIM_SBPL_T_SA_RATIO, - NC_HIPRIM_SBPL_N_T, + NC_HIPRIM_SBPL_N_T, /* < private > */ NC_HIPRIM_SBPL_SPARAM_LEN, /*< skip >*/ } NcHIPrimSBPLSParams; @@ -100,3 +100,4 @@ NcHIPrimSBPL *nc_hiprim_sbpl_new (void); G_END_DECLS #endif /* _NC_HIPRIM_SBPL_H_ */ + diff --git a/numcosmo/nc_cbe_precision.c b/numcosmo/nc_cbe_precision.c index 175dae888..4b6d01022 100644 --- a/numcosmo/nc_cbe_precision.c +++ b/numcosmo/nc_cbe_precision.c @@ -228,9 +228,9 @@ static void nc_cbe_precision_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { NcCBEPrecision *cbe_prec = NC_CBE_PRECISION (object); - + g_return_if_fail (NC_IS_CBE_PRECISION (object)); - + switch (prop_id) { case PROP_A_INI_A_0: @@ -273,22 +273,22 @@ nc_cbe_precision_set_property (GObject *object, guint prop_id, const GValue *val { gchar *sBBN_file = g_value_dup_string (value); guint sBBN_file_len = strlen (sBBN_file); - + g_assert_cmpuint (sBBN_file_len, <=, _FILENAMESIZE_); - + if (!g_file_test (sBBN_file, G_FILE_TEST_EXISTS)) { g_warning ("nc_cbe_precision_set_property: file `%s' not found, using default.", sBBN_file); g_free (sBBN_file); - + sBBN_file = ncm_cfg_get_data_filename ("class_data"G_DIR_SEPARATOR_S "bbn"G_DIR_SEPARATOR_S "sBBN.dat", TRUE); sBBN_file_len = strlen (sBBN_file); g_assert_cmpuint (sBBN_file_len, <=, _FILENAMESIZE_); } - + memcpy (cbe_prec->priv->ppr.sBBN_file, sBBN_file, sBBN_file_len + 1); g_free (sBBN_file); - + break; } case PROP_RECFAST_Z_INI: @@ -376,67 +376,67 @@ nc_cbe_precision_set_property (GObject *object, guint prop_id, const GValue *val { gchar *Alpha_inf_file = g_value_dup_string (value); guint Alpha_inf_file_len = strlen (Alpha_inf_file); - + g_assert_cmpuint (Alpha_inf_file_len, <=, _FILENAMESIZE_); - + if (!g_file_test (Alpha_inf_file, G_FILE_TEST_EXISTS)) { g_warning ("nc_cbe_precision_set_property: file `%s' not found, using default.", Alpha_inf_file); g_free (Alpha_inf_file); - + Alpha_inf_file = ncm_cfg_get_data_filename ("class_data"G_DIR_SEPARATOR_S "hyrec"G_DIR_SEPARATOR_S "Alpha_inf.dat", TRUE); Alpha_inf_file_len = strlen (Alpha_inf_file); g_assert_cmpuint (Alpha_inf_file_len, <=, _FILENAMESIZE_); } - + memcpy (cbe_prec->priv->ppr.hyrec_Alpha_inf_file, Alpha_inf_file, Alpha_inf_file_len + 1); g_free (Alpha_inf_file); - + break; } case PROP_HYREC_R_INF_FILE: { gchar *R_inf_file = g_value_dup_string (value); guint R_inf_file_len = strlen (R_inf_file); - + g_assert_cmpuint (R_inf_file_len, <=, _FILENAMESIZE_); - + if (!g_file_test (R_inf_file, G_FILE_TEST_EXISTS)) { g_warning ("nc_cbe_precision_set_property: file `%s' not found, using default.", R_inf_file); g_free (R_inf_file); - + R_inf_file = ncm_cfg_get_data_filename ("class_data"G_DIR_SEPARATOR_S "hyrec"G_DIR_SEPARATOR_S "R_inf.dat", TRUE); R_inf_file_len = strlen (R_inf_file); - + g_assert_cmpuint (R_inf_file_len, <=, _FILENAMESIZE_); } - + memcpy (cbe_prec->priv->ppr.hyrec_R_inf_file, R_inf_file, R_inf_file_len + 1); g_free (R_inf_file); - + break; } case PROP_HYREC_TWO_PHOTON_TABLES_FILE: { gchar *two_photon_tables_file = g_value_dup_string (value); guint two_photon_tables_file_len = strlen (two_photon_tables_file); - + g_assert_cmpuint (two_photon_tables_file_len, <=, _FILENAMESIZE_); - + if (!g_file_test (two_photon_tables_file, G_FILE_TEST_EXISTS)) { g_warning ("nc_cbe_precision_set_property: file `%s' not found, using default.", two_photon_tables_file); g_free (two_photon_tables_file); - + two_photon_tables_file = ncm_cfg_get_data_filename ("class_data"G_DIR_SEPARATOR_S "hyrec"G_DIR_SEPARATOR_S "two_photon_tables.dat", TRUE); two_photon_tables_file_len = strlen (two_photon_tables_file); - + g_assert_cmpuint (two_photon_tables_file_len, <=, _FILENAMESIZE_); } - + memcpy (cbe_prec->priv->ppr.hyrec_two_photon_tables_file, two_photon_tables_file, two_photon_tables_file_len + 1); - + g_free (two_photon_tables_file); break; } @@ -774,9 +774,9 @@ static void nc_cbe_precision_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { NcCBEPrecision *cbe_prec = NC_CBE_PRECISION (object); - + g_return_if_fail (NC_IS_CBE_PRECISION (object)); - + switch (prop_id) { case PROP_A_INI_A_0: @@ -1249,11 +1249,11 @@ static void nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - + object_class->set_property = &nc_cbe_precision_set_property; object_class->get_property = &nc_cbe_precision_get_property; object_class->finalize = &nc_cbe_precision_finalize; - + /* * Background related parameters. */ @@ -1341,13 +1341,13 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) "parameter controlling precision with which tau_eq (conformal time at radiation/matter equality) is found (units: Mpc)", 0.0, G_MAXDOUBLE, 1.0e-6, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + /* * Thermodynamics related parameters */ { gchar *sBBN_file = ncm_cfg_get_data_filename ("class_data" G_DIR_SEPARATOR_S "bbn" G_DIR_SEPARATOR_S "sBBN_2017.dat", TRUE); - + g_object_class_install_property (object_class, PROP_SBBN_FILE, g_param_spec_string ("sBBN-file", @@ -1548,7 +1548,7 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); { gchar *hyrec_Alpha_inf_file = ncm_cfg_get_data_filename ("class_data" G_DIR_SEPARATOR_S "hyrec" G_DIR_SEPARATOR_S "Alpha_inf.dat", TRUE); - + g_object_class_install_property (object_class, PROP_HYREC_ALPHA_INF_FILE, g_param_spec_string ("hyrec-Alpha-inf-file", @@ -1560,7 +1560,7 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) } { gchar *hyrec_R_inf_file = ncm_cfg_get_data_filename ("class_data" G_DIR_SEPARATOR_S "hyrec" G_DIR_SEPARATOR_S "R_inf.dat", TRUE); - + g_object_class_install_property (object_class, PROP_HYREC_R_INF_FILE, g_param_spec_string ("hyrec-R-inf-file", @@ -1572,7 +1572,7 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) } { gchar *hyrec_two_photon_tables_file = ncm_cfg_get_data_filename ("class_data" G_DIR_SEPARATOR_S "hyrec" G_DIR_SEPARATOR_S "two_photon_tables.dat", TRUE); - + g_object_class_install_property (object_class, PROP_HYREC_TWO_PHOTON_TABLES_FILE, g_param_spec_string ("hyrec-two-photon-tables-file", @@ -1619,7 +1619,7 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) "plays a minor (almost aesthetic) role in the definition of the variation rate of thermodynamical quantities", 0, G_MAXINT, 50, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + /* * Perturbations parameters */ @@ -1896,7 +1896,7 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) "neglect CMB sources below visibility", 0.0, G_MAXDOUBLE, 1.0e-3, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + /* * Primordial spectra parameters */ @@ -2019,7 +2019,7 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) "primordial inflation extra efolds", 0.0, G_MAXDOUBLE, 2.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + /* * Transfer functions parameters */ @@ -2268,7 +2268,7 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) "controls how smooth are the edge of top-hat window function (<<1 for very sharp, 0.1 for sharp)", 0.0, G_MAXDOUBLE, 0.1, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + /* * Nonlinear module parameters */ @@ -2321,7 +2321,7 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) "tolerance for finding the equivalent models of the pk_equal method", 0.0, G_MAXDOUBLE, 1.0e-7, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + /* * parameter related to lensing */ @@ -2346,11 +2346,11 @@ nc_cbe_precision_class_init (NcCBEPrecisionClass *klass) "difference between l_max in unlensed and lensed spectra", 0.0, G_MAXINT, 500, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + /* * general precision parameters */ - + g_object_class_install_property (object_class, PROP_SMALLEST_ALLOWED_VARIATION, g_param_spec_double ("smallest-allowed-variation", @@ -2379,7 +2379,7 @@ nc_cbe_precision_new (void) { NcCBEPrecision *cbe_prec = g_object_new (NC_TYPE_CBE_PRECISION, NULL); - + return cbe_prec; } @@ -2434,27 +2434,27 @@ void nc_cbe_precision_assert_default (NcCBEPrecision *cbe_prec) { struct precision ppr; - + input_default_precision (&ppr); - + #define _CMP_DBL(name) g_assert_cmpfloat (ppr.name, ==, cbe_prec->priv->ppr.name) -#define _CMP_STR(name) \ - G_STMT_START \ - { \ - gchar *s1 = g_path_get_basename (ppr.name); \ - gchar *s2 = g_path_get_basename (cbe_prec->priv->ppr.name); \ - g_assert_cmpstr (s1, ==, s2); \ - /*printf ("`%s'\n", ppr.name);*/ \ - g_free (s1); \ - g_free (s2); \ - } \ - G_STMT_END - +#define _CMP_STR(name) \ + G_STMT_START \ + { \ + gchar *s1 = g_path_get_basename (ppr.name); \ + gchar *s2 = g_path_get_basename (cbe_prec->priv->ppr.name); \ + g_assert_cmpstr (s1, ==, s2); \ + /*printf ("`%s'\n", ppr.name);*/ \ + g_free (s1); \ + g_free (s2); \ + } \ + G_STMT_END + _CMP_STR (sBBN_file); _CMP_STR (hyrec_Alpha_inf_file); _CMP_STR (hyrec_R_inf_file); _CMP_STR (hyrec_two_photon_tables_file); - + _CMP_DBL (a_ini_over_a_today_default); _CMP_DBL (back_integration_stepsize); _CMP_DBL (tol_background_integration); diff --git a/numcosmo/nc_distance.c b/numcosmo/nc_distance.c index ce6788543..d17aa588c 100644 --- a/numcosmo/nc_distance.c +++ b/numcosmo/nc_distance.c @@ -1553,13 +1553,13 @@ nc_distance_conformal_time (NcDistance *dist, NcHICosmo *cosmo, const gdouble z) return result; } -#define _NC_DISTANCE_FUNC0_TO_FLIST(fname) \ +#define _NC_DISTANCE_FUNC0_TO_FLIST(fname) \ static void _nc_distance_flist_ ## fname (NcmMSetFuncList * flist, NcmMSet * mset, const gdouble * x, gdouble * res) \ - { \ - NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ - NcDistance *dist = NC_DISTANCE (ncm_mset_func_list_peek_obj (flist)); \ - nc_distance_prepare_if_needed (dist, cosmo); \ - res[0] = nc_distance_ ## fname (dist, cosmo); \ + { \ + NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ + NcDistance *dist = NC_DISTANCE (ncm_mset_func_list_peek_obj (flist)); \ + nc_distance_prepare_if_needed (dist, cosmo); \ + res[0] = nc_distance_ ## fname (dist, cosmo); \ } _NC_DISTANCE_FUNC0_TO_FLIST (decoupling_redshift) @@ -1572,13 +1572,13 @@ _NC_DISTANCE_FUNC0_TO_FLIST (angular_diameter_curvature_scale) _NC_DISTANCE_FUNC0_TO_FLIST (r_zd) _NC_DISTANCE_FUNC0_TO_FLIST (r_zd_Mpc) -#define _NC_DISTANCE_FUNC1_TO_FLIST(fname) \ +#define _NC_DISTANCE_FUNC1_TO_FLIST(fname) \ static void _nc_distance_flist_ ## fname (NcmMSetFuncList * flist, NcmMSet * mset, const gdouble * x, gdouble * res) \ - { \ - NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ - NcDistance *dist = NC_DISTANCE (ncm_mset_func_list_peek_obj (flist)); \ - nc_distance_prepare_if_needed (dist, cosmo); \ - res[0] = nc_distance_ ## fname (dist, cosmo, x[0]); \ + { \ + NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ + NcDistance *dist = NC_DISTANCE (ncm_mset_func_list_peek_obj (flist)); \ + nc_distance_prepare_if_needed (dist, cosmo); \ + res[0] = nc_distance_ ## fname (dist, cosmo, x[0]); \ } _NC_DISTANCE_FUNC1_TO_FLIST (comoving) diff --git a/numcosmo/nc_distance.h b/numcosmo/nc_distance.h index 6f58c6c0a..2be862c6b 100644 --- a/numcosmo/nc_distance.h +++ b/numcosmo/nc_distance.h @@ -61,14 +61,14 @@ struct _NcDistanceClass * @NC_DISTANCE_COMOVING_METHOD_FROM_MODEL: uses the method defined by the implementation of #NcHICosmo. * * Enumeration to define which method to be applied in order to compute the cosmological distances. - * + * */ typedef enum _NcDistanceComovingMethod { NC_DISTANCE_COMOVING_METHOD_INT_E = 0, NC_DISTANCE_COMOVING_METHOD_FROM_MODEL, /* < private > */ - NC_DISTANCE_COMOVING_METHOD_LEN, /*< skip >*/ + NC_DISTANCE_COMOVING_METHOD_LEN, /*< skip >*/ } NcDistanceComovingMethod; struct _NcDistance @@ -78,7 +78,7 @@ struct _NcDistance NcmOdeSpline *comoving_distance_spline; NcmSpline *inv_comoving_dist; NcmFunctionCache *comoving_distance_cache; - NcmFunctionCache *comoving_infinity; + NcmFunctionCache *comoving_infinity; NcmFunctionCache *time_cache; NcmFunctionCache *lookback_time_cache; NcmFunctionCache *conformal_time_cache; @@ -103,7 +103,7 @@ typedef struct _NcDistanceFuncZ { const gchar *name; - + const gchar *desc; NcDistanceFunc1 f; NcHICosmoImpl impl; @@ -119,6 +119,7 @@ void nc_distance_set_recomb (NcDistance *dist, NcRecomb *recomb); void nc_distance_compute_inv_comoving (NcDistance *dist, gboolean cpu_inv_xi); void nc_distance_prepare (NcDistance *dist, NcHICosmo *cosmo); + NCM_INLINE void nc_distance_prepare_if_needed (NcDistance *dist, NcHICosmo *cosmo); void nc_distance_free (NcDistance *dist); diff --git a/numcosmo/nc_hicosmo.c b/numcosmo/nc_hicosmo.c index 9f73e4376..ef5ea3c1f 100644 --- a/numcosmo/nc_hicosmo.c +++ b/numcosmo/nc_hicosmo.c @@ -2036,11 +2036,11 @@ nc_hicosmo_sigma8 (NcHICosmo *cosmo, NcmPowspecFilter *psf) return ncm_powspec_filter_eval_sigma (psf, 0.0, 8.0 / nc_hicosmo_h (cosmo)); } -#define _NC_HICOSMO_FUNC0_TO_FLIST(fname) \ +#define _NC_HICOSMO_FUNC0_TO_FLIST(fname) \ static void _nc_hicosmo_flist_ ## fname (NcmMSetFuncList * flist, NcmMSet * mset, const gdouble * x, gdouble * res) \ - { \ - NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ - res[0] = nc_hicosmo_ ## fname (cosmo); \ + { \ + NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ + res[0] = nc_hicosmo_ ## fname (cosmo); \ } _NC_HICOSMO_FUNC0_TO_FLIST (H0) @@ -2081,11 +2081,11 @@ _nc_hicosmo_flist_sigma8 (NcmMSetFuncList *flist, NcmMSet *mset, const gdouble * res[0] = nc_hicosmo_sigma8 (cosmo, NCM_POWSPEC_FILTER (ncm_mset_func_list_peek_obj (flist))); } -#define _NC_HICOSMO_FUNC1_TO_FLIST(fname) \ +#define _NC_HICOSMO_FUNC1_TO_FLIST(fname) \ static void _nc_hicosmo_flist_ ## fname (NcmMSetFuncList * flist, NcmMSet * mset, const gdouble * x, gdouble * res) \ - { \ - NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ - res[0] = nc_hicosmo_ ## fname (cosmo, x[0]); \ + { \ + NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ + res[0] = nc_hicosmo_ ## fname (cosmo, x[0]); \ } _NC_HICOSMO_FUNC1_TO_FLIST (E2Omega_b) @@ -2116,11 +2116,11 @@ _NC_HICOSMO_FUNC1_TO_FLIST (kinetic_w) _NC_HICOSMO_FUNC1_TO_FLIST (mqE2) _NC_HICOSMO_FUNC1_TO_FLIST (zt) -#define _NC_HICOSMO_FUNC1R2_TO_FLIST(fname) \ +#define _NC_HICOSMO_FUNC1R2_TO_FLIST(fname) \ static void _nc_hicosmo_flist_ ## fname (NcmMSetFuncList * flist, NcmMSet * mset, const gdouble * x, gdouble * res) \ - { \ - NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ - nc_hicosmo_ ## fname (cosmo, x[0], &res[0], &res[1]); \ + { \ + NcHICosmo *cosmo = NC_HICOSMO (ncm_mset_peek (mset, nc_hicosmo_id ())); \ + nc_hicosmo_ ## fname (cosmo, x[0], &res[0], &res[1]); \ } _NC_HICOSMO_FUNC1R2_TO_FLIST (mqE2_max) diff --git a/numcosmo/nc_hicosmo_priors.c b/numcosmo/nc_hicosmo_priors.c index 27880f430..f4441145b 100644 --- a/numcosmo/nc_hicosmo_priors.c +++ b/numcosmo/nc_hicosmo_priors.c @@ -8,17 +8,17 @@ /* * numcosmo * Copyright (C) 2012 Sandro Dias Pinto Vitenti - * + * * numcosmo is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -27,7 +27,7 @@ * SECTION:nc_hicosmo_priors * @title: NcHICosmoPrior * @short_description: Collection of priors for NcHICosmo models - * + * * FIXME * */ @@ -41,10 +41,11 @@ /** * nc_hicosmo_priors_stub: - * - * + * + * */ -void +void nc_hicosmo_priors_stub (void) { } + diff --git a/numcosmo/nc_hicosmo_priors.h b/numcosmo/nc_hicosmo_priors.h index e3c1fb26f..d767c46a3 100644 --- a/numcosmo/nc_hicosmo_priors.h +++ b/numcosmo/nc_hicosmo_priors.h @@ -8,17 +8,17 @@ /* * numcosmo * Copyright (C) 2012 Sandro Dias Pinto Vitenti - * + * * numcosmo is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -38,3 +38,4 @@ void nc_hicosmo_priors_stub (void); G_END_DECLS #endif /* _NC_HICOSMO_PRIORS_H_ */ + diff --git a/numcosmo/nc_hiprim.c b/numcosmo/nc_hiprim.c index 9891a3ad7..f19416a3d 100644 --- a/numcosmo/nc_hiprim.c +++ b/numcosmo/nc_hiprim.c @@ -348,12 +348,12 @@ NCM_MODEL_SET_IMPL_FUNC (NC_HIPRIM, NcHIPrim, nc_hiprim, NcHIPrimFunc1, lnSA_pow */ NCM_MODEL_SET_IMPL_FUNC (NC_HIPRIM, NcHIPrim, nc_hiprim, NcHIPrimFunc1, lnT_powspec_lnk) -#define _NC_HIPRIM_FUNC1_TO_FLIST(fname) \ +#define _NC_HIPRIM_FUNC1_TO_FLIST(fname) \ static void _nc_hiprim_flist_ ## fname (NcmMSetFuncList * flist, NcmMSet * mset, const gdouble * x, gdouble * res) \ - { \ - NcHIPrim *prim = NC_HIPRIM (ncm_mset_peek (mset, nc_hiprim_id ())); \ - g_assert (prim != NULL); \ - res[0] = nc_hiprim_ ## fname (prim, x[0]); \ + { \ + NcHIPrim *prim = NC_HIPRIM (ncm_mset_peek (mset, nc_hiprim_id ())); \ + g_assert (prim != NULL); \ + res[0] = nc_hiprim_ ## fname (prim, x[0]); \ } _NC_HIPRIM_FUNC1_TO_FLIST (lnSA_powspec_lnk) diff --git a/numcosmo/nc_hiprim.h b/numcosmo/nc_hiprim.h index 0985a931a..2ecc7f7de 100644 --- a/numcosmo/nc_hiprim.h +++ b/numcosmo/nc_hiprim.h @@ -56,7 +56,7 @@ typedef struct _NcHIPrimClass NcHIPrimClass; typedef enum /*< flags,underscore_name=NC_HIPRIM_IMPL >*/ { NC_HIPRIM_IMPL_lnSA_powspec_lnk = 1 << 0, - NC_HIPRIM_IMPL_lnT_powspec_lnk = 1 << 1, + NC_HIPRIM_IMPL_lnT_powspec_lnk = 1 << 1, /* < private > */ NC_HIPRIM_IMPL_LAST = 1 << 2, /*< skip >*/ } NcHIPrimImpl; diff --git a/numcosmo/nc_hiqg_1d.h b/numcosmo/nc_hiqg_1d.h index 31a569f87..cb7c793ff 100644 --- a/numcosmo/nc_hiqg_1d.h +++ b/numcosmo/nc_hiqg_1d.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * nc_hiqg_1d.h * @@ -14,12 +15,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -63,15 +64,15 @@ struct _NcHIQG1D /** * NcHIQG1DGauss: - * + * * Gaussian wave-function. - * + * */ struct _NcHIQG1DGauss { /*< private >*/ gdouble mean; - gdouble alpha; + gdouble alpha; gdouble sigma; gdouble Hi; gdouble lnNorm; @@ -112,9 +113,9 @@ struct _NcHIQG1DSQ * @psi_data: object pointer * @x: eval point $x$ * @psi: (out caller-allocates) (array fixed-size=2) (element-type gdouble): $\psi$ - * + * * Wave-function - * + * */ typedef void (*NcHIQG1DPsi) (gpointer psi_data, const gdouble x, gdouble *psi); @@ -191,3 +192,4 @@ gdouble nc_hiqg_1d_Bohm_p (NcHIQG1D *qg1d, gint i); G_END_DECLS #endif /* _NC_HIQG_1D_H_ */ + diff --git a/numcosmo/nc_hireion.h b/numcosmo/nc_hireion.h index ec56a03f0..f738a9716 100644 --- a/numcosmo/nc_hireion.h +++ b/numcosmo/nc_hireion.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -44,6 +44,7 @@ G_BEGIN_DECLS #define NC_HIREION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NC_TYPE_HIREION, NcHIReionClass)) typedef struct _NcHIReionClass NcHIReionClass; + /*typedef struct _NcHIReion NcHIReion;*/ /* already defined in nc_hicosmo.h! */ struct _NcHIReionClass @@ -79,3 +80,4 @@ gdouble nc_hireion_get_tau (NcHIReion *reion, NcHICosmo *cosmo); G_END_DECLS #endif /* _NC_HIREION_H_ */ + diff --git a/numcosmo/nc_hireion_camb.h b/numcosmo/nc_hireion_camb.h index 8a4885a2a..92379885c 100644 --- a/numcosmo/nc_hireion_camb.h +++ b/numcosmo/nc_hireion_camb.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -60,12 +60,12 @@ struct _NcHIReionCambClass * @NC_HIREION_CAMB_HEIII_Z: FIXME * * FIXME - * + * */ typedef enum /*< enum,underscore_name=NC_HIREION_CAMB_SPARAMS >*/ { NC_HIREION_CAMB_HII_HEII_Z = 0, - NC_HIREION_CAMB_HEIII_Z, + NC_HIREION_CAMB_HEIII_Z, /* < private > */ NC_HIREION_CAMB_SPARAM_LEN, /*< skip >*/ } NcHIReionCambSParams; @@ -102,3 +102,4 @@ void nc_hireion_camb_z_to_tau (NcHIReionCamb *reion_camb, NcHICosmo *cosmo); G_END_DECLS #endif /* _NC_HIREION_CAMB_H_ */ + diff --git a/numcosmo/nc_hireion_camb_reparam_tau.h b/numcosmo/nc_hireion_camb_reparam_tau.h index 22a00095f..3c36924a3 100644 --- a/numcosmo/nc_hireion_camb_reparam_tau.h +++ b/numcosmo/nc_hireion_camb_reparam_tau.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ @@ -66,3 +66,4 @@ NcHIReionCambReparamTau *nc_hireion_camb_reparam_tau_new (guint length, NcHICosm G_END_DECLS #endif /* _NC_HIREION_CAMB_REPARAM_TAU_H_ */ + diff --git a/numcosmo/nc_planck_fi.h b/numcosmo/nc_planck_fi.h index 85127dc4f..1a38f26dc 100644 --- a/numcosmo/nc_planck_fi.h +++ b/numcosmo/nc_planck_fi.h @@ -72,3 +72,4 @@ void nc_planck_fi_log_all_models (void); G_END_DECLS #endif /* _NC_PLANCK_FI_H_ */ + diff --git a/numcosmo/nc_planck_fi_cor_tt.h b/numcosmo/nc_planck_fi_cor_tt.h index f1ba47cd0..23474ba73 100644 --- a/numcosmo/nc_planck_fi_cor_tt.h +++ b/numcosmo/nc_planck_fi_cor_tt.h @@ -93,7 +93,7 @@ typedef enum /*< enum,underscore_name=NC_PLANCK_FI_COR_TT_SPARAMS >*/ NC_PLANCK_FI_COR_TT_A_sbpx_217_217_TT, NC_PLANCK_FI_COR_TT_calib_100T, NC_PLANCK_FI_COR_TT_calib_217T, - NC_PLANCK_FI_COR_TT_A_planck, + NC_PLANCK_FI_COR_TT_A_planck, /* < private > */ NC_PLANCK_FI_COR_TT_SPARAM_LEN, /*< skip >*/ } NcPlanckFICorTTSParams; @@ -151,3 +151,4 @@ void nc_planck_fi_cor_tt_add_all_default18_priors (NcmLikelihood *lh); G_END_DECLS #endif /* _NC_PLANCK_FI_COR_TT_H_ */ + diff --git a/numcosmo/nc_planck_fi_cor_ttteee.h b/numcosmo/nc_planck_fi_cor_ttteee.h index bba2e4772..ffafa218c 100644 --- a/numcosmo/nc_planck_fi_cor_ttteee.h +++ b/numcosmo/nc_planck_fi_cor_ttteee.h @@ -133,11 +133,11 @@ typedef struct _NcPlanckFICorTTTEEE NcPlanckFICorTTTEEE; * @NC_PLANCK_FI_COR_TTTEEE_calib_143P: Calibration of the 143 EE spectra * @NC_PLANCK_FI_COR_TTTEEE_calib_217P: Calibration of the 217 EE spectra * @NC_PLANCK_FI_COR_TTTEEE_A_pol: Calibration of the polarization relative to the temperature - * + * * Planck Foregound and Instrument parameters, compatible with 2013, 2015 and 2018 * releases (see [Planck 2015 results XI (2015)][XPlanckCollaboration2015a] and * [Planck 2018 results V (2019)][XPlanckCollaboration2019]). - * + * */ typedef enum /*< enum,underscore_name=NC_PLANCK_FI_COR_TTTEEE_SPARAMS >*/ { @@ -227,98 +227,98 @@ typedef enum /*< enum,underscore_name=NC_PLANCK_FI_COR_TTTEEE_SPARAMS >*/ NC_PLANCK_FI_COR_TTTEEE_calib_100P, NC_PLANCK_FI_COR_TTTEEE_calib_143P, NC_PLANCK_FI_COR_TTTEEE_calib_217P, - NC_PLANCK_FI_COR_TTTEEE_A_pol, + NC_PLANCK_FI_COR_TTTEEE_A_pol, /* < private > */ NC_PLANCK_FI_COR_TTTEEE_SPARAM_LEN, /*< skip >*/ } NcPlanckFICorTTTEEESParams; -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_100 ( 0.060) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_100_143 ( 0.050) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_100_217 ( 0.110) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_143 ( 0.10) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_143_217 ( 0.240) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_217 ( 0.72) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_100 (0.060) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_100_143 (0.050) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_100_217 (0.110) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_143 (0.10) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_143_217 (0.240) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_A_217 (0.72) #define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_EE_index (-2.4) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_100 ( 0.140) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_100_143 ( 0.120) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_100_217 ( 0.30) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_143 ( 0.240) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_143_217 ( 0.60) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_217 ( 1.80) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_100 (0.140) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_100_143 (0.120) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_100_217 (0.30) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_143 (0.240) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_143_217 (0.60) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_A_217 (1.80) #define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_galf_TE_index (-2.4) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_cnoise_e2e_100_100_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_cnoise_e2e_143_143_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_cnoise_e2e_217_217_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0T_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0T_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0T_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0T_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0T_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_1T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_1T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_1T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_1T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_1T_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_1T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_1T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_1T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_1T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_1T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_2T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_2T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_2T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_2T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_2T_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0E_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0E_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0E_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0E_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0E_0E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_1E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_1E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_1E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_1E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_1E_1E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_1E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_1E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_1E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_1E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_1E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_2E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_2E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_2E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_2E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_2E_2E ( 0.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_100_100_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_100_143_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_100_217_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_143_143_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_143_217_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_217_217_EE ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_calib_100P ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_calib_143P ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_calib_217P ( 1.0) -#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_pol ( 1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_cnoise_e2e_100_100_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_cnoise_e2e_143_143_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_cnoise_e2e_217_217_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0T_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0T_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0T_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0T_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0T_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_1T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_1T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_1T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_1T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_1T_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_1T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_1T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_1T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_1T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_1T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_2T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_2T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_2T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_2T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_2T_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0E_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0E_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0E_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0E_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0E_0E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_0E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_0E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_0E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_0E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_0E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_1E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_1E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_1E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_1E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_1E_1E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_1E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_1E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_1E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_1E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_1E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_0_2E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_1_2E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_2_2E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_3_2E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_bleak_epsilon_4_2E_2E (0.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_100_100_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_100_143_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_100_217_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_143_143_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_143_217_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_sbpx_217_217_EE (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_calib_100P (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_calib_143P (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_calib_217P (1.0) +#define NC_PLANCK_FI_COR_TTTEEE_DEFAULT_A_pol (1.0) struct _NcPlanckFICorTTTEEEClass { @@ -347,3 +347,4 @@ void nc_planck_fi_cor_ttteee_add_all_default18_priors (NcmLikelihood *lh); G_END_DECLS #endif /* _NC_PLANCK_FI_COR_TTTEEE_H_ */ + diff --git a/numcosmo/nc_powspec_ml_transfer.c b/numcosmo/nc_powspec_ml_transfer.c index 92d703595..bd3b281fc 100644 --- a/numcosmo/nc_powspec_ml_transfer.c +++ b/numcosmo/nc_powspec_ml_transfer.c @@ -69,9 +69,9 @@ static void _nc_powspec_ml_transfer_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { NcPowspecMLTransfer *ps_mlt = NC_POWSPEC_ML_TRANSFER (object); - + g_return_if_fail (NC_IS_POWSPEC_ML_TRANSFER (object)); - + switch (prop_id) { case PROP_TRANSFER: @@ -90,9 +90,9 @@ static void _nc_powspec_ml_transfer_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { NcPowspecMLTransfer *ps_mlt = NC_POWSPEC_ML_TRANSFER (object); - + g_return_if_fail (NC_IS_POWSPEC_ML_TRANSFER (object)); - + switch (prop_id) { case PROP_TRANSFER: @@ -114,7 +114,7 @@ _nc_powspec_ml_transfer_constructed (GObject *object) G_OBJECT_CLASS (nc_powspec_ml_transfer_parent_class)->constructed (object); { NcPowspecMLTransfer *ps_mlt = NC_POWSPEC_ML_TRANSFER (object); - + if (ps_mlt->gf == NULL) ps_mlt->gf = nc_growth_func_new (); } @@ -124,10 +124,10 @@ static void _nc_powspec_ml_transfer_dispose (GObject *object) { NcPowspecMLTransfer *ps_mlt = NC_POWSPEC_ML_TRANSFER (object); - + nc_transfer_func_clear (&ps_mlt->tf); nc_growth_func_clear (&ps_mlt->gf); - + /* Chain up : end */ G_OBJECT_CLASS (nc_powspec_ml_transfer_parent_class)->dispose (object); } @@ -149,12 +149,12 @@ nc_powspec_ml_transfer_class_init (NcPowspecMLTransferClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); NcmPowspecClass *powspec_class = NCM_POWSPEC_CLASS (klass); - + object_class->set_property = &_nc_powspec_ml_transfer_set_property; object_class->get_property = &_nc_powspec_ml_transfer_get_property; - + object_class->constructed = &_nc_powspec_ml_transfer_constructed; - + object_class->dispose = &_nc_powspec_ml_transfer_dispose; object_class->finalize = &_nc_powspec_ml_transfer_finalize; @@ -171,7 +171,7 @@ nc_powspec_ml_transfer_class_init (NcPowspecMLTransferClass *klass) "Transfer function", NC_TYPE_TRANSFER_FUNC, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + /** * NcPowspecMLTransfer:growth: * @@ -185,7 +185,7 @@ nc_powspec_ml_transfer_class_init (NcPowspecMLTransferClass *klass) "Growth function", NC_TYPE_GROWTH_FUNC, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - + powspec_class->prepare = &_nc_powspec_ml_transfer_prepare; powspec_class->eval = &_nc_powspec_ml_transfer_eval; powspec_class->eval_vec = &_nc_powspec_ml_transfer_eval_vec; @@ -197,16 +197,16 @@ _nc_powspec_ml_transfer_prepare (NcmPowspec *powspec, NcmModel *model) { NcHICosmo *cosmo = NC_HICOSMO (model); NcPowspecMLTransfer *ps_mlt = NC_POWSPEC_ML_TRANSFER (powspec); - + g_assert (NC_IS_HICOSMO (model)); g_assert (ncm_model_peek_submodel_by_mid (model, nc_hiprim_id ()) != NULL); - + nc_growth_func_prepare_if_needed (ps_mlt->gf, cosmo); nc_transfer_func_prepare_if_needed (ps_mlt->tf, cosmo); - + { const gdouble RH = nc_hicosmo_RH_Mpc (cosmo); - + ps_mlt->Pm_k2Pzeta = (2.0 * M_PI * M_PI) * gsl_pow_2 ((2.0 / 5.0) * nc_growth_func_get_dust_norma_Da0 (ps_mlt->gf) / nc_hicosmo_Omega_m0 (cosmo)) * gsl_pow_4 (RH); } } @@ -237,17 +237,17 @@ _nc_powspec_ml_transfer_eval_vec (NcmPowspec *powspec, NcmModel *model, const gd const gdouble gf2 = gsl_pow_2 (growth); const guint len = ncm_vector_len (k); guint i; - + for (i = 0; i < len; i++) { const gdouble ki = ncm_vector_get (k, i); - + const gdouble khi = ki / nc_hicosmo_h (cosmo); const gdouble tf = nc_transfer_func_eval (ps_mlt->tf, cosmo, khi); const gdouble tf2 = tf * tf; - + const gdouble Delta_zeta_k = nc_hiprim_SA_powspec_k (prim, ki); - + ncm_vector_set (Pk, i, ki * Delta_zeta_k * ps_mlt->Pm_k2Pzeta * tf2 * gf2); } } @@ -256,7 +256,7 @@ static void _nc_powspec_ml_transfer_get_nknots (NcmPowspec *powspec, guint *Nz, guint *Nk) { /*NcPowspecMLTransfer *ps_mlt = NC_POWSPEC_ML_TRANSFER (powspec);*/ - + Nz[0] = 20; Nk[0] = 1000; } @@ -276,7 +276,7 @@ nc_powspec_ml_transfer_new (NcTransferFunc *tf) NcPowspecMLTransfer *ps_mlt = g_object_new (NC_TYPE_POWSPEC_ML_TRANSFER, "transfer", tf, NULL); - + return ps_mlt; } diff --git a/numcosmo/nc_recomb.h b/numcosmo/nc_recomb.h index 7f192fd8d..e237b2718 100644 --- a/numcosmo/nc_recomb.h +++ b/numcosmo/nc_recomb.h @@ -60,7 +60,7 @@ struct _NcRecombClass void (*prepare) (NcRecomb *recomb, NcHICosmo *cosmo); gdouble (*Xe) (NcRecomb *recomb, NcHICosmo *cosmo, const gdouble lambda); gdouble (*XHII) (NcRecomb *recomb, NcHICosmo *cosmo, const gdouble lambda); - gdouble (*XHeII) (NcRecomb *recomb, NcHICosmo *cosmo, const gdouble lambda); + gdouble (*XHeII) (NcRecomb *recomb, NcHICosmo *cosmo, const gdouble lambda); }; struct _NcRecomb @@ -90,6 +90,7 @@ void nc_recomb_free (NcRecomb *recomb); void nc_recomb_clear (NcRecomb **recomb); void nc_recomb_prepare (NcRecomb *recomb, NcHICosmo *cosmo); + NCM_INLINE void nc_recomb_prepare_if_needed (NcRecomb *recomb, NcHICosmo *cosmo); void nc_recomb_set_zi (NcRecomb *recomb, const gdouble zi); @@ -167,19 +168,19 @@ nc_recomb_prepare_if_needed (NcRecomb *recomb, NcHICosmo *cosmo) nc_recomb_prepare (recomb, cosmo); } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_Xe (NcRecomb *recomb, NcHICosmo *cosmo, const gdouble lambda) { return NC_RECOMB_GET_CLASS (recomb)->Xe (recomb, cosmo, lambda); } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_XHII (NcRecomb *recomb, NcHICosmo *cosmo, const gdouble lambda) { return NC_RECOMB_GET_CLASS (recomb)->XHII (recomb, cosmo, lambda); } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_XHeII (NcRecomb *recomb, NcHICosmo *cosmo, const gdouble lambda) { return NC_RECOMB_GET_CLASS (recomb)->XHeII (recomb, cosmo, lambda); @@ -188,7 +189,7 @@ nc_recomb_XHeII (NcRecomb *recomb, NcHICosmo *cosmo, const gdouble lambda) NCM_INLINE gdouble nc_recomb_dtau_dlambda_Xe (NcHICosmo *cosmo, const gdouble lambda) { - const gdouble x = exp (-lambda); + const gdouble x = exp (-lambda); const gdouble x3 = gsl_pow_3 (x); const gdouble h2 = nc_hicosmo_h2 (cosmo); const gdouble Omega_b0 = nc_hicosmo_Omega_b0 (cosmo); @@ -202,61 +203,61 @@ nc_recomb_dtau_dlambda_Xe (NcHICosmo *cosmo, const gdouble lambda) NCM_INLINE gdouble nc_recomb_He_fully_ionized_dtau_dlambda (NcHICosmo *cosmo, const gdouble lambda) { - const gdouble x = exp (-lambda); - const gdouble x3 = gsl_pow_3 (x); - const gdouble h2 = nc_hicosmo_h2 (cosmo); - const gdouble Omega_b0 = nc_hicosmo_Omega_b0 (cosmo); - const gdouble n_b0 = Omega_b0 * ncm_c_crit_number_density_p () * h2; - const gdouble n_0 = nc_hicosmo_Yp_1H (cosmo) * n_b0; + const gdouble x = exp (-lambda); + const gdouble x3 = gsl_pow_3 (x); + const gdouble h2 = nc_hicosmo_h2 (cosmo); + const gdouble Omega_b0 = nc_hicosmo_Omega_b0 (cosmo); + const gdouble n_b0 = Omega_b0 * ncm_c_crit_number_density_p () * h2; + const gdouble n_0 = nc_hicosmo_Yp_1H (cosmo) * n_b0; const gdouble H = nc_hicosmo_H (cosmo, x - 1.0) / (ncm_c_kpc ()); const gdouble Xe = nc_recomb_He_fully_ionized_Xe (cosmo, x); - return -Xe * ncm_c_c () * ncm_c_thomson_cs () * n_0 * x3 / H; + return -Xe *ncm_c_c () * ncm_c_thomson_cs () * n_0 * x3 / H; } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_get_v_tau_max_lambda (NcRecomb *recomb, NcHICosmo *cosmo) { return recomb->v_tau_max_lambda; } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_get_tau_lambda (NcRecomb *recomb, NcHICosmo *cosmo) { return recomb->tau_lambda; } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_get_tau_drag_lambda (NcRecomb *recomb, NcHICosmo *cosmo) { return recomb->tau_drag_lambda; } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_get_tau_cutoff_lambda (NcRecomb *recomb, NcHICosmo *cosmo) { return recomb->tau_cutoff_lambda; } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_get_v_tau_max_z (NcRecomb *recomb, NcHICosmo *cosmo) { return recomb->v_tau_max_z; } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_get_tau_z (NcRecomb *recomb, NcHICosmo *cosmo) { return recomb->tau_z; } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_get_tau_drag_z (NcRecomb *recomb, NcHICosmo *cosmo) { return recomb->tau_drag_z; } -NCM_INLINE gdouble +NCM_INLINE gdouble nc_recomb_get_tau_cutoff_z (NcRecomb *recomb, NcHICosmo *cosmo) { return recomb->tau_cutoff_z; @@ -267,3 +268,4 @@ G_END_DECLS #endif /* __GTK_DOC_IGNORE__ */ #endif /* NUMCOSMO_HAVE_INLINE */ #endif /* _NC_RECOMB_INLINE_H_ */ + diff --git a/numcosmo/nc_recomb_cbe.h b/numcosmo/nc_recomb_cbe.h index 245afa47b..b3c2290c0 100644 --- a/numcosmo/nc_recomb_cbe.h +++ b/numcosmo/nc_recomb_cbe.h @@ -13,12 +13,12 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * numcosmo is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ diff --git a/numcosmo/nc_recomb_seager.h b/numcosmo/nc_recomb_seager.h index f8caeaf3e..3e47ad4f5 100644 --- a/numcosmo/nc_recomb_seager.h +++ b/numcosmo/nc_recomb_seager.h @@ -1,4 +1,5 @@ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ + /*************************************************************************** * nc_recomb_seager.h * @@ -72,9 +73,9 @@ typedef enum _NcRecombSeagerOpt NC_RECOM_SEAGER_OPT_HEII_SOBOLEV_1P1_CO = 1 << 3, NC_RECOM_SEAGER_OPT_HEII_SOBOLEV_3P012 = 1 << 4, NC_RECOM_SEAGER_OPT_HEII_SOBOLEV_3P012_CO = 1 << 5, - NC_RECOM_SEAGER_OPT_ALL = (1 << 6) - 1, + NC_RECOM_SEAGER_OPT_ALL = (1 << 6) - 1, /* < private > */ - NC_RECOM_SEAGER_OPT_LEN, /*< skip >*/ + NC_RECOM_SEAGER_OPT_LEN, /*< skip >*/ } NcRecombSeagerOpt; typedef gdouble (*NcRecombSeagerKHI2p2Pmean) (NcRecombSeager *recomb_seager, NcHICosmo *cosmo, const gdouble x, const gdouble H); @@ -117,3 +118,4 @@ gdouble nc_recomb_seager_hummer_HeI_case_B_trip_dTm (NcRecombSeager *recomb_seag G_END_DECLS #endif /* _NC_RECOMB_SEAGER_H_ */ + diff --git a/numcosmo/nc_scalefactor.h b/numcosmo/nc_scalefactor.h index d376c486b..f82c3158b 100644 --- a/numcosmo/nc_scalefactor.h +++ b/numcosmo/nc_scalefactor.h @@ -99,3 +99,4 @@ gdouble nc_scalefactor_eval_eta_t (NcScalefactor *a, const gdouble t); G_END_DECLS #endif /* _NC_SCALEFACTOR_H_ */ + diff --git a/numcosmo/ncm_build_inline.c b/numcosmo/ncm_build_inline.c index a4019188b..165342324 100644 --- a/numcosmo/ncm_build_inline.c +++ b/numcosmo/ncm_build_inline.c @@ -30,3 +30,4 @@ #undef NCM_INLINE #define NCM_INLINE #include + diff --git a/numcosmo/ncm_fit_nlopt_enum_meta.c b/numcosmo/ncm_fit_nlopt_enum_meta.c index 156db987b..35851b450 100644 --- a/numcosmo/ncm_fit_nlopt_enum_meta.c +++ b/numcosmo/ncm_fit_nlopt_enum_meta.c @@ -1,3 +1,2 @@ - #include diff --git a/numcosmo/ncm_gir_scan.h b/numcosmo/ncm_gir_scan.h index 51e4da4fa..ababbf9e3 100644 --- a/numcosmo/ncm_gir_scan.h +++ b/numcosmo/ncm_gir_scan.h @@ -27,13 +27,13 @@ * @title: Gir Scanning Compatibility * @short_description: Gir scanning types stubs. * - * Stubs to avoid warnings from gir scanning + * Stubs to avoid warnings from gir scanning * all functions/structs using these types * must be skipped using (skip). - * + * * These types do not represent anything, do not * use this documentation. - * + * */ /** @@ -295,3 +295,4 @@ * */ #define fitsfile gint + diff --git a/numcosmo/xcor/nc_xcor_AB.h b/numcosmo/xcor/nc_xcor_AB.h index 1b8f6ea2d..9d1bb9609 100644 --- a/numcosmo/xcor/nc_xcor_AB.h +++ b/numcosmo/xcor/nc_xcor_AB.h @@ -47,15 +47,15 @@ struct _NcXcorAB { /*< private > */ GObject parent_instance; - + guint a; guint b; - + guint ell_th_cut_off; guint ell_lik_min; guint ell_lik_max; guint nell_lik; - + NcmMatrix *mixing; NcmMatrix *cl_th; /*column 0 : C_l^th, 1 : C_l^th+N_l, 2 : mixed C_l */ NcmVector *cl_obs; @@ -65,7 +65,7 @@ struct _NcXcorABClass { /*< private > */ GObjectClass parent_class; - + gpointer (*alloc) (void); }; diff --git a/numcosmo/xcor/nc_xcor_limber_kernel_CMB_lensing.h b/numcosmo/xcor/nc_xcor_limber_kernel_CMB_lensing.h index a8560825d..ad1e7ea5b 100644 --- a/numcosmo/xcor/nc_xcor_limber_kernel_CMB_lensing.h +++ b/numcosmo/xcor/nc_xcor_limber_kernel_CMB_lensing.h @@ -63,13 +63,13 @@ struct _NcXcorLimberKernelCMBLensing { /*< private >*/ NcXcorLimberKernel parent_instance; - + NcDistance *dist; NcRecomb *recomb; - + NcmVector *Nl; guint Nlmax; - + gdouble xi_lss; }; diff --git a/numcosmo/xcor/nc_xcor_limber_kernel_gal.h b/numcosmo/xcor/nc_xcor_limber_kernel_gal.h index bea2ed6e0..8991e243e 100644 --- a/numcosmo/xcor/nc_xcor_limber_kernel_gal.h +++ b/numcosmo/xcor/nc_xcor_limber_kernel_gal.h @@ -75,22 +75,22 @@ struct _NcXcorLimberKernelGal { /*< private >*/ NcXcorLimberKernel parent_instance; - + NcmSpline *dn_dz; - + NcmSpline *bias_spline; guint nknots; gdouble *bias; - + NcDistance *dist; - + NcmSpline *g_func; gboolean domagbias; - + gboolean fast_update; gdouble bias_old; gdouble noise_bias_old; - + gdouble nbarm1; }; diff --git a/numcosmo/xcor/nc_xcor_limber_kernel_weak_lensing.h b/numcosmo/xcor/nc_xcor_limber_kernel_weak_lensing.h index 7d3e433a3..d90d0ec2e 100644 --- a/numcosmo/xcor/nc_xcor_limber_kernel_weak_lensing.h +++ b/numcosmo/xcor/nc_xcor_limber_kernel_weak_lensing.h @@ -69,25 +69,25 @@ struct _NcXcorLimberKernelWeakLensing { /*< private >*/ NcXcorLimberKernel parent_instance; - + NcmSpline *dn_dz; - + /* NcmSpline* bias_spline; */ /* guint nknots; */ /* gdouble* bias; */ - + NcDistance *dist; - + NcmSpline *src_int; /* gboolean domagbias; */ - + /* gboolean fast_update; */ /* gdouble bias_old; */ /* gdouble noise_bias_old; */ - + gdouble nbar; gdouble intr_shear; - + gdouble noise; }; diff --git a/numcosmo_uncrustify.cfg b/numcosmo_uncrustify.cfg index 86334e4d3..4fa3c93c8 100644 --- a/numcosmo_uncrustify.cfg +++ b/numcosmo_uncrustify.cfg @@ -365,7 +365,7 @@ nl_before_func_body_def = 2 # unsigned number nl_after_func_proto = 0 # unsigned number nl_after_func_proto_group = 2 # unsigned number nl_after_func_body = 2 # unsigned number -nl_func_var_def_blk = 1 # unsigned number +nl_var_def_blk_end_func_top = 1 # unsigned number nl_typedef_blk_start = 2 # unsigned number nl_typedef_blk_end = 2 # unsigned number nl_typedef_blk_in = 0 # unsigned number @@ -433,7 +433,7 @@ align_assign_span = 1 # unsigned number align_assign_func_proto_span = 0 # unsigned number align_assign_thresh = 0 # number align_assign_decl_func = 0 # unsigned number -align_enum_equ_span = 0 # unsigned number +align_enum_equ_span = 1 # unsigned number align_enum_equ_thresh = 0 # number align_var_struct_span = 0 # unsigned number align_var_struct_thresh = 0 # number @@ -457,7 +457,7 @@ align_mix_var_proto = false # true/false align_single_line_func = false # true/false align_single_line_brace = false # true/false align_single_line_brace_gap = 0 # unsigned number -align_nl_cont = false # true/false +align_nl_cont = 1 # true/false align_pp_define_together = false # true/false align_pp_define_span = 0 # unsigned number align_pp_define_gap = 0 # unsigned number @@ -529,7 +529,7 @@ mod_enum_last_comma = ignore # ignore/add/remove/force pp_indent = ignore # ignore/add/remove/force pp_indent_at_level = false # true/false pp_indent_count = 1 # unsigned number -pp_space = ignore # ignore/add/remove/force +pp_space_after = ignore # ignore/add/remove/force pp_space_count = 0 # unsigned number pp_indent_region = 0 # number pp_region_indent_code = false # true/false