Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
Core::InterpSolutionIterator Class Reference

An iterator over a set of solutions to an interpolating function. More...

#include <InterpSolutionIterator.h>

+ Inheritance diagram for Core::InterpSolutionIterator:
+ Collaboration diagram for Core::InterpSolutionIterator:

Public Member Functions

 InterpSolutionIterator ()
 Default constructor of a non meaningful object. More...
 
 InterpSolutionIterator (const InterpSolutionIterator &rhs)
 Copy constructor. More...
 
 InterpSolutionIterator (const alglib::spline1dinterpolant &spline_var, double offset, double min_sol_distance=1e-8)
 Start iterating over the solutions of the given spline. More...
 
InterpSolutionIteratoroperator++ ()
 Go to the next solution. More...
 
InterpSolutionIterator operator++ (int)
 Go to the next solution. More...
 
InterpSolutionIteratoroperator-- ()
 Go to the previous solution. More...
 
InterpSolutionIterator operator-- (int)
 Go to the previous solution. More...
 
const double & operator* () const
 Returns the current solution. More...
 
bool operator== (const InterpSolutionIterator &rhs) const
 Checks if this iterator is at the same solution of the same spline as rhs. More...
 
bool operator!= (const InterpSolutionIterator &rhs) const
 The opposite of operator==. More...
 
bool out_of_range () const
 Whether we have gone past the last solution or before the first. More...
 

Private Member Functions

void get_solutions ()
 Find another set of solutions. More...
 

Private Attributes

const alglib_impl::spline1dinterpolant * spline
 The ALGLIB spline. More...
 
int node_index
 The node up to which solutions have been reported. More...
 
double min_diff
 Controls when solutions are considered distinct. More...
 
double y
 Iterate over abscissas when the interpolation=y. More...
 
std::list< double >::const_iterator solution_iter
 An iterator over the list of solutions found so far. More...
 
std::list< double > solutions
 The list of solutions found so far. More...
 
bool is_out_of_range
 Whether we have gone past the last solution or before the first. More...
 

Detailed Description

An iterator over a set of solutions to an interpolating function.

Iterates over all abscissas where the intepolating function takes a pre-determined value, merging solutions that are too close together.

Works by adding solutions between later and later pairs of consecutive interpolation nodes whenever it runs out of found solutions and the next solution is requested.

Definition at line 20 of file InterpSolutionIterator.h.

Constructor & Destructor Documentation

◆ InterpSolutionIterator() [1/3]

Core::InterpSolutionIterator::InterpSolutionIterator ( )
inline

Default constructor of a non meaningful object.

Definition at line 59 of file InterpSolutionIterator.h.

◆ InterpSolutionIterator() [2/3]

Core::InterpSolutionIterator::InterpSolutionIterator ( const InterpSolutionIterator rhs)

Copy constructor.

Definition at line 28 of file InterpSolutionIterator.cpp.

◆ InterpSolutionIterator() [3/3]

Core::InterpSolutionIterator::InterpSolutionIterator ( const alglib::spline1dinterpolant &  spline_var,
double  offset,
double  min_sol_distance = 1e-8 
)

Start iterating over the solutions of the given spline.

Definition at line 38 of file InterpSolutionIterator.cpp.

Member Function Documentation

◆ get_solutions()

void Core::InterpSolutionIterator::get_solutions ( )
private

Find another set of solutions.

Adds the solutions between the the present node and the next (or the closest node after it if there are none) to the end of solutions, incrementing the node to one past the node from which solutions were added.

Definition at line 4 of file InterpSolutionIterator.cpp.

◆ operator!=()

bool Core::InterpSolutionIterator::operator!= ( const InterpSolutionIterator rhs) const

The opposite of operator==.

Definition at line 99 of file InterpSolutionIterator.cpp.

◆ operator*()

const double & Core::InterpSolutionIterator::operator* ( ) const

Returns the current solution.

Definition at line 86 of file InterpSolutionIterator.cpp.

◆ operator++() [1/2]

InterpSolutionIterator & Core::InterpSolutionIterator::operator++ ( )

Go to the next solution.

Definition at line 53 of file InterpSolutionIterator.cpp.

◆ operator++() [2/2]

InterpSolutionIterator Core::InterpSolutionIterator::operator++ ( int  )

Go to the next solution.

Definition at line 65 of file InterpSolutionIterator.cpp.

◆ operator--() [1/2]

InterpSolutionIterator & Core::InterpSolutionIterator::operator-- ( )

Go to the previous solution.

Definition at line 72 of file InterpSolutionIterator.cpp.

◆ operator--() [2/2]

InterpSolutionIterator Core::InterpSolutionIterator::operator-- ( int  )

Go to the previous solution.

Definition at line 79 of file InterpSolutionIterator.cpp.

◆ operator==()

bool Core::InterpSolutionIterator::operator== ( const InterpSolutionIterator rhs) const

Checks if this iterator is at the same solution of the same spline as rhs.

Definition at line 91 of file InterpSolutionIterator.cpp.

◆ out_of_range()

bool Core::InterpSolutionIterator::out_of_range ( ) const

Whether we have gone past the last solution or before the first.

Definition at line 106 of file InterpSolutionIterator.cpp.

Member Data Documentation

◆ is_out_of_range

bool Core::InterpSolutionIterator::is_out_of_range
private

Whether we have gone past the last solution or before the first.

Definition at line 48 of file InterpSolutionIterator.h.

◆ min_diff

double Core::InterpSolutionIterator::min_diff
private

Controls when solutions are considered distinct.

Solutions that differ by less than min_diff fraction of the distance between two nodes are treated as a single solution.

Definition at line 35 of file InterpSolutionIterator.h.

◆ node_index

int Core::InterpSolutionIterator::node_index
private

The node up to which solutions have been reported.

Definition at line 29 of file InterpSolutionIterator.h.

◆ solution_iter

std::list<double>::const_iterator Core::InterpSolutionIterator::solution_iter
private

An iterator over the list of solutions found so far.

Definition at line 41 of file InterpSolutionIterator.h.

◆ solutions

std::list<double> Core::InterpSolutionIterator::solutions
private

The list of solutions found so far.

Definition at line 44 of file InterpSolutionIterator.h.

◆ spline

const alglib_impl::spline1dinterpolant* Core::InterpSolutionIterator::spline
private

The ALGLIB spline.

Definition at line 26 of file InterpSolutionIterator.h.

◆ y

double Core::InterpSolutionIterator::y
private

Iterate over abscissas when the interpolation=y.

Definition at line 35 of file InterpSolutionIterator.h.


The documentation for this class was generated from the following files: