1 #define BUILDING_LIBRARY 13 for(
size_t i = 0; i < num_new_subcond; i++)
20 const std::valarray<double> &orbit,
21 const std::valarray<double> &derivatives,
23 std::valarray<double> &values,
24 std::valarray<double> &derivs)
const 27 temp_array=(*cond)(evol_mode, orbit, derivatives, sub_stop_deriv);
28 for(
size_t subcond_ind=0; subcond_ind<temp_array.size();
30 values[first_index]=temp_array[subcond_ind];
31 derivs[first_index]=sub_stop_deriv[subcond_ind];
36 std::vector<StoppingCondition *>::const_iterator
39 std::vector<StoppingCondition *>::const_iterator sc_iter=
41 while(index >= (*sc_iter)->num_subconditions()) {
43 index -= (*sc_iter)->num_subconditions();
49 std::vector<StoppingCondition *>::iterator
52 std::vector<StoppingCondition *>::const_iterator
91 const std::valarray<double> &orbit,
92 const std::valarray<double> &derivatives,
93 std::valarray<double> &stop_deriv
99 for(std::vector<StoppingCondition *>::const_iterator
109 std::vector<StoppingCondition *>::iterator sc_iter=
find_condition(index);
110 (*sc_iter)->reached(deriv_sign, index);
117 std::vector<StoppingCondition *>::const_iterator
119 return (*sc_iter)->expected_crossing_deriv_sign(index);
124 std::ostringstream description;
126 unsigned unsigned_index = index;
127 std::vector<StoppingCondition *>::const_iterator
129 description << (*sc_iter)->describe(unsigned_index);
132 std::vector<StoppingCondition *>::const_iterator
137 description << (*cond)->describe() << std::endl;
139 return description.str();
145 for(std::vector<StoppingCondition *>::const_iterator
virtual void reached(short deriv_sign, unsigned index=0)
See StoppingCondition::reached().
short expected_crossing_deriv_sign(unsigned index=0) const
See StoppingCondition::expected_crossing_deriv_sign().
virtual std::string describe(int index) const
See StoppingCondition::describe().
unsigned __num_subconditions
The number of subconditinos included, allowing for subconditions with multiple entries.
virtual StoppingConditionType type(unsigned index=0) const =0
What event is the index-th stopping sub-condition associated with.
virtual size_t num_subconditions() const
The number of subconditions in the current condition.
Orientations of zones of bodies in a binary system.
std::vector< StoppingConditionType > __types
The types of the subconditinos, including subconditions of subconditions.
void add_subcondition_values(const StoppingCondition *cond, Core::EvolModeType evol_mode, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, size_t &first_index, std::valarray< double > &values, std::valarray< double > &derivs) const
Adds the values of the given sub-condition to the given array.
std::vector< StoppingCondition * >::const_iterator find_condition(unsigned &index) const
Finds the condition corresponding to the given index and modifies the index to be the index within th...
void update_meta_information(const StoppingCondition *rhs)
std::vector< StoppingCondition * > __sub_conditions
The conditions that are combined.
A base class for all stopping conditions.
bool __delete_subcond
Whether to delete the sub-conditions then *this is destroyed.
EvolModeType
The various evolution modes.
std::valarray< double > operator()(Core::EvolModeType evol_mode, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, std::valarray< double > &stop_deriv) const
Returns the values of all stopping sub_conditions, not necessarily in the order added.
~CombinedStoppingCondition()
Deletes all subconditions, unless no_delete_subcond has been previously called.
Declares a class for a stopping condition that combines other stopping conditions.
A class combining the the outputs of multiple stopping conditions.
CombinedStoppingCondition & operator|=(CombinedStoppingCondition &rhs)
Adds the conditions in RHS to the conditions of *this.