CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
arrays.h
1
5#ifndef __ARRAYS__
6#define __ARRAYS__
7
8#include <vector>
9
10#include "common.h"
11
12#ifdef _WIN32
13#define _restrict
14#endif
15
16#define _SPLINE_NATURAL_ 0
17#define _SPLINE_EST_DERIV_ 1
19void array_derive_spline(const double* x_array,
20 int n_lines,
21 double* array,
22 const double* array_splined,
23 int n_columns,
24 int index_y,
25 int index_dydx);
26
27void array_derive_spline_table_line_to_line(const double* x_array,
28 int n_lines,
29 double* array,
30 int n_columns,
31 int index_y,
32 int index_ddy,
33 int index_dy);
34
35void array_spline(double* array,
36 int n_columns,
37 int n_lines,
38 int index_x,
39 int index_y,
40 int index_ddydx2,
41 short spline_mode);
42
43void array_spline_table_line_to_line(const double* x, /* vector of size x_size */
44 int x_size,
45 double* array,
46 int n_columns,
47 int index_y,
48 int index_ddydx2,
49 short spline_mode);
50
51void array_spline_table_columns(const double* x,
52 int x_size,
53 const double* y_array,
54 int y_size,
55 double* ddy_array,
56 short spline_mode);
57
58void array_spline_table_columns2(const double* x,
59 int x_size,
60 const double* y_array,
61 int y_size,
62 double* ddy_array,
63 short spline_mode);
64
65void array_spline_table_lines(const double* x,
66 int x_size,
67 const double* y_array,
68 int y_size,
69 double* ddy_array,
70 short spline_mode);
71
72void array_integrate_all_spline(const double* array,
73 int n_columns,
74 int n_lines,
75 int index_x,
76 int index_y,
77 int index_ddy,
78 double* result);
79
80void array_integrate_all_trapzd_or_spline(const double* array,
81 int n_columns,
82 int n_lines,
83 int index_start_spline,
84 int index_x,
85 int index_y,
86 int index_ddy,
87 double* result);
88
89void array_integrate_spline_table_line_to_line(const double* x_array,
90 int n_lines,
91 double* array,
92 int n_columns,
93 int index_y,
94 int index_ddy,
95 int index_inty);
96
97void array_interpolate_spline(const double* x_array,
98 int n_lines,
99 const double* array,
100 const double* array_splined,
101 int n_columns,
102 double x,
103 int* last_index,
104 double* result,
105 int result_size);
107void array_search_bisect(int n_lines, const double* array, double c, int* last_index);
108
109void array_interpolate_linear(const double* x_array,
110 int n_lines,
111 const double* array,
112 int n_columns,
113 double x,
114 int* last_index,
115 double* result,
116 int result_size);
118void array_interpolate_one_growing_closeby(const double* array,
119 int n_columns,
120 int n_lines,
121 int index_x,
122 double x,
123 int* last_index,
124 int index_y,
125 double* result);
126
127void array_interpolate_spline_growing_closeby(const double* x_array,
128 int n_lines,
129 const double* array,
130 const double* array_splined,
131 int n_columns,
132 double x,
133 int* last_index,
134 double* result,
135 int result_size);
137void array_interpolate_two(const double* array_x,
138 int n_columns_x,
139 int index_x,
140 const double* array_y,
141 int n_lines,
142 double x,
143 double* result,
144 int result_size);
145
146void array_interpolate_two_bis(const double* array_x,
147 int n_columns_x,
148 int index_x,
149 const double* array_y,
150 int n_columns_y,
151 int n_lines,
152 double x,
153 double* result,
154 int result_size);
156void array_interpolate_two_arrays_one_column(
157 const double* array_x, /* assumed to be a vector (i.e. one column array) */
158 const double* array_y,
159 int index_y,
160 int n_lines,
161 double x,
162 double* result);
163
164void array_interpolate_cubic_equal(
165 double x0, double dx, const double* yarray, int Nx, double x, double* result);
166
167void array_interpolate_parabola(double x1,
168 double x2,
169 double x3,
170 double x,
171 double y1,
172 double y2,
173 double y3,
174 double* y,
175 double* dy,
176 double* ddy);
177
178void array_smooth(double* array,
179 int n_columns,
180 int n_lines,
181 int index,
182 int radius);
183
184void array_trapezoidal_mweights(const double* x, int n, double* w_trapz);
185
186void array_trapezoidal_integral(const double* integrand, int n, const double* w_trapz, double* I);
187
188void array_trapezoidal_convolution(
189 const double* integrand1, const double* integrand2, int n, const double* w_trapz, double* I);
190
191#endif