Defines it values by concatenating one or more Mappings to a reference Mapping. More...
#include <MappingUtils.h>
Inherits ConstMapping.
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. | |
Mapping * | createConcatenatedMapping () |
Returns the concatenated Mapping. | |
virtual ConstMappingIterator * | createConstIterator () |
Returns a pointer of a new Iterator which is able to iterate over this Mapping. | |
virtual ConstMappingIterator * | createConstIterator (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 ConstMapping * | constClone () const |
returns a deep copy of this mapping instance. | |
ConstMapping * | getRefMapping () |
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 |
ConstMapping * | refMapping |
bool | continueOutOfRange |
double | oorValue |
Operator | op |
Defines it values by concatenating one or more Mappings to a reference Mapping.
Definition at line 1993 of file MappingUtils.h.
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); }
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()); }
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; }