1 #include "InterpSolutionIterator.h" 7 while(node_index < spline->n - 1 && !found) {
12 coef[0]-
y, coef[1], coef[2], coef[3]);
14 for(
size_t sol_i=0; sol_i<cubic_sol.size(); sol_i++) {
15 double sol_value=cubic_sol[sol_i];
16 if(sol_value>-tolerance && sol_value<max_x+tolerance
18 solutions.back()<sol_value+x0-tolerance)) {
39 const alglib::spline1dinterpolant &spline_var,
41 double min_sol_distance
43 spline(spline_var.c_ptr()),
bool is_out_of_range
Whether we have gone past the last solution or before the first.
bool operator!=(const InterpSolutionIterator &rhs) const
The opposite of operator==.
bool operator==(const InterpSolutionIterator &rhs) const
Checks if this iterator is at the same solution of the same spline as rhs.
const double & operator*() const
Returns the current solution.
std::valarray< double > solve_cubic(double c0, double c1, double c2, double c3)
Solves the cubic equation .
An iterator over a set of solutions to an interpolating function.
InterpSolutionIterator & operator--()
Go to the previous solution.
const alglib_impl::spline1dinterpolant * spline
The ALGLIB spline.
bool out_of_range() const
Whether we have gone past the last solution or before the first.
std::list< double >::const_iterator solution_iter
An iterator over the list of solutions found so far.
InterpSolutionIterator & operator++()
Go to the next solution.
double y
Iterate over abscissas when the interpolation=y.
double min_diff
Controls when solutions are considered distinct.
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.
void get_solutions()
Find another set of solutions.