Public Member Functions | Protected Types | Protected Attributes

ConcatConstMapping< Operator > Class Template Reference
[mappingDetails - mostly internal mapping classes]

Defines it values by concatenating one or more Mappings to a reference Mapping. More...

#include <MappingUtils.h>

Inherits ConstMapping.

Collaboration diagram for ConcatConstMapping< Operator >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

template<class Iterator >
 ConcatConstMapping (ConstMapping *refMapping, Iterator first, Iterator last, bool continueOutOfRange=true, double oorValue=0.0, Operator op=Operator())
 Initializes with the passed reference Mapping, the operator and the Mappings defined by the passed iterator.
 ConcatConstMapping (ConstMapping *refMapping, ConstMapping *other, bool continueOutOfRange=true, double oorValue=0.0, Operator op=Operator())
 Initializes with the passed reference Mapping, the operator and another Mapping to concatenate.
void addMapping (ConstMapping *m)
 Adds another Mapping to the list of Mappings to concatenate.
virtual double getValue (const Argument &pos) const
 Returns the value of this Mapping at the position specified by the passed Argument.
MappingcreateConcatenatedMapping ()
 Returns the concatenated Mapping.
virtual ConstMappingIteratorcreateConstIterator ()
 Returns a pointer of a new Iterator which is able to iterate over this Mapping.
virtual ConstMappingIteratorcreateConstIterator (const Argument &pos)
 Returns a pointer of a new Iterator which is able to iterate over the function. The iterator starts at the passed position.
virtual ConstMappingconstClone () const
 returns a deep copy of this mapping instance.
ConstMappinggetRefMapping ()
 Returns the pointer to the reference mapping.

Protected Types

typedef std::pair< Dimension,
Argument::const_iterator
DimIteratorPair
typedef std::list< ConstMapping * > MappingSet

Protected Attributes

MappingSet mappings
ConstMappingrefMapping
bool continueOutOfRange
double oorValue
Operator op

Detailed Description

template<class Operator>
class ConcatConstMapping< Operator >

Defines it values by concatenating one or more Mappings to a reference Mapping.

Author:
Karl Wessel

Definition at line 1993 of file MappingUtils.h.


Member Function Documentation

template<class Operator >
virtual ConstMappingIterator* ConcatConstMapping< Operator >::createConstIterator ( const Argument pos  )  [inline, virtual]

Returns a pointer of a new Iterator which is able to iterate over the function. The iterator starts at the passed position.

See class ConstIterator for details.

Implements ConstMapping.

Definition at line 2093 of file MappingUtils.h.

References ConcatConstMapping< Operator >::createConcatenatedMapping(), and ConstMapping::createConstIterator().

                                                                         {
    if(mappings.empty()) {
      return refMapping->createConstIterator(pos);
    }
    return new ConcatConstMappingIterator(createConcatenatedMapping(), pos);
  }

template<class Operator >
virtual ConstMappingIterator* ConcatConstMapping< Operator >::createConstIterator (  )  [inline, virtual]

Returns a pointer of a new Iterator which is able to iterate over this Mapping.

See class ConstIterator for details.

Implements ConstMapping.

Definition at line 2086 of file MappingUtils.h.

References ConcatConstMapping< Operator >::createConcatenatedMapping(), and ConstMapping::createConstIterator().

                                                      {
    if(mappings.empty()) {
      return refMapping->createConstIterator();
    }
    return new ConcatConstMappingIterator(createConcatenatedMapping());
  }

template<class Operator >
virtual double ConcatConstMapping< Operator >::getValue ( const Argument pos  )  const [inline, virtual]

Returns the value of this Mapping at the position specified by the passed Argument.

The complexity of this method depends on the actual implementation.

Implements ConstMapping.

Definition at line 2052 of file MappingUtils.h.

References ConstMapping::getValue().

                                                     {
    MappingSet::const_iterator it = mappings.begin();
    double res = refMapping->getValue(pos);

    for (MappingSet::const_iterator it = mappings.begin();
       it != mappings.end(); ++it)
    {
      res = op(res, (*it)->getValue(pos));
    }

    return res;
  }


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