An iterator over a set of solutions to an interpolating function. More...
#include <InterpSolutionIterator.h>
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... | |
InterpSolutionIterator & | operator++ () |
Go to the next solution. More... | |
InterpSolutionIterator | operator++ (int) |
Go to the next solution. More... | |
InterpSolutionIterator & | operator-- () |
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... | |
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.
|
inline |
Default constructor of a non meaningful object.
Definition at line 59 of file InterpSolutionIterator.h.
Core::InterpSolutionIterator::InterpSolutionIterator | ( | const InterpSolutionIterator & | rhs | ) |
Copy constructor.
Definition at line 28 of file InterpSolutionIterator.cpp.
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.
|
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.
bool Core::InterpSolutionIterator::operator!= | ( | const InterpSolutionIterator & | rhs | ) | const |
The opposite of operator==.
Definition at line 99 of file InterpSolutionIterator.cpp.
const double & Core::InterpSolutionIterator::operator* | ( | ) | const |
Returns the current solution.
Definition at line 86 of file InterpSolutionIterator.cpp.
InterpSolutionIterator & Core::InterpSolutionIterator::operator++ | ( | ) |
Go to the next solution.
Definition at line 53 of file InterpSolutionIterator.cpp.
InterpSolutionIterator Core::InterpSolutionIterator::operator++ | ( | int | ) |
Go to the next solution.
Definition at line 65 of file InterpSolutionIterator.cpp.
InterpSolutionIterator & Core::InterpSolutionIterator::operator-- | ( | ) |
Go to the previous solution.
Definition at line 72 of file InterpSolutionIterator.cpp.
InterpSolutionIterator Core::InterpSolutionIterator::operator-- | ( | int | ) |
Go to the previous solution.
Definition at line 79 of file InterpSolutionIterator.cpp.
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.
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.
|
private |
Whether we have gone past the last solution or before the first.
Definition at line 48 of file InterpSolutionIterator.h.
|
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.
|
private |
The node up to which solutions have been reported.
Definition at line 29 of file InterpSolutionIterator.h.
|
private |
An iterator over the list of solutions found so far.
Definition at line 41 of file InterpSolutionIterator.h.
|
private |
The list of solutions found so far.
Definition at line 44 of file InterpSolutionIterator.h.
|
private |
The ALGLIB spline.
Definition at line 26 of file InterpSolutionIterator.h.
|
private |
Iterate over abscissas when the interpolation=y.
Definition at line 35 of file InterpSolutionIterator.h.