Public Member Functions | Protected Attributes

LinearIntplMappingIterator Class Reference
[mappingDetails - mostly internal mapping classes]

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.

Collaboration diagram for LinearIntplMappingIterator:
Collaboration graph
[legend]

List of all members.

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 ArgumentgetPosition () const
 Returns the current position of the iterator.
virtual const ArgumentgetNextPosition () const
 This method isn't supported by an interpolated mapping.

Protected Attributes

ConstMappingIteratorleftIt
 Iterator for the left Mapping to interpolate.
ConstMappingIteratorrightIt
 Iterator for the right Mapping to interpolate.
double factor
 The factor defining how strong the left and the right Mapping affect the interpolation.

Detailed Description

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.

Author:
Karl Wessel

Definition at line 370 of file MappingUtils.h.


Member Function Documentation

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.

                                  {
    double v0 = leftIt->getValue();
    double v1 = rightIt->getValue();
    return v0 + (v1 - v0) * factor;
  }

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.

                                             {
    leftIt->iterateTo(pos);
    rightIt->iterateTo(pos);
  }

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.

                                          {
    leftIt->jumpTo(pos);
    rightIt->jumpTo(pos);
  }


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