Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
SerializableSpline1dInterpolant.cpp
1 #include "SerializableSpline1dInterpolant.h"
2 
3 namespace Core {
4  std::string alglib_dtype_name(alglib_impl::ae_datatype dtype)
5  {
6  switch(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);
12  }
13  }
14 
15  std::ostream &operator<<(std::ostream &os,
16  const SerializableSpline1dInterpolant &interp)
17  {
18  alglib_impl::spline1dinterpolant *interp_impl =
19  const_cast<alglib_impl::spline1dinterpolant *>(interp.c_ptr());
20 
21  os << "\tperiodic: " << interp_impl->periodic << std::endl
22  << "\tn: " << interp_impl->n << std::endl
23  << "\tk: " << interp_impl->k << std::endl;
24 
25  os << "\tc.cnt: " << interp_impl->c.cnt << std::endl
26  << "\tc.datatype: "
27  << alglib_dtype_name(interp_impl->c.datatype)
28  << std::endl
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];
33  os << std::endl;
34 
35  os << "\tx.cnt: " << interp_impl->x.cnt << std::endl
36  << "\tx.datatype: "
37  << alglib_dtype_name(interp_impl->x.datatype)
38  << std::endl
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];
43  os << std::endl;
44  return os;
45  }
46 
47  std::ostream &operator<<(std::ostream &os,
48  const alglib::real_1d_array &array)
49  {
50  os << "len: " << array.length()
51  << ", @: " << array.getcontent()
52  << ":";
53  for(int i = 0; i<3; ++i) os << " " << array[i];
54  return os;
55  }
56 
57 } //End Core namespace.
A serializable (using boost serialization) alglib 1D interpolant.