RSC  0.16.0
rsc::math::SequenceMonitor Class Reference

A monitor for (vector-) sequences. More...

#include <SequenceMonitor.h>

Collaboration diagram for rsc::math::SequenceMonitor:
Collaboration graph

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...
 

Detailed Description

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.

Author
cemmeric

Definition at line 209 of file SequenceMonitor.h.

Constructor & Destructor Documentation

rsc::math::SequenceMonitor::SequenceMonitor ( const unsigned int  dim,
const unsigned int  window,
MetricConditionPtr  condition 
)

Constructor.

Parameters
dimdimension of the vectors of the sequence
windownumber of consecutive members for which the condition should hold
conditionthe condition that should be fulfilled for consecutive sequence members

Definition at line 82 of file SequenceMonitor.cpp.

References dim, prev_v, and resetCnt().

Here is the call graph for this function:

rsc::math::SequenceMonitor::~SequenceMonitor ( )

Definition at line 91 of file SequenceMonitor.cpp.

References prev_v.

Member Function Documentation

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.

Parameters
vnext sequence member

Definition at line 95 of file SequenceMonitor.cpp.

References cnt, dim, metricCondition, prev_v, and resetCnt().

Here is the call graph for this function:

void rsc::math::SequenceMonitor::resetCnt ( )
protected

Definition at line 126 of file SequenceMonitor.cpp.

References cnt, and windowSize.

Referenced by isConditionFulfilled(), and SequenceMonitor().

Here is the caller graph for this function:

Member Data Documentation

int rsc::math::SequenceMonitor::cnt
protected

Counts whether the condition is fulfilled long enough.

Definition at line 249 of file SequenceMonitor.h.

Referenced by isConditionFulfilled(), and resetCnt().

const unsigned int rsc::math::SequenceMonitor::dim
protected

Definition at line 238 of file SequenceMonitor.h.

Referenced by isConditionFulfilled(), and SequenceMonitor().

MetricConditionPtr rsc::math::SequenceMonitor::metricCondition
protected

Definition at line 240 of file SequenceMonitor.h.

Referenced by isConditionFulfilled().

double* rsc::math::SequenceMonitor::prev_v
protected

Previous sequence element.

Definition at line 245 of file SequenceMonitor.h.

Referenced by isConditionFulfilled(), SequenceMonitor(), and ~SequenceMonitor().

const unsigned int rsc::math::SequenceMonitor::windowSize
protected

Definition at line 239 of file SequenceMonitor.h.

Referenced by resetCnt().


The documentation for this class was generated from the following files: