1 #define BUILDING_LIBRARY 6 double mass_feh_interp(
7 const alglib::real_1d_array &interp_masses,
8 const alglib::real_1d_array &interp_feh,
9 const alglib::real_1d_array &interp_values,
14 assert(interp_masses.length() * interp_feh.length()
16 interp_values.length());
18 if(interp_values.length() == 1) {
19 return interp_values[0];
20 }
else if(interp_masses.length() == 1) {
21 alglib::spline1dinterpolant spline;
22 alglib::spline1dbuildcubic(interp_feh,
25 return alglib::spline1dcalc(spline, stellar_feh);
26 }
else if(interp_feh.length() == 1) {
27 alglib::spline1dinterpolant spline;
28 alglib::spline1dbuildcubic(interp_masses,
31 return alglib::spline1dcalc(spline, stellar_mass);
33 alglib::spline2dinterpolant spline;
34 alglib::spline2dbuildbicubicv(interp_masses,
35 interp_masses.length(),
41 return alglib::spline2dcalc(spline,
Define a single function performing mass-[Fe/H] interpolations.