A class combining the the outputs of multiple stopping conditions. More...
#include <CombinedStoppingCondition.h>
Public Member Functions | |
CombinedStoppingCondition () | |
Create an empty stopping condition (identical to NoStopCondition). More... | |
CombinedStoppingCondition & | operator|= (CombinedStoppingCondition &rhs) |
Adds the conditions in RHS to the conditions of *this. More... | |
CombinedStoppingCondition & | operator|= (StoppingCondition *rhs) |
Adds RHS to the conditions of *this. More... | |
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. More... | |
void | no_delete_subcond () |
Disables the destruction of the subconditions when *this is destroyed. More... | |
virtual size_t | num_subconditions () const |
The number of subconditions in the current condition. More... | |
StoppingConditionType | type (unsigned index=0) const |
What event is the index-th stopping sub-condition associated with. More... | |
virtual void | reached (short deriv_sign, unsigned index=0) |
See StoppingCondition::reached(). More... | |
short | expected_crossing_deriv_sign (unsigned index=0) const |
See StoppingCondition::expected_crossing_deriv_sign(). More... | |
virtual std::string | describe (int index) const |
See StoppingCondition::describe(). More... | |
~CombinedStoppingCondition () | |
Deletes all subconditions, unless no_delete_subcond has been previously called. More... | |
Public Member Functions inherited from Evolve::StoppingCondition | |
StoppingCondition (short expected_crossing_deriv_sign=0) | |
Create a generic stopping condition. More... | |
Private Member Functions | |
void | update_meta_information (const StoppingCondition *rhs) |
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. More... | |
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 the given condition. More... | |
std::vector< StoppingCondition * >::iterator | find_condition (unsigned &index) |
Finds the condition corresponding to the given index and modifies the index to be the index within the given condition. More... | |
Private Attributes | |
std::vector< StoppingCondition * > | __sub_conditions |
The conditions that are combined. More... | |
unsigned | __num_subconditions |
The number of subconditinos included, allowing for subconditions with multiple entries. More... | |
bool | __delete_subcond |
Whether to delete the sub-conditions then *this is destroyed. More... | |
std::vector< StoppingConditionType > | __types |
The types of the subconditinos, including subconditions of subconditions. More... | |
A class combining the the outputs of multiple stopping conditions.
Definition at line 21 of file CombinedStoppingCondition.h.
|
inline |
Create an empty stopping condition (identical to NoStopCondition).
Definition at line 78 of file CombinedStoppingCondition.h.
Evolve::CombinedStoppingCondition::~CombinedStoppingCondition | ( | ) |
Deletes all subconditions, unless no_delete_subcond has been previously called.
Definition at line 142 of file CombinedStoppingCondition.cpp.
|
private |
Adds the values of the given sub-condition to the given array.
cond | The stopping condition to process. |
evol_mode | See operator() |
orbit | See operator() |
derivatives | See operator() |
first_index | The index in the values and derivs arrays where to start inserting. On output it is updated to the position immediately after the last insert. |
values | An array to overwrite with the sub-condition values. |
derivs | An array to overwrite with the sub-condition derivatives. |
Definition at line 17 of file CombinedStoppingCondition.cpp.
|
virtual |
See StoppingCondition::describe().
Implements Evolve::StoppingCondition.
Definition at line 122 of file CombinedStoppingCondition.cpp.
|
virtual |
See StoppingCondition::expected_crossing_deriv_sign().
Reimplemented from Evolve::StoppingCondition.
Definition at line 113 of file CombinedStoppingCondition.cpp.
|
private |
Finds the condition corresponding to the given index and modifies the index to be the index within the given condition.
Definition at line 37 of file CombinedStoppingCondition.cpp.
|
private |
Finds the condition corresponding to the given index and modifies the index to be the index within the given condition.
Definition at line 50 of file CombinedStoppingCondition.cpp.
|
inline |
Disables the destruction of the subconditions when *this is destroyed.
Definition at line 99 of file CombinedStoppingCondition.h.
|
inlinevirtual |
The number of subconditions in the current condition.
Reimplemented from Evolve::StoppingCondition.
Definition at line 101 of file CombinedStoppingCondition.h.
|
virtual |
Returns the values of all stopping sub_conditions, not necessarily in the order added.
See StoppingCondition::operator()() for a description of the arguments.
Implements Evolve::StoppingCondition.
Definition at line 89 of file CombinedStoppingCondition.cpp.
CombinedStoppingCondition & Evolve::CombinedStoppingCondition::operator|= | ( | CombinedStoppingCondition & | rhs | ) |
Adds the conditions in RHS to the conditions of *this.
Definition at line 65 of file CombinedStoppingCondition.cpp.
CombinedStoppingCondition & Evolve::CombinedStoppingCondition::operator|= | ( | StoppingCondition * | rhs | ) |
Adds RHS to the conditions of *this.
Definition at line 80 of file CombinedStoppingCondition.cpp.
|
virtual |
See StoppingCondition::reached().
Reimplemented from Evolve::StoppingCondition.
Definition at line 107 of file CombinedStoppingCondition.cpp.
|
inlinevirtual |
What event is the index-th stopping sub-condition associated with.
Implements Evolve::StoppingCondition.
Definition at line 103 of file CombinedStoppingCondition.h.
|
private |
Updates all private methods except the sub_condition lists for adding rhs.
Definition at line 6 of file CombinedStoppingCondition.cpp.
|
private |
Whether to delete the sub-conditions then *this is destroyed.
Definition at line 31 of file CombinedStoppingCondition.h.
|
private |
The number of subconditinos included, allowing for subconditions with multiple entries.
Definition at line 28 of file CombinedStoppingCondition.h.
|
private |
The conditions that are combined.
Definition at line 24 of file CombinedStoppingCondition.h.
|
private |
The types of the subconditinos, including subconditions of subconditions.
Definition at line 35 of file CombinedStoppingCondition.h.