1 #ifndef __SERIALIZABLE_SPLINE_1D_INTERPOLANT_H 2 #define __SERIALIZABLE_SPLINE_1D_INTERPOLANT_H 4 #include "../Core/SharedLibraryExportMacros.h" 5 #include "../third_party_libs/alglib/alglib/src/interpolation.h" 7 #include <boost/serialization/base_object.hpp> 8 #include <boost/archive/text_oarchive.hpp> 9 #include <boost/archive/text_iarchive.hpp> 10 #include <boost/serialization/export.hpp> 16 public alglib::spline1dinterpolant
19 friend class boost::serialization::access;
26 template<
class Archive>
void serialize(
36 friend std::ostream &operator<<(
46 std::ostream &operator<<(
51 const alglib::real_1d_array &array);
58 ar & p_struct->periodic;
62 ar & p_struct->c.datatype;
64 ar & p_struct->x.datatype;
65 if (Archive::is_loading::value) {
66 using namespace alglib_impl;
68 ae_vector_init(&p_struct->c,
69 (p_struct->n - 1) * 4 + 2,
72 ae_vector_init(&p_struct->x,
79 node_index < p_struct->n - 1;
82 double *coef=(p_struct->c.ptr.p_double + 4 * node_index);
83 ar & coef[0] & coef[1] & coef[2] & coef[3];
84 ar & p_struct->x.ptr.p_double[node_index];
86 ar & p_struct->x.ptr.p_double[p_struct->n - 1];
A serializable (using boost serialization) alglib 1D interpolant.
void serialize(Archive &ar, const unsigned int)