Public Member Functions | Protected Attributes

LinearIntplMapping Class Reference
[mappingDetails - mostly internal mapping classes]

Helper class which represents a linear interpolation between two other mappings. More...

#include <MappingUtils.h>

Inherits Mapping.

Collaboration diagram for LinearIntplMapping:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LinearIntplMapping (ConstMapping *left=0, ConstMapping *right=0, double f=0.0)
 Initializes the LinearIntplMapping with the passed left and right Mapping to interpolate by the passed interpolation value.
virtual Mappingclone () const
 Interpolated mappings are not supposed to be cloned!
virtual double getValue (const Argument &pos) const
 Returns the linear interpolated value of this Mapping.
virtual MappingIteratorcreateIterator ()
 An interpolated mapping doesn't have a valid "first"-entry, so this method is not supported.
virtual MappingIteratorcreateIterator (const Argument &pos)
 Creates an iterator for this mapping starting at the passed position.
virtual void setValue (const Argument &pos, double value)
 This method is not supported!

Protected Attributes

ConstMappingleft
 The left mapping to interpolate.
ConstMappingright
 The right mapping to interpolate.
double factor
 The interpolation factor determining the linear interpolation between left and right mapping.

Detailed Description

Helper class which represents a linear interpolation between two other mappings.

Author:
Karl Wessel

Definition at line 481 of file MappingUtils.h.


Member Function Documentation

virtual MappingIterator* LinearIntplMapping::createIterator ( const Argument pos  )  [inline, virtual]

Creates an iterator for this mapping starting at the passed position.

Note: The returned Iterator does only support a subset of the normal MappingIterator-methods. See LinearIntplMappingIterator for details.

Implements Mapping.

Definition at line 539 of file MappingUtils.h.

References ConstMapping::createConstIterator(), factor, left, and right.

virtual double LinearIntplMapping::getValue ( const Argument pos  )  const [inline, virtual]

Returns the linear interpolated value of this Mapping.

The value is calculated by the following formula:

v = left + (right - left) * intplFactor

Implements ConstMapping.

Definition at line 513 of file MappingUtils.h.

References factor, ConstMapping::getValue(), left, and right.

                                                     {
    assert(left);
    assert(right);

    double v0 = left->getValue(pos);
    double v1 = right->getValue(pos);
    return v0 + (v1 - v0) * factor;
  }


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