RSC
0.16.0
|
A monitor for (vector-) sequences. More...
#include <SequenceMonitor.h>
Public Member Functions | |
SequenceMonitor (const unsigned int dim, const unsigned int window, MetricConditionPtr condition) | |
Constructor. More... | |
~SequenceMonitor () | |
bool | isConditionFulfilled (double *new_v, const unsigned int &dim) |
Test whether the difference of consecutive sequence members fulfills the condition for the given 'time window' or not. More... | |
Protected Member Functions | |
void | resetCnt () |
Protected Attributes | |
const unsigned int | dim |
const unsigned int | windowSize |
MetricConditionPtr | metricCondition |
double * | prev_v |
Previous sequence element. More... | |
int | cnt |
Counts whether the condition is fulfilled long enough. More... | |
A monitor for (vector-) sequences.
Tests whether the difference of consecutive members of a sequence fulfills a certain metric condition for a certain number of steps or not.
A simple application could be convergence testing: Test whether the difference between the current vector and the predecessor is less than a certain threshold value. If this holds for a certain number of consecutive sequence members (window size + 1), the sequence is said to be converged.
Definition at line 209 of file SequenceMonitor.h.
rsc::math::SequenceMonitor::SequenceMonitor | ( | const unsigned int | dim, |
const unsigned int | window, | ||
MetricConditionPtr | condition | ||
) |
Constructor.
dim | dimension of the vectors of the sequence |
window | number of consecutive members for which the condition should hold |
condition | the condition that should be fulfilled for consecutive sequence members |
Definition at line 82 of file SequenceMonitor.cpp.
References dim, prev_v, and resetCnt().
rsc::math::SequenceMonitor::~SequenceMonitor | ( | ) |
Definition at line 91 of file SequenceMonitor.cpp.
References prev_v.
bool rsc::math::SequenceMonitor::isConditionFulfilled | ( | double * | new_v, |
const unsigned int & | dim | ||
) |
Test whether the difference of consecutive sequence members fulfills the condition for the given 'time window' or not.
v | next sequence member |
Definition at line 95 of file SequenceMonitor.cpp.
References cnt, dim, metricCondition, prev_v, and resetCnt().
|
protected |
Definition at line 126 of file SequenceMonitor.cpp.
References cnt, and windowSize.
Referenced by isConditionFulfilled(), and SequenceMonitor().
|
protected |
Counts whether the condition is fulfilled long enough.
Definition at line 249 of file SequenceMonitor.h.
Referenced by isConditionFulfilled(), and resetCnt().
|
protected |
Definition at line 238 of file SequenceMonitor.h.
Referenced by isConditionFulfilled(), and SequenceMonitor().
|
protected |
Definition at line 240 of file SequenceMonitor.h.
Referenced by isConditionFulfilled().
|
protected |
Previous sequence element.
Definition at line 245 of file SequenceMonitor.h.
Referenced by isConditionFulfilled(), SequenceMonitor(), and ~SequenceMonitor().
|
protected |
Definition at line 239 of file SequenceMonitor.h.
Referenced by resetCnt().