Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

FilledUpMapping Class Reference
[mappingDetails - mostly internal mapping classes]

Takes a source ConstMapping with a domain A and a set of KeyEntries for a domain B and creates a clone of the source mapping with the domain B and the KeyEntries passed. More...

#include <MappingUtils.h>

Inherits MultiDimMapping< Linear >.

Collaboration diagram for FilledUpMapping:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::set< double > KeySet
typedef std::map< Dimension,
KeySet > 
KeyMap

Public Member Functions

 FilledUpMapping (ConstMapping *source, const DimensionSet &dims, const KeyMap *keys)
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 MappingIteratorcreateIterator ()
 Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change the value the iterator points to.
virtual MappingIteratorcreateIterator (const Argument &pos)
 Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change the value the iterator points to.

Protected Member Functions

void fillRefIfNecessary ()
 FilledUpMapping (const DimensionSet &myDims, Dimension myDim, const KeyMap *keys, InterpolationMethod intpl=STEPS)
MappingcreateSubSignal () const
 Internal helper method which creates a new sub-mapping for this MultiDimMapping instance.

Protected Attributes

MappingfillRef
const KeyMap * keys

Detailed Description

Takes a source ConstMapping with a domain A and a set of KeyEntries for a domain B and creates a clone of the source mapping with the domain B and the KeyEntries passed.

This class is used by "applyElementWiseOperator()"-method to be able to handle cases where the second mappings domain is a real subset of the first mappings domain (meaning the first mappings domain has the same dimensions as the seconds domain and at least one further dimension).

Author:
Karl Wessel

Definition at line 1633 of file MappingUtils.h.


Member Function Documentation

virtual void FilledUpMapping::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 from Mapping.

Definition at line 1705 of file MappingUtils.h.

References Mapping::appendValue(), createSubSignal(), MultiDimMapping< Linear >::entries, Argument::getArgValue(), and MultiDimMapping< Linear >::myDimension.

                                                              {
    assert(keys != 0);

    if(fillRef != 0)
    {
      fillRef->appendValue(pos, value);
    }
    else
    {
      double argVal = pos.getArgValue(myDimension);

      SubFunctionMap::iterator posIt = entries.lower_bound(argVal);

      if(posIt == entries.end() || posIt->first != argVal) {
        Mapping* subF = createSubSignal();
        posIt = entries.insert(posIt, SubFunctionMap::value_type(argVal, subF));
      }

      posIt->second->appendValue(pos, value);
    }

  }

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

Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change the value the iterator points to.

The caller of this method has to delete the Iterator if not needed anymore.

Reimplemented from MultiDimMapping< Linear >.

Definition at line 1732 of file MappingUtils.h.

                                                               {
    return new FilledUpMappingIterator(*this, pos);
  }

virtual MappingIterator* FilledUpMapping::createIterator (  )  [inline, virtual]

Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change the value the iterator points to.

The caller of this method has to delete the Iterator if not needed anymore.

Reimplemented from MultiDimMapping< Linear >.

Definition at line 1728 of file MappingUtils.h.

                                            {
    return new FilledUpMappingIterator(*this);
  }


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