Represents a changeable mapping (mathematical function) from at least time to double. More...
#include <MappingBase.h>
Inherits ConstMapping.
Inherited by BaseDelayedMapping< Mapping >, ConstMappingWrapper, LinearIntplMapping, MultiDimMapping< Interpolator >, MultiDimMapping< Linear >, TimeMapping< Interpolator >, and TimeMapping< Linear >.
Public Types | |
enum | InterpolationMethod { STEPS, NEAREST, LINEAR } |
Types of interpolation methods for mappings. More... | |
Public Member Functions | |
Mapping (const DimensionSet &dims) | |
Initializes the Mapping with the passed DimensionSet as domain. | |
Mapping () | |
Initializes the Mapping with the time dimension as domain. | |
virtual void | setValue (const Argument &pos, double value)=0 |
Changes the value of the Mapping at the specified position. | |
virtual void | appendValue (const Argument &pos, double value) |
Appends the passed value at the passed position to the mapping. This method assumes that the passed position is after the last key entry of the mapping. | |
virtual MappingIterator * | createIterator ()=0 |
Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change it. | |
virtual MappingIterator * | createIterator (const Argument &pos)=0 |
Returns a pointer of a new Iterator which is able to iterate over the function and can change it. | |
virtual ConstMappingIterator * | createConstIterator () |
Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method. | |
virtual ConstMappingIterator * | createConstIterator (const Argument &pos) |
Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method. | |
virtual Mapping * | clone () const =0 |
Returns a deep copy of this Mapping. | |
virtual ConstMapping * | constClone () const |
Returns a deep const copy of this mapping by using the according "clone()"-implementation. |
Represents a changeable mapping (mathematical function) from at least time to double.
This class extends the ConstMapping interface with write access.
See ConstMapping for details.
Definition at line 874 of file MappingBase.h.
Types of interpolation methods for mappings.
STEPS |
interpolates with next lower entry |
NEAREST |
interpolates with nearest entry |
LINEAR |
interpolates linear with next lower and next upper entry constant before the first and after the last entry |
Definition at line 877 of file MappingBase.h.
{ STEPS, NEAREST, LINEAR };
Mapping::Mapping | ( | const DimensionSet & | dims | ) | [inline] |
Initializes the Mapping with the passed DimensionSet as domain.
The passed DimensionSet has to contain the time dimension!
Definition at line 896 of file MappingBase.h.
: ConstMapping(dims) {}
virtual void Mapping::appendValue | ( | const Argument & | pos, | |
double | value | |||
) | [inline, virtual] |
Appends the passed value at the passed position to the mapping. This method assumes that the passed position is after the last key entry of the mapping.
Depending on the implementation of the underlying method this method could be faster or at least as fast as the "setValue()"-method.
Implementations of the Mapping interface can override this method if appending values to the end of the mapping could be implemented faster than the "setValue()" method. Otherwise this method just calls the "setValue()"-method implementation.
Reimplemented in FilledUpMapping.
Definition at line 928 of file MappingBase.h.
References setValue().
Referenced by FilledUpMapping::appendValue(), and LogNormalShadowing::filterSignal().
{ setValue(pos, value); }
virtual ConstMappingIterator* Mapping::createConstIterator | ( | ) | [inline, virtual] |
Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method.
Override this method if your ConstIterator differs from the normal iterator.
Implements ConstMapping.
Reimplemented in ConstMappingWrapper.
Definition at line 952 of file MappingBase.h.
References createIterator().
Referenced by SNRThresholdDecider::checkIfAboveThreshold(), and Decider80211::checkIfSignalOk().
{ return createIterator(); }
virtual ConstMappingIterator* Mapping::createConstIterator | ( | const Argument & | pos | ) | [inline, virtual] |
Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method.
Override this method if your ConstIterator differs from the normal iterator.
Implements ConstMapping.
Reimplemented in ConstMappingWrapper.
Definition at line 962 of file MappingBase.h.
References createIterator().
{ return createIterator(pos); }
virtual MappingIterator* Mapping::createIterator | ( | const Argument & | pos | ) | [pure virtual] |
Returns a pointer of a new Iterator which is able to iterate over the function and can change it.
The iterator starts at the passed position.
Implemented in TimeMapping< Interpolator >, LinearIntplMapping, ConstMappingWrapper, MultiDimMapping< Interpolator >, FilledUpMapping, DelayedMapping, TimeMapping< Linear >, and MultiDimMapping< Linear >.
virtual void Mapping::setValue | ( | const Argument & | pos, | |
double | value | |||
) | [pure virtual] |
Changes the value of the Mapping at the specified position.
The complexity of this method depends on the implementation.
Implemented in TimeMapping< Interpolator >, LinearIntplMapping, ConstMappingWrapper, MultiDimMapping< Interpolator >, DelayedMapping, TimeMapping< Linear >, and MultiDimMapping< Linear >.
Referenced by MappingUtils::addDiscontinuity(), appendValue(), BaseMacLayer::createConstantMapping(), SimpleMacLayer::createMapping(), Mac80211::createSignal(), BaseMacLayer::createSingleFrequencyMapping(), RandomFrequencyOnlyModel::filterSignal(), RandomFreqTimeModel::filterSignal(), and DelayedMapping::setValue().