Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
Evolve::StopHistoryInterval Class Reference

A collection of accepted and discarded evolution steps which contain some reason to stop. More...

#include <StopHistoryInterval.h>

+ Collaboration diagram for Evolve::StopHistoryInterval:

Public Member Functions

 StopHistoryInterval (size_t num_points=0, std::list< double >::const_iterator first_age=std::list< double >::const_iterator(), std::list< double >::const_iterator history_age_end=std::list< double >::const_iterator(), std::list< double >::const_iterator discarded_age_begin=std::list< double >::const_iterator(), std::list< std::valarray< double > >::const_iterator first_stop_cond=std::list< std::valarray< double > >::const_iterator(), std::list< std::valarray< double > >::const_iterator stop_cond_history_end=std::list< std::valarray< double > >::const_iterator(), std::list< std::valarray< double > >::const_iterator stop_cond_discarded_begin=std::list< std::valarray< double > >::const_iterator(), std::list< std::valarray< double > >::const_iterator first_stop_deriv=std::list< std::valarray< double > >::const_iterator(), std::list< std::valarray< double > >::const_iterator stop_deriv_history_end=std::list< std::valarray< double > >::const_iterator(), std::list< std::valarray< double > >::const_iterator stop_deriv_discarded_begin=std::list< std::valarray< double > >::const_iterator())
 Construct an interval of steps with some reason to stop the evolution. More...
 
 StopHistoryInterval (const StopHistoryInterval &orig)
 Copy orig to *this. More...
 
void reset ()
 Makes the current point the first point in the interval. More...
 
StopHistoryIntervaloperator++ ()
 Advances to the next point in the interval. More...
 
StopHistoryInterval operator++ (int)
 Advances to the next point in the interval. More...
 
StopHistoryIntervaloperator-- ()
 Advances to the next point in the interval. More...
 
StopHistoryInterval operator-- (int)
 Advances to the next point in the interval. More...
 
StopHistoryIntervaloperator<< (size_t n)
 Moves the entire interval, along with the current point left n points. More...
 
StopHistoryIntervaloperator>> (size_t n)
 Moves the entire interval, along with the current point right n points. More...
 
StopHistoryIntervaloperator= (const StopHistoryInterval &rhs)
 Copies rhs to this. More...
 
bool operator== (const StopHistoryInterval &rhs)
 Checks if the RHS is the same interval and is at the same point in it. More...
 
void grow_left (size_t n=1)
 Adds the n points before the first point to the interval. More...
 
void grow_right (size_t n=1)
 Adds the n points before the first point to the interval. More...
 
size_t num_points ()
 Returns the number of points in the interval. More...
 
size_t current_point_index ()
 Returns the index of the current point within the interval. More...
 
size_t number_conditions ()
 Returns the number of conditions at the first point. More...
 
bool end ()
 Returns true iff this is the invalid point marking the end of the interval. More...
 
double first_age () const
 Returns the age of the first point in the interval. More...
 
double last_age () const
 Returns the age of the last point in the interval. More...
 
double age () const
 Returns the age of the current point. More...
 
double first_stop_condition_value (size_t condition_index) const
 Returns the value of the stop condition with the given index for the first point in the interval. More...
 
double last_stop_condition_value (size_t condition_index) const
 Returns the value of the stop condition with the given index for the last point in the interval. More...
 
double stop_condition_value (size_t condition_index) const
 Returns the value of the stop condition with the given index for the current point. More...
 
double first_stop_condition_deriv (size_t condition_index) const
 Returns the derivative of the stop condition with the given index for the first point in the interval. More...
 
double last_stop_condition_deriv (size_t condition_index) const
 Returns the derivative of the stop condition with the given index for the last point in the interval. More...
 
double stop_condition_deriv (size_t condition_index) const
 Returns the derivative of the stop condition with the given index for the current point. More...
 

Private Member Functions

void advance_iterator_set (std::list< double >::const_iterator &age_i, std::list< std::valarray< double > >::const_iterator &cond_i, std::list< std::valarray< double > >::const_iterator &deriv_i)
 Increments all the iterators passed as arguments. More...
 
void retreat_iterator_set (std::list< double >::const_iterator &age_i, std::list< std::valarray< double > >::const_iterator &cond_i, std::list< std::valarray< double > >::const_iterator &deriv_i)
 Decrements all the iterators passed as arguments. More...
 

Private Attributes

size_t __num_points
 Number of points in the interval. More...
 
size_t __point_i
 The index of the current point. More...
 
std::list< double >::const_iterator __first_age
 The first age in the interval. More...
 
std::list< double >::const_iterator __last_age
 The last age in the interval. More...
 
std::list< double >::const_iterator __history_age_end
 The one past last element of the history of stoppnig condition ages. More...
 
std::list< double >::const_iterator __discarded_age_begin
 The first age in the discarded stopping conditions. More...
 
std::list< double >::const_iterator __age_i
 The age of the current point. More...
 
std::list< std::valarray< double > >::const_iterator __first_stop_cond
 The first stopping condition value in the interval. More...
 
std::list< std::valarray< double > >::const_iterator __last_stop_cond
 The last stopping condition value in the interval. More...
 
std::list< std::valarray< double > >::const_iterator __stop_cond_history_end
 The one past last element of the history of stoppnig conditions. More...
 
std::list< std::valarray< double > >::const_iterator __stop_cond_discarded_begin
 The first of the discarded stopping condition values. More...
 
std::list< std::valarray< double > >::const_iterator __stop_cond_i
 The current stopping condition value. More...
 
std::list< std::valarray< double > >::const_iterator __first_stop_deriv
 The first stopping condition derivative in the interval. More...
 
std::list< std::valarray< double > >::const_iterator __last_stop_deriv
 The last stopping condition derivative in the interval. More...
 
std::list< std::valarray< double > >::const_iterator __stop_deriv_history_end
 The one past last element of the history of stoppnig conditions. More...
 
std::list< std::valarray< double > >::const_iterator __stop_deriv_discarded_begin
 The first of the discarded stopping condition values. More...
 
std::list< std::valarray< double > >::const_iterator __stop_deriv_i
 The current stop condition derivative. More...
 

Detailed Description

A collection of accepted and discarded evolution steps which contain some reason to stop.

Generally tracks iterators over the stored evolution history and discarded values during the evolution calculations. One particular wrinkle is that this class deals with the possibility that step sizes can be driven to very small values by some other precision requirements leading to stopping condition values that differ only by numerical errors in their calculations causing real extrema to be missed or creating fake ones. To handle this, values that differ by less than some precsibed amount (see numerical_roundoff_factor argument to the constructor) are treated as a single value equal to their average.

Definition at line 35 of file StopHistoryInterval.h.

Constructor & Destructor Documentation

◆ StopHistoryInterval() [1/2]

Evolve::StopHistoryInterval::StopHistoryInterval ( size_t  num_points = 0,
std::list< double >::const_iterator  first_age = std::list<double>::const_iterator(),
std::list< double >::const_iterator  history_age_end = std::list<double>::const_iterator(),
std::list< double >::const_iterator  discarded_age_begin = std::list<double>::const_iterator(),
std::list< std::valarray< double > >::const_iterator  first_stop_cond = std::list< std::valarray<double> >::const_iterator(),
std::list< std::valarray< double > >::const_iterator  stop_cond_history_end = std::list< std::valarray<double> >::const_iterator(),
std::list< std::valarray< double > >::const_iterator  stop_cond_discarded_begin = std::list< std::valarray<double> >::const_iterator(),
std::list< std::valarray< double > >::const_iterator  first_stop_deriv = std::list< std::valarray<double> >::const_iterator(),
std::list< std::valarray< double > >::const_iterator  stop_deriv_history_end = std::list< std::valarray<double> >::const_iterator(),
std::list< std::valarray< double > >::const_iterator  stop_deriv_discarded_begin = std::list< std::valarray<double> >::const_iterator() 
)

Construct an interval of steps with some reason to stop the evolution.

Parameters
num_pointsThe number of points in the interval.
first_ageAn iterator pointing to the first age in the interval.
history_age_endAn iterator pointing to one past the last age in the history.
discarded_age_beginAn iterator pointing to the first age in the discarded list.
first_stop_condAn iterator pointing to the first stopping condition in the interval.
stop_cond_history_endAn iterator pointing to one past the last stopping condition in the history.
stop_cond_discarded_beginAn iterator pointing to the first stopping condition in the discarded list.
first_stop_derivAn iterator pointing to the first stopping derivative in the interval.
stop_deriv_history_endAn iterator pointing to one past the last stopping derivative in the history.
stop_deriv_discarded_beginAn iterator pointing to the first stopping derivative in the discarded list.

Definition at line 45 of file StopHistoryInterval.cpp.

◆ StopHistoryInterval() [2/2]

Evolve::StopHistoryInterval::StopHistoryInterval ( const StopHistoryInterval orig)

Copy orig to *this.

Definition at line 90 of file StopHistoryInterval.cpp.

Member Function Documentation

◆ advance_iterator_set()

void Evolve::StopHistoryInterval::advance_iterator_set ( std::list< double >::const_iterator &  age_i,
std::list< std::valarray< double > >::const_iterator &  cond_i,
std::list< std::valarray< double > >::const_iterator &  deriv_i 
)
private

Increments all the iterators passed as arguments.

Takes care of the switch from history to discarded if necessary.

Definition at line 13 of file StopHistoryInterval.cpp.

◆ age()

double Evolve::StopHistoryInterval::age ( ) const
inline

Returns the age of the current point.

Definition at line 229 of file StopHistoryInterval.h.

◆ current_point_index()

size_t Evolve::StopHistoryInterval::current_point_index ( )
inline

Returns the index of the current point within the interval.

Definition at line 213 of file StopHistoryInterval.h.

◆ end()

bool Evolve::StopHistoryInterval::end ( )
inline

Returns true iff this is the invalid point marking the end of the interval.

Definition at line 220 of file StopHistoryInterval.h.

◆ first_age()

double Evolve::StopHistoryInterval::first_age ( ) const
inline

Returns the age of the first point in the interval.

Definition at line 223 of file StopHistoryInterval.h.

◆ first_stop_condition_deriv()

double Evolve::StopHistoryInterval::first_stop_condition_deriv ( size_t  condition_index) const
inline

Returns the derivative of the stop condition with the given index for the first point in the interval.

Definition at line 248 of file StopHistoryInterval.h.

◆ first_stop_condition_value()

double Evolve::StopHistoryInterval::first_stop_condition_value ( size_t  condition_index) const
inline

Returns the value of the stop condition with the given index for the first point in the interval.

Definition at line 233 of file StopHistoryInterval.h.

◆ grow_left()

void Evolve::StopHistoryInterval::grow_left ( size_t  n = 1)

Adds the n points before the first point to the interval.

Definition at line 220 of file StopHistoryInterval.cpp.

◆ grow_right()

void Evolve::StopHistoryInterval::grow_right ( size_t  n = 1)

Adds the n points before the first point to the interval.

Definition at line 230 of file StopHistoryInterval.cpp.

◆ last_age()

double Evolve::StopHistoryInterval::last_age ( ) const
inline

Returns the age of the last point in the interval.

Definition at line 226 of file StopHistoryInterval.h.

◆ last_stop_condition_deriv()

double Evolve::StopHistoryInterval::last_stop_condition_deriv ( size_t  condition_index) const
inline

Returns the derivative of the stop condition with the given index for the last point in the interval.

Definition at line 253 of file StopHistoryInterval.h.

◆ last_stop_condition_value()

double Evolve::StopHistoryInterval::last_stop_condition_value ( size_t  condition_index) const
inline

Returns the value of the stop condition with the given index for the last point in the interval.

Definition at line 238 of file StopHistoryInterval.h.

◆ num_points()

size_t Evolve::StopHistoryInterval::num_points ( )
inline

Returns the number of points in the interval.

Definition at line 210 of file StopHistoryInterval.h.

◆ number_conditions()

size_t Evolve::StopHistoryInterval::number_conditions ( )
inline

Returns the number of conditions at the first point.

Definition at line 216 of file StopHistoryInterval.h.

◆ operator++() [1/2]

StopHistoryInterval & Evolve::StopHistoryInterval::operator++ ( )

Advances to the next point in the interval.

Definition at line 118 of file StopHistoryInterval.cpp.

◆ operator++() [2/2]

StopHistoryInterval Evolve::StopHistoryInterval::operator++ ( int  )

Advances to the next point in the interval.

Definition at line 130 of file StopHistoryInterval.cpp.

◆ operator--() [1/2]

StopHistoryInterval & Evolve::StopHistoryInterval::operator-- ( )

Advances to the next point in the interval.

Definition at line 137 of file StopHistoryInterval.cpp.

◆ operator--() [2/2]

StopHistoryInterval Evolve::StopHistoryInterval::operator-- ( int  )

Advances to the next point in the interval.

Definition at line 148 of file StopHistoryInterval.cpp.

◆ operator<<()

StopHistoryInterval & Evolve::StopHistoryInterval::operator<< ( size_t  n)

Moves the entire interval, along with the current point left n points.

Gains n new points at the front and loses n at the back.

If there are not enough points in the history undefined behavior results.

Definition at line 155 of file StopHistoryInterval.cpp.

◆ operator=()

StopHistoryInterval & Evolve::StopHistoryInterval::operator= ( const StopHistoryInterval rhs)

Copies rhs to this.

Definition at line 176 of file StopHistoryInterval.cpp.

◆ operator==()

bool Evolve::StopHistoryInterval::operator== ( const StopHistoryInterval rhs)

Checks if the RHS is the same interval and is at the same point in it.

Definition at line 199 of file StopHistoryInterval.cpp.

◆ operator>>()

StopHistoryInterval & Evolve::StopHistoryInterval::operator>> ( size_t  n)

Moves the entire interval, along with the current point right n points.

Gains n new points at the back and loses n at the front.

If there are not enough points in the discarded list undefined behavior results.

Definition at line 166 of file StopHistoryInterval.cpp.

◆ reset()

void Evolve::StopHistoryInterval::reset ( )

Makes the current point the first point in the interval.

Definition at line 110 of file StopHistoryInterval.cpp.

◆ retreat_iterator_set()

void Evolve::StopHistoryInterval::retreat_iterator_set ( std::list< double >::const_iterator &  age_i,
std::list< std::valarray< double > >::const_iterator &  cond_i,
std::list< std::valarray< double > >::const_iterator &  deriv_i 
)
private

Decrements all the iterators passed as arguments.

Takes care of the switch from discarded to history if necessary.

Definition at line 29 of file StopHistoryInterval.cpp.

◆ stop_condition_deriv()

double Evolve::StopHistoryInterval::stop_condition_deriv ( size_t  condition_index) const
inline

Returns the derivative of the stop condition with the given index for the current point.

Definition at line 258 of file StopHistoryInterval.h.

◆ stop_condition_value()

double Evolve::StopHistoryInterval::stop_condition_value ( size_t  condition_index) const
inline

Returns the value of the stop condition with the given index for the current point.

Definition at line 243 of file StopHistoryInterval.h.

Member Data Documentation

◆ __age_i

std::list<double>::const_iterator Evolve::StopHistoryInterval::__age_i
private

The age of the current point.

Definition at line 41 of file StopHistoryInterval.h.

◆ __discarded_age_begin

std::list<double>::const_iterator Evolve::StopHistoryInterval::__discarded_age_begin
private

The first age in the discarded stopping conditions.

Definition at line 41 of file StopHistoryInterval.h.

◆ __first_age

std::list<double>::const_iterator Evolve::StopHistoryInterval::__first_age
private

The first age in the interval.

Definition at line 41 of file StopHistoryInterval.h.

◆ __first_stop_cond

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__first_stop_cond
private

The first stopping condition value in the interval.

Definition at line 57 of file StopHistoryInterval.h.

◆ __first_stop_deriv

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__first_stop_deriv
private

The first stopping condition derivative in the interval.

Definition at line 57 of file StopHistoryInterval.h.

◆ __history_age_end

std::list<double>::const_iterator Evolve::StopHistoryInterval::__history_age_end
private

The one past last element of the history of stoppnig condition ages.

Definition at line 41 of file StopHistoryInterval.h.

◆ __last_age

std::list<double>::const_iterator Evolve::StopHistoryInterval::__last_age
private

The last age in the interval.

Definition at line 41 of file StopHistoryInterval.h.

◆ __last_stop_cond

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__last_stop_cond
private

The last stopping condition value in the interval.

Definition at line 57 of file StopHistoryInterval.h.

◆ __last_stop_deriv

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__last_stop_deriv
private

The last stopping condition derivative in the interval.

Definition at line 57 of file StopHistoryInterval.h.

◆ __num_points

size_t Evolve::StopHistoryInterval::__num_points
private

Number of points in the interval.

Definition at line 37 of file StopHistoryInterval.h.

◆ __point_i

size_t Evolve::StopHistoryInterval::__point_i
private

The index of the current point.

Definition at line 37 of file StopHistoryInterval.h.

◆ __stop_cond_discarded_begin

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__stop_cond_discarded_begin
private

The first of the discarded stopping condition values.

Definition at line 57 of file StopHistoryInterval.h.

◆ __stop_cond_history_end

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__stop_cond_history_end
private

The one past last element of the history of stoppnig conditions.

Definition at line 57 of file StopHistoryInterval.h.

◆ __stop_cond_i

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__stop_cond_i
private

The current stopping condition value.

Definition at line 57 of file StopHistoryInterval.h.

◆ __stop_deriv_discarded_begin

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__stop_deriv_discarded_begin
private

The first of the discarded stopping condition values.

Definition at line 57 of file StopHistoryInterval.h.

◆ __stop_deriv_history_end

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__stop_deriv_history_end
private

The one past last element of the history of stoppnig conditions.

Definition at line 57 of file StopHistoryInterval.h.

◆ __stop_deriv_i

std::list< std::valarray<double> >::const_iterator Evolve::StopHistoryInterval::__stop_deriv_i
private

The current stop condition derivative.

Definition at line 57 of file StopHistoryInterval.h.


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