Helper-class for the MultiDimMapping which provides an Iterator which linear interpolates between two other Mapping iterators. Or in other words, it provides an Iterator for an linear interpolated Mapping. More...
#include <MappingUtils.h>
Inherits MappingIterator.
Public Member Functions | |
LinearIntplMappingIterator (ConstMappingIterator *leftIt, ConstMappingIterator *rightIt, double f) | |
Initializes the Iterator with the passed Iterators of the mappings to Interpolate and the their interpolation-factor. | |
virtual | ~LinearIntplMappingIterator () |
Deletes the left and the right mapping iterator. | |
virtual bool | hasNext () const |
An interpolated mapping isn't really iterateable over specific values, it only provides an fast way to get several values from an Interpolated mapping. | |
virtual bool | inRange () const |
An interpolated mapping isn't really iterateable over specific values, it only provides an fast way to get several values from an Interpolated mapping. | |
virtual void | jumpToBegin () |
This method isn't supported by an interpolated Mapping. | |
virtual void | next () |
This method isn't supported by an interpolated Mapping. | |
virtual void | setValue (double value) |
This method isn't supported by an interpolated Mapping. | |
virtual void | jumpTo (const Argument &pos) |
Lets the iterator point to the passed position. | |
virtual void | iterateTo (const Argument &pos) |
Increases the iterator to the passed position. This position should be near the current position of the iterator. | |
virtual double | getValue () const |
Returns the value of the Interpolated mapping at the current position of the iterator. | |
virtual const Argument & | getPosition () const |
Returns the current position of the iterator. | |
virtual const Argument & | getNextPosition () const |
This method isn't supported by an interpolated mapping. | |
Protected Attributes | |
ConstMappingIterator * | leftIt |
Iterator for the left Mapping to interpolate. | |
ConstMappingIterator * | rightIt |
Iterator for the right Mapping to interpolate. | |
double | factor |
The factor defining how strong the left and the right Mapping affect the interpolation. |
Helper-class for the MultiDimMapping which provides an Iterator which linear interpolates between two other Mapping iterators. Or in other words, it provides an Iterator for an linear interpolated Mapping.
Definition at line 370 of file MappingUtils.h.
virtual const Argument& LinearIntplMappingIterator::getPosition | ( | ) | const [inline, virtual] |
Returns the current position of the iterator.
Constant complexity.
Implements ConstMappingIterator.
Definition at line 464 of file MappingUtils.h.
References ConstMappingIterator::getPosition(), and leftIt.
{ return leftIt->getPosition(); }
virtual double LinearIntplMappingIterator::getValue | ( | ) | const [inline, virtual] |
Returns the value of the Interpolated mapping at the current position of the iterator.
This method has constant complexity.
Implements ConstMappingIterator.
Definition at line 453 of file MappingUtils.h.
References factor, ConstMappingIterator::getValue(), leftIt, and rightIt.
virtual void LinearIntplMappingIterator::iterateTo | ( | const Argument & | pos | ) | [inline, virtual] |
Increases the iterator to the passed position. This position should be near the current position of the iterator.
The passed position has to be compared bigger than the current position.
This method has linear complexity over the number of key entries between the current and the passed position in both underlying mappings used to interpolate. So if the passed position is near the current position this method has nearly constant complexity.
Implements ConstMappingIterator.
Definition at line 442 of file MappingUtils.h.
References ConstMappingIterator::iterateTo(), leftIt, and rightIt.
virtual void LinearIntplMappingIterator::jumpTo | ( | const Argument & | pos | ) | [inline, virtual] |
Lets the iterator point to the passed position.
This method has logarithmic complexity over both of the underlying Mappings used to interpolate.
Implements ConstMappingIterator.
Definition at line 426 of file MappingUtils.h.
References ConstMappingIterator::jumpTo(), leftIt, and rightIt.