21#include "exceptions.h"
24class BackgroundModule;
25class ThermodynamicsModule;
26class PerturbationsModule;
27class PrimordialModule;
34using InputModulePtr = std::shared_ptr<const InputModule>;
35using BackgroundModulePtr = std::shared_ptr<const BackgroundModule>;
36using ThermodynamicsModulePtr = std::shared_ptr<const ThermodynamicsModule>;
37using PerturbationsModulePtr = std::shared_ptr<const PerturbationsModule>;
38using PrimordialModulePtr = std::shared_ptr<const PrimordialModule>;
39using NonlinearModulePtr = std::shared_ptr<const NonlinearModule>;
40using TransferModulePtr = std::shared_ptr<const TransferModule>;
41using SpectraModulePtr = std::shared_ptr<const SpectraModule>;
42using LensingModulePtr = std::shared_ptr<const LensingModule>;
61#define _QUADRATURE_MAX_ \
64#define _QUADRATURE_MAX_BG_ \
69#define _EPSILON_ 1.e-10
71#define _OUTPUTPRECISION_ 12
73#define _COLUMNWIDTH_ \
76#define _DELIMITER_ "\t"
85inline int index_symmetric_matrix(
int i1,
int i2,
int N) {
86 return (i1 <= i2) ? (i2 + N * i1 - (i1 * (i1 + 1)) / 2) : (i1 + N * i2 - (i2 * (i2 + 1)) / 2);
92#define class_define_index(index, condition, running_index, number_of_indices) \
95 (index) = running_index; \
96 (running_index) += (number_of_indices); \
101#define class_fprintf_double(file, output, condition) \
104 fprintf(file, "%*.*e ", _COLUMNWIDTH_, _OUTPUTPRECISION_, output); \
107#define class_fprintf_int(file, output, condition) \
112 std::max(0, _COLUMNWIDTH_ - _OUTPUTPRECISION_ - 5), \
114 _OUTPUTPRECISION_ + 5, \
118#define class_fprintf_columntitle(file, title, condition, colnum) \
124 std::min(_COLUMNWIDTH_ - _OUTPUTPRECISION_ - 6 - 3, \
125 _COLUMNWIDTH_ - ((int) strlen(title)) - 3)), \
128 _OUTPUTPRECISION_ + 6, \
132#define class_store_columntitle(titlestring, title, condition) \
135 (titlestring) += (title); \
136 (titlestring) += _DELIMITER_; \
140#define class_store_double(storage, value, condition, dataindex) \
143 (storage)[(dataindex)++] = value; \
146#define class_store_double_or_default(storage, value, condition, dataindex, defaultvalue) \
149 (storage)[(dataindex)++] = value; \
151 (storage)[(dataindex)++] = defaultvalue; \
158int get_number_of_titles(
const std::string& titlestring);
162std::string first_duplicate_title(
const std::string& titlestring);