1 #include "SerializableSpline1dInterpolant.h" 4 std::string alglib_dtype_name(alglib_impl::ae_datatype dtype)
7 case alglib_impl::DT_BOOL:
return "bool";
8 case alglib_impl::DT_INT:
return "int";
9 case alglib_impl::DT_REAL:
return "real";
10 case alglib_impl::DT_COMPLEX :
return "complex";
11 default :
return "unknown: " + std::to_string(dtype);
15 std::ostream &operator<<(std::ostream &os,
18 alglib_impl::spline1dinterpolant *interp_impl =
19 const_cast<alglib_impl::spline1dinterpolant *
>(interp.c_ptr());
21 os <<
"\tperiodic: " << interp_impl->periodic << std::endl
22 <<
"\tn: " << interp_impl->n << std::endl
23 <<
"\tk: " << interp_impl->k << std::endl;
25 os <<
"\tc.cnt: " << interp_impl->c.cnt << std::endl
27 << alglib_dtype_name(interp_impl->c.datatype)
29 <<
"\tc.is_attached: " << interp_impl->c.is_attached << std::endl
30 <<
"\tc.ptr.p_double (@ " << interp_impl->c.ptr.p_double <<
"):";
31 for(
int i = 0; i < 4; ++i)
32 os <<
" " << interp_impl->c.ptr.p_double[i];
35 os <<
"\tx.cnt: " << interp_impl->x.cnt << std::endl
37 << alglib_dtype_name(interp_impl->x.datatype)
39 <<
"\tx.is_attached: " << interp_impl->x.is_attached << std::endl
40 <<
"\tx.ptr.p_double (@ " << interp_impl->x.ptr.p_double <<
"):";
41 for(
int i = 0; i < 2; ++i)
42 os <<
" " << interp_impl->x.ptr.p_double[i];
47 std::ostream &operator<<(std::ostream &os,
48 const alglib::real_1d_array &array)
50 os <<
"len: " << array.length()
51 <<
", @: " << array.getcontent()
53 for(
int i = 0; i<3; ++i) os <<
" " << array[i];
A serializable (using boost serialization) alglib 1D interpolant.