9 #ifndef __EXPECTED_EVOLUTION_MODE_H 10 #define __EXPECTED_EVOLUTION_MODE_H 12 #include "../shared/Common.h" 21 template<
typename MODE_TYPE>
35 __break_precision(break_precision)
40 {__age_breaks.push_back(age); __expected_mode.push_back(mode);}
46 std::list<double>::const_iterator
47 break_i = __age_breaks.begin();
48 break_i != __age_breaks.end();
51 if(
check_diff(age, *break_i, 0.0, __break_precision))
59 typename std::list<MODE_TYPE>::const_iterator
60 mode_i = __expected_mode.begin();
62 std::list<double>::const_iterator age_i = __age_breaks.begin();
63 age_i != __age_breaks.end();
66 std::list<double>::const_iterator next_age_i=age_i;
71 (next_age_i == __age_breaks.end() || *next_age_i > age)
76 std::ostringstream msg;
79 <<
" outside the range for which expected evolution modes " double __break_precision
The precision with which breaks should be detected.
Function arguments do not satisfy some requirement.
MODE_TYPE operator()(double age) const
The evolution mode that corresponds to the given age.
Orientations of zones of bodies in a binary system.
bool check_diff(double x, double y, double frac_tolerance, double abs_tolerance)
Returns true iff .
ExpectedEvolutionMode(double break_precision=1e-5)
Create.
bool near_break(double age) const
Is the given age close to a break (hence ambigous mode).
std::list< double > __age_breaks
The ages at which evolution mode changes occur.
std::list< MODE_TYPE > __expected_mode
The evolution modes that apply between consecutive __age_breaks.
void add_break(double age, MODE_TYPE mode)
Add an evolution mode that applies up to the given age.
Some evolution mode that changes at specified ages.