Class xlifepp::StatusTestCombo#

template<class ScalarType, class MV, class OP>
class StatusTestCombo : public xlifepp::StatusTest<ScalarType, MV, OP>#

Inheritence diagram for xlifepp::StatusTestCombo:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::StatusTest< ScalarType, MV, OP >" tooltip="xlifepp::StatusTest< ScalarType, MV, OP >"] "1" [label="xlifepp::StatusTestCombo< ScalarType, MV, OP >" tooltip="xlifepp::StatusTestCombo< ScalarType, MV, OP >" fillcolor="#BFBFBF"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::StatusTestCombo:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "4" [label="std::vector< T >" tooltip="std::vector< T >"] "3" [label="std::vector< SmartPtr< StatusTest< ScalarType, MV, OP > > >" tooltip="std::vector< SmartPtr< StatusTest< ScalarType, MV, OP > > >"] "5" [label="std::vector< int >" tooltip="std::vector< int >"] "2" [label="xlifepp::StatusTest< ScalarType, MV, OP >" tooltip="xlifepp::StatusTest< ScalarType, MV, OP >"] "1" [label="xlifepp::StatusTestCombo< ScalarType, MV, OP >" tooltip="xlifepp::StatusTestCombo< ScalarType, MV, OP >" fillcolor="#BFBFBF"] "3" -> "4" [dir=forward tooltip="template-instance"] "5" -> "4" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "1" -> "3" [dir=forward tooltip="usage"] "1" -> "5" [dir=forward tooltip="usage"] }

Status test for forming logical combinations of other status tests.

Test types include StatusTestCombo::_OR, StatusTestCombo::_AND, StatusTestCombo::_SEQOR and StatusTestCombo::_SEQAND. The StatusTestCombo::_OR and StatusTestCombo::_AND tests evaluate all of the tests, in the order they were passed to the StatusTestCombo. The StatusTestCombo::_SEQOR and StatusTestCombo::_SEQAND run only the tests necessary to determine the final outcome, short-circuiting on the first test that conclusively decides the outcome. More formally, StatusTestCombo::_SEQAND runs the tests in the order they were given to the StatusTestCombo class and stops after the first test that evaluates _failed. StatusTestCombo::_SEQOR run the tests in the order they were given to the StatusTestCombo class and stops after the first test that evaluates _passed.

Print methods

virtual std::ostream &print(std::ostream &os, int indent = 0) const#

Output formatted description of stopping test to output stream.

virtual PrintStream &print(PrintStream &os, int indent = 0) const#

Output formatted description of stopping test to output stream.

Constructors/destructors

inline StatusTestCombo()#

Constructor.

Default constructor has no tests and initializes to StatusTestCombo::ComboType StatusTestCombo::_OR.

inline StatusTestCombo(ComboType type, std::vector<SmartPtr<StatusTest<ScalarType, MV, OP>>> tests)#

Constructor.

Constructor specifying the StatusTestCombo::ComboType and the tests.

inline virtual ~StatusTestCombo()#

Destructor.

Status methods

virtual TestStatus checkStatus(EigenSolver<ScalarType, MV, OP> *solver)#

Check status as defined by test.

Returns:

TestStatus indicating whether the test passed or failed.

inline virtual TestStatus getStatus() const#

Return the result of the most recent checkStatus call.

inline virtual std::vector<int> whichVecs() const#

Get the indices for the vectors that passed the test.

This returns some combination of the passing vectors from the tests comprising the StatusTestCombo. The nature of the combination depends on the StatusTestCombo::ComboType:

inline virtual int howMany() const#

Get the number of vectors that passed the test.

Accessor methods

inline void setComboType(ComboType type)#

Set the maximum number of iterations.

This also resets the test status to _undefined.

inline ComboType getComboType() const#

Get the maximum number of iterations.

inline void setTests(std::vector<SmartPtr<StatusTest<ScalarType, MV, OP>>> tests)#

Set the tests This also resets the test status to _undefined.

inline std::vector<SmartPtr<StatusTest<ScalarType, MV, OP>>> getTests() const#

Get the tests.

inline void addTest(SmartPtr<StatusTest<ScalarType, MV, OP>> test)#

Add a test to the combination.

This also resets the test status to _undefined.

void removeTest(const SmartPtr<StatusTest<ScalarType, MV, OP>> &test)#

Removes a test from the combination, if it exists in the tester.

This also resets the test status to _undefined, if a test was removed.

Reset methods

virtual void reset()#

Informs the status test that it should reset its internal configuration to the uninitialized state.

The StatusTestCombo class has no internal state, but children classes might, so this method will call reset() on all child status tests. It also resets the test status to _undefined.

virtual void clearStatus()#

Clears the results of the last status test.

This should be distinguished from the reset() method, as it only clears the cached result from the last status test, so that a call to getStatus() will return _undefined. This is necessary for the StatusTestCombo::_SEQOR and StatusTestCombo::_SEQAND tests in the StatusTestCombo class, which may short circuit and not evaluate all of the StatusTests contained in them.

Public Types

enum ComboType#

Enumerated type to list the types of StatusTestCombo combo types.

Values:

enumerator _OR#

Logical _OR which evaluates all tests.

enumerator _AND#

Logical _AND which evaluates all tests.

enumerator _SEQOR#

Short-circuited logical _OR.

enumerator _SEQAND#

Short-circuited logical _AND.