INET Framework for OMNeT++/OMNEST
|
Provides several utility methods for Mappings. More...
#include <MappingUtils.h>
Public Types | |
typedef std::list< const ConstMapping * > | MappingBuffer |
Static Public Member Functions | |
static Mapping * | createMapping (const DimensionSet &domain=DimensionSet(Dimension::time), Mapping::InterpolationMethod intpl=Mapping::LINEAR) |
Returns an appropriate changeable Mapping with the specified domain and the specified interpolation method. More... | |
static Mapping * | createMapping (Mapping::argument_value_cref_t outOfRangeValue, const DimensionSet &domain=DimensionSet(Dimension::time), Mapping::InterpolationMethod intpl=Mapping::LINEAR) |
Returns an appropriate changeable Mapping with the specified domain and the specified interpolation method. More... | |
template<class Operator > | |
static Mapping * | applyElementWiseOperator (const ConstMapping &f1, const ConstMapping &f2, const Argument &intvlStart, const Argument &intvlEnd, Operator op) |
template<class Operator > | |
static Mapping * | applyElementWiseOperator (const ConstMapping &f1, const ConstMapping &f2, Operator op, Mapping::argument_value_cref_t outOfRangeVal=Argument::MappedZero, bool contOutOfRange=true) |
static Mapping * | multiply (const ConstMapping &f1, const ConstMapping &f2) |
Multiplies the passed functions element-wise with each other and returns the result in a new Function. More... | |
static Mapping * | add (const ConstMapping &f1, const ConstMapping &f2) |
static Mapping * | subtract (const ConstMapping &f1, const ConstMapping &f2) |
static Mapping * | divide (const ConstMapping &f1, const ConstMapping &f2) |
static Mapping * | multiply (const ConstMapping &f1, const ConstMapping &f2, Mapping::argument_value_cref_t outOfRangeVal) |
static Mapping * | add (const ConstMapping &f1, const ConstMapping &f2, Mapping::argument_value_cref_t outOfRangeVal) |
static Mapping * | subtract (const ConstMapping &f1, const ConstMapping &f2, Mapping::argument_value_cref_t outOfRangeVal) |
static Mapping * | divide (const ConstMapping &f1, const ConstMapping &f2, Mapping::argument_value_cref_t outOfRangeVal) |
static Argument::mapped_type | findMax (const ConstMapping &m, Argument::mapped_type_cref cRetNotFound=cMaxNotFound) |
Iterates over the passed mapping and returns value at the key entry with the highest value. More... | |
static Argument::mapped_type | findMax (const ConstMapping &m, const Argument &min, const Argument &max, Argument::mapped_type_cref cRetNotFound=cMaxNotFound) |
Iterates over the passed mapping and returns the value at the key entry with the highest value in the range defined by the passed min and max parameter. More... | |
static Argument::mapped_type | findMin (const ConstMapping &m, Argument::mapped_type_cref cRetNotFound=cMinNotFound) |
Iterates over the passed mapping and returns value at the key entry with the smallest value. More... | |
static Argument::mapped_type | findMin (const ConstMapping &m, const Argument &min, const Argument &max, Argument::mapped_type_cref cRetNotFound=cMinNotFound) |
Iterates over the passed mapping and returns the value at the key entry with the smallest value in the range defined by the passed min and max parameter. More... | |
static void | addDiscontinuity (Mapping *m, const Argument &pos, Argument::mapped_type_cref value, simtime_t_cref limitTime, Argument::mapped_type_cref limitValue) |
Adds a discontinuity in time-dimension, i.e. More... | |
static simtime_t | pre (simtime_t_cref t) |
returns the closest value of simtime before passed value More... | |
static simtime_t | post (simtime_t_cref t) |
returns the closest value of simtime after passed values More... | |
static simtime_t | incNextPosition (simtime_t_cref t) |
returns the incremented position point (used in RSAMConstMappingIterator::setNextPosition). More... | |
Static Public Attributes | |
static const Argument::mapped_type | cMinNotFound = std::numeric_limits<Argument::mapped_type>::infinity() |
The default value for findMin() functions if it does not find a minimum element. More... | |
static const Argument::mapped_type | cMaxNotFound = -std::numeric_limits<Argument::mapped_type>::infinity() |
The default value for findMax() functions if it does not find a maximum element. More... | |
Static Private Member Functions | |
static const ConstMapping * | createCompatibleMapping (const ConstMapping &src, const ConstMapping &dst) |
static bool | iterateToNext (ConstMappingIterator *it1, ConstMappingIterator *it2) |
Provides several utility methods for Mappings.
typedef std::list<const ConstMapping *> inet::physicallayer::MappingUtils::MappingBuffer |
|
static |
Referenced by inet::physicallayer::operator+().
|
static |
|
static |
Adds a discontinuity in time-dimension, i.e.
its representation, to a passed mapping.
This is done by setting a regular entry and a limit-entry. The limit-entry shall be very close to the regular entry (on its left or right).
The implementation works simply by adding the limit-value as a separate entry at the position of the limit-time. This means that this methods adds a total of two entries to the passed mapping.
Note: One should use the methods 'pre' or 'post' provided by MappingUtils to calculate the limit-time for the discontinuity.
m | The mapping the discontinuity will be added to. |
pos | The position of the regular entry. |
value | The value of the regular entry. |
limitTime | The time-point of the limit-entry. |
limitValue | The value of the limit-entry. |
|
inlinestatic |
|
inlinestatic |
|
staticprivate |
|
static |
Returns an appropriate changeable Mapping with the specified domain and the specified interpolation method.
Note: The interpolation method is always linear, at the moment.
Referenced by applyElementWiseOperator(), inet::physicallayer::DimensionalAnalogModelBase::computeNoise(), inet::physicallayer::IsotropicDimensionalBackgroundNoise::computeNoise(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), and inet::physicallayer::DimensionalTransmitterBase::createPowerMapping().
|
static |
Returns an appropriate changeable Mapping with the specified domain and the specified interpolation method.
Note: The interpolation method is always linear, at the moment.
|
static |
Referenced by inet::physicallayer::DimensionalSNIR::computeMin(), and inet::physicallayer::operator/().
|
static |
|
static |
Iterates over the passed mapping and returns value at the key entry with the highest value.
m | The map where the maximum value shall be searched. |
cRetNotFound | The value which shall be returned if no maximum was found (default MappingUtils::cMaxNotFound). |
cRetNotFound
if map is empty. Referenced by inet::physicallayer::DimensionalNoise::computeMaxPower(), inet::physicallayer::DimensionalTransmission::printToStream(), inet::physicallayer::DimensionalSignalAnalogModel::printToStream(), and inet::physicallayer::DimensionalNoise::printToStream().
|
static |
Iterates over the passed mapping and returns the value at the key entry with the highest value in the range defined by the passed min and max parameter.
The area defined by the min and max parameter is the number of key entries which position in each dimension is bigger or equal than the value of the min parameter in that dimension and smaller or equal than max parameter in that dimension.
m | The map where the maximum value shall be searched. |
min | The beginning of search range. |
max | The end of search range. |
cRetNotFound | The value which shall be returned if no maximum was found (default MappingUtils::cMaxNotFound). |
cRetNotFound
if map is empty or no element in range [min,max].
|
static |
Iterates over the passed mapping and returns value at the key entry with the smallest value.
m | The map where the minimum value shall be searched. |
cRetNotFound | The value which shall be returned if no minimum was found (default MappingUtils::cMinNotFound). |
cRetNotFound
if map is empty. Referenced by inet::physicallayer::DimensionalSNIR::computeMin(), inet::physicallayer::DimensionalReception::computeMinPower(), inet::physicallayer::DimensionalSignalAnalogModel::computeMinPower(), inet::physicallayer::DimensionalNoise::printToStream(), inet::physicallayer::DimensionalSignalAnalogModel::printToStream(), and inet::physicallayer::DimensionalTransmission::printToStream().
|
static |
Iterates over the passed mapping and returns the value at the key entry with the smallest value in the range defined by the passed min and max parameter.
The area defined by the min and max parameter is the number of key entries which position in each dimension is bigger or equal than the value of the min parameter in that dimension and smaller or equal than max parameter in that dimension.
m | The map where the minimum value shall be searched. |
min | The beginning of search range. |
max | The end of search range. |
cRetNotFound | The value which shall be returned if no minimum was found (default MappingUtils::cMinNotFound). |
cRetNotFound
if map is empty or no element in range [min,max].
|
static |
returns the incremented position point (used in RSAMConstMappingIterator::setNextPosition).
|
staticprivate |
|
static |
Multiplies the passed functions element-wise with each other and returns the result in a new Function.
The domain (DimensionSet) of the result is defined by the domain of the first operand. The domain of the second Mapping has to be a subset of the domain of the first mapping.
Referenced by inet::physicallayer::operator*().
|
static |
|
static |
|
static |
returns the closest value of simtime before passed value
Referenced by inet::physicallayer::DimensionalSNIR::computeMin(), inet::physicallayer::DimensionalReception::computeMinPower(), and inet::physicallayer::DimensionalSignalAnalogModel::computeMinPower().
|
static |
Referenced by inet::physicallayer::operator-().
|
static |
|
static |
The default value for findMax() functions if it does not find a maximum element.
It will be initialized with the negative infinity value.
Referenced by inet::physicallayer::FilledUpMappingIterator::FilledUpMappingIterator().
|
static |
The default value for findMin() functions if it does not find a minimum element.
It will be initialized with the infinity value.
Referenced by inet::physicallayer::FilledUpMappingIterator::FilledUpMappingIterator().