23 #include "mirtk/Stream.h" 81 Iteration() : _Iter(0), _Begin(0), _End(1), _Inc(1) {}
87 cerr <<
"Iteration::Iteration: Invalid increment value" << endl;
92 bool Start()
const {
return _Iter ==
_Begin; }
93 bool End()
const {
return _Iter ==
_End; }
94 int Total()
const {
return (_End - _Begin) /
_Inc; }
95 int Count()
const {
return (_Iter - _Begin) /
_Inc; }
96 int Iter()
const {
return _Iter; }
97 void Reset() { _Iter =
_Begin; }
98 void Break() { _Iter =
_End; }
104 if (_Iter > _End) _Iter =
_End;
106 if (_Iter < _End) _Iter =
_End;
115 if (_Iter < _Begin) _Iter =
_Begin;
117 if (_Iter > _Begin) _Iter =
_Begin;
160 _Info(NULL), _Direction(NULL),
161 _Current(.0), _Value(.0), _Length(.0), _TotalLength(.0),
162 _MinLength(.0), _MaxLength(.0), _Unit(.0),
163 _Delta(.0), _TotalDelta(.0)
176 size_t operator()(
const mirtk::Event &enum_value)
const {
177 return std::hash<int>()(enum_value);
184 #endif // MIRTK_Event_H double * _Direction
Step direction (i.e., function gradient)
int _Inc
Increment after each iteration.
Before initialization of filter execution.
double _Unit
Step length unit.
double _MinLength
Minimum allowed step length.
double _Length
Accepted/rejected step length.
Status message given as event data (const char *)
Start of filter execution (after initialization)
double _Value
Accepted/rejected function value.
Log message given as event data (const char *)
double _Current
Current objective function value.
double _TotalLength
Accumulated length of accepted steps.
Observable has modified state/parameters.
Data of AcceptedStepEvent and RejectedStepEvent.
Iteration with line search about to start.
Event
Events that can be observed.
int _End
End value of iteration counter.
double _MaxLength
Maximum allowed step length.
const char * _Info
Adjective detailing step for log output.
double _Delta
Maximum change of parameters (DoFs)
End of filter execution (before finalization)
Observer has been registered.
int _Iter
Iteration counter.
Observer has been unregistered.
int _Begin
Start value of iteration counter.
After finalization of filter execution.
double _TotalDelta
Accumulated change of parameters (DoFs)
Restart of filter execution.