Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
InterpSolutionIterator.h
1 #ifndef __INTERP_SOLUTION_ITERATOR_H
2 #define __INTERP_SOLUTION_ITERATOR_H
3 
4 #include "../Core/SharedLibraryExportMacros.h"
5 #include "SerializableSpline1dInterpolant.h"
6 
7 #include "Common.h"
8 #include <valarray>
9 
10 namespace Core {
20  class LIB_LOCAL InterpSolutionIterator :
21  public std::iterator<std::input_iterator_tag, double, ptrdiff_t,
22  const double*, const double&>
23  {
24  private:
26  const alglib_impl::spline1dinterpolant *spline;
27 
30 
35  double min_diff,
36 
38  y;
39 
41  std::list<double>::const_iterator solution_iter;
42 
44  std::list<double> solutions;
45 
49 
56  void get_solutions();
57  public:
60 
63 
66  const alglib::spline1dinterpolant &spline_var,
67  double offset, double min_sol_distance=1e-8
68  );
69 
71  InterpSolutionIterator &operator++();
72 
74  InterpSolutionIterator operator++(int);
75 
77  InterpSolutionIterator &operator--();
78 
80  InterpSolutionIterator operator--(int);
81 
83  const double &operator*() const;
84 
87  bool operator==(const InterpSolutionIterator &rhs) const;
88 
90  bool operator!=(const InterpSolutionIterator &rhs) const;
91 
94  bool out_of_range() const;
95  }; //End InterpSolutionIterator class.
96 
97 } //End Core namespace.
98 
99 #endif
100 
101 
bool is_out_of_range
Whether we have gone past the last solution or before the first.
An iterator over a set of solutions to an interpolating function.
const alglib_impl::spline1dinterpolant * spline
The ALGLIB spline.
std::list< double >::const_iterator solution_iter
An iterator over the list of solutions found so far.
double y
Iterate over abscissas when the interpolation=y.
Declaration of some general purpose utilities.
InterpSolutionIterator()
Default constructor of a non meaningful object.
int node_index
The node up to which solutions have been reported.
std::list< double > solutions
The list of solutions found so far.