CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
spectra_module.h
1#ifndef SPECTRA_MODULE_H
2#define SPECTRA_MODULE_H
3
4#include <map>
5#include <string>
6#include <vector>
7
8#include "base_module.h"
9#include "input_module.h"
10
11class SpectraModule : public BaseModule {
12 public:
13 SpectraModule(InputModulePtr input_module,
14 PerturbationsModulePtr perturbations_module,
15 PrimordialModulePtr primordial_module_,
16 NonlinearModulePtr nonlinear_module,
17 TransferModulePtr transfer_module);
18 ~SpectraModule();
19 void spectra_cl_at_l(double l, double* cl, double** cl_md, double** cl_md_ic) const;
20 std::map<std::string, int> cl_output_index_map() const;
21 std::map<std::string, std::vector<double>> cl_output(int lmax) const;
22 void cl_output_no_copy(int lmax, std::vector<double*>& output_pointers) const;
23
27 int md_size_;
28 std::vector<int>
29 ic_size_;
30 std::vector<int>
31 ic_ic_size_;
32 std::vector<std::vector<short>>
33 is_non_zero_;
35
39
40 bool has_tt_;
41 bool has_ee_;
42 bool has_te_;
43 bool has_bb_;
44 bool has_pp_;
45 bool has_tp_;
46 bool has_ep_;
47 bool has_dd_;
48 bool has_td_;
49 bool has_pd_;
50 bool has_ll_;
51 bool has_tl_;
52 bool has_dl_;
54 int index_ct_tt_;
55 int index_ct_ee_;
56 int index_ct_te_;
57 int index_ct_bb_;
58 int index_ct_pp_;
59 int index_ct_tp_;
60 int index_ct_ep_;
61 int index_ct_dd_;
62 int index_ct_td_;
63 int index_ct_pd_;
64 int index_ct_ll_;
65 int index_ct_tl_;
66 int index_ct_dl_;
68 int ct_size_;
69 int d_size_;
71
72 int l_size_max_;
73 std::vector<double> l_;
74 std::vector<std::vector<int>> l_max_ct_;
79 std::vector<int> l_max_;
84 int l_max_tot_;
90 private:
91 void spectra_init();
92 void spectra_indices();
93 void spectra_cls();
94 void spectra_compute_cl(int index_md,
95 int index_ic1,
96 int index_ic2,
97 int index_l,
98 int cl_integrand_num_columns,
99 double* cl_integrand,
100 double* primordial_pk_cached,
101 double* transfer_ic1,
102 double* transfer_ic2);
103 int spectra_k_and_tau();
104 /* deprecated functions (since v2.8) */
105 void spectra_pk_at_z(enum linear_or_logarithmic mode,
106 double z,
107 double* output_tot,
108 double* output_ic,
109 double* output_cb_tot,
110 double* output_cb_ic);
111 void spectra_pk_at_k_and_z(
112 double k, double z, double* pk, double* pk_ic, double* pk_cb, double* pk_cb_ic);
113 void spectra_pk_nl_at_z(enum linear_or_logarithmic mode,
114 double z,
115 double* output_tot,
116 double* output_cb_tot);
117 void spectra_pk_nl_at_k_and_z(double k, double z, double* pk_tot, double* pk_cb_tot);
118 void spectra_fast_pk_at_kvec_and_zvec(double* kvec,
119 int kvec_size,
120 double* zvec,
121 int zvec_size,
122 double* pk_tot_out,
123 double* pk_cb_tot_out,
124 int nonlinear);
125 void spectra_sigma(double R, double z, double* sigma);
126 void spectra_sigma_cb(double R, double z, double* sigma_cb);
127 /* deprecated functions (since v2.1) */
128 void spectra_tk_at_z(double z, double* output);
129 void spectra_tk_at_k_and_z(double k, double z, double* output);
130
131 PerturbationsModulePtr perturbations_module_;
132 PrimordialModulePtr primordial_module_;
133 NonlinearModulePtr nonlinear_module_;
134 TransferModulePtr transfer_module_;
135
136 int index_md_scalars_;
141
142 std::vector<int>
143 l_size_;
145 std::vector<std::vector<double>>
146 cl_;
147 std::vector<std::vector<double>>
148 ddcl_;
151};
152
153#endif //SPECTRA_MODULE_H
Definition nonlinear.h:49
Definition output.h:24
linear_or_logarithmic
Definition primordial.h:23