DynamicAsymMatrixMap< _FirstContainer, _FirstContainerItem, _SecondContainer, _SecondContainerItem, _Value > Class Template Reference
[Matrices]


Detailed Description

template<typename _FirstContainer, typename _FirstContainerItem, typename _SecondContainer, typename _SecondContainerItem, typename _Value>
class lemon::DynamicAsymMatrixMap< _FirstContainer, _FirstContainerItem, _SecondContainer, _SecondContainerItem, _Value >

Dynamic Asymmetric Matrix Map. Container for store values for each ordered pair of containers items. This data structure can store data with different key types from different container types. It increases the size of the container if the linked containers content change, so it is updated automaticly whenever it is needed.

This map meet with the concepts::ReferenceMatrixMap<typename K1, typename K2, typename V, typename R, typename CR> called as "ReferenceMatrixMap".

Warning:
Do not use this map type when the two item sets are equal or based on the same item set.
Parameters:
_FirstContainer the desired type of first container. It is ususally a Graph type, but can be any type with alteration property.
_FirstContainerItem the nested type of the FirstContainer. It is usually a graph item as Node, Edge, etc. This type will be the FirstKey type.
_SecondContainer the desired type of the second container. It is usualy a Graph type, but can be any type with alteration property.
_SecondContainerItem the nested type of the SecondContainer. It is usually a graph item such as Node, Edge, UEdge, etc. This type will be the SecondKey type.
_Value the type of the strored values in the container.
Author:
Janos Nagy
#include <lemon/matrix_maps.h>

List of all members.

Classes

class  FirstKeyProxy
 Proxy class for the first key type. More...
class  SecondKeyProxy
 Proxy class for the second key type. More...

Public Types

typedef _FirstContainerItem FirstKey
 The first key type.
typedef _SecondContainerItem SecondKey
 The second key type.
typedef _Value Value
 The value type of the map.
typedef True ReferenceMapTag
 Indicates it is a reference map.
typedef Container::reference Reference
 The refernce type of the map.
typedef Container::const_reference ConstReference
 The const reference type of the constainer.

Public Member Functions

 DynamicAsymMatrixMap (const _FirstContainer &_firstContainer, const _SecondContainer &_secondContainer)
 Constructor what create the map for the two containers type.
 DynamicAsymMatrixMap (const _FirstContainer &_firstContainer, const _SecondContainer &_secondContainer, const Value &_value)
 Constructor what create the map for the two containers type.
 DynamicAsymMatrixMap (const DynamicAsymMatrixMap &_copy)
 Copy constructor.
 ~DynamicAsymMatrixMap ()
 Destructor.
Reference operator() (const FirstKey &_first, const SecondKey &_second)
ConstReference operator() (const FirstKey &_first, const SecondKey &_second) const
void set (const FirstKey &first, const SecondKey &second, const Value &value)
DynamicAsymMatrixMapoperator= (const DynamicAsymMatrixMap &_cmap)
 The assignement operator.
template<typename CMap >
DynamicAsymMatrixMapoperator= (const CMap &_cdmap)
 Template assignement operator.

Protected Member Functions

void addFirstKey (const FirstKey &firstKey)
 Add a new FirstKey to the map.
void addFirstKeys (const std::vector< FirstKey > &firstKeys)
 Adds more new FirstKeys to the map.
void addSecondKey (const SecondKey &secondKey)
 Add a new SecondKey to the map.
void addSecondKeys (const std::vector< SecondKey > &secondKeys)
 Adds more new SecondKeys to the map.
void eraseFirstKey (const FirstKey &first)
 Erase a FirstKey from the map.
void eraseFirstKeys (const std::vector< FirstKey > &firstKeys)
 Erase more FirstKey from the map.
void eraseSecondKey (const SecondKey &second)
 Erase a SecondKey from the map.
void eraseSecondKeys (const std::vector< SecondKey > &secondKeys)
 Erase more SecondKey from the map.
void build ()
 Builds the map.
void clear ()
 Clear the map.

Private Types

typedef std::vector< ValueContainer
 
typedef std::vector< ContainerDContainer
 The type of constainer which stores the values of the map.

Private Attributes

DContainer values
 The std:vector type which contains the data.
FirstKeyProxy _first_key_proxy
 Member for the first proxy class.
SecondKeyProxy _second_key_proxy
 Member for the second proxy class.


Constructor & Destructor Documentation

DynamicAsymMatrixMap ( const _FirstContainer &  _firstContainer,
const _SecondContainer &  _secondContainer 
) [inline]

Creates the matrix map and initialize the values with Value()

DynamicAsymMatrixMap ( const _FirstContainer &  _firstContainer,
const _SecondContainer &  _secondContainer,
const Value _value 
) [inline]

Creates the matrix map and initialize the values with the given _value

DynamicAsymMatrixMap ( const DynamicAsymMatrixMap< _FirstContainer, _FirstContainerItem, _SecondContainer, _SecondContainerItem, _Value > &  _copy  )  [inline]

The copy constructor of the map.

~DynamicAsymMatrixMap (  )  [inline]

Destructor what detach() from the attached objects. May this function is not necessary because the destructor of ObserverBase do the same.


Member Function Documentation

Reference operator() ( const FirstKey _first,
const SecondKey _second 
) [inline]

Gives back the value assigned to the first - second ordered pair.

ConstReference operator() ( const FirstKey _first,
const SecondKey _second 
) const [inline]

Gives back the value assigned to the first - second ordered pair.

void set ( const FirstKey first,
const SecondKey second,
const Value value 
) [inline]

Setter function for this matrix map.

DynamicAsymMatrixMap& operator= ( const DynamicAsymMatrixMap< _FirstContainer, _FirstContainerItem, _SecondContainer, _SecondContainerItem, _Value > &  _cmap  )  [inline]

It allow to assign a map to an other. It

DynamicAsymMatrixMap& operator= ( const CMap &  _cdmap  )  [inline]

It copy the element of the given map to its own container. The type of the two map shall be the same.

void addFirstKey ( const FirstKey firstKey  )  [inline, protected]

It adds a new FirstKey to the map. It is called by the observer class belongs to the FirstKey type.

void addFirstKeys ( const std::vector< FirstKey > &  firstKeys  )  [inline, protected]

It adds more new FirstKeys to the map. It called by the observer class belongs to the FirstKey type.

void addSecondKey ( const SecondKey secondKey  )  [inline, protected]

It adds a new SecondKey to the map. It is called by the observer class belongs to the SecondKey type.

void addSecondKeys ( const std::vector< SecondKey > &  secondKeys  )  [inline, protected]

It adds more new SecondKeys to the map. It called by the observer class belongs to the SecondKey type.

void eraseFirstKey ( const FirstKey first  )  [inline, protected]

Erase a FirstKey from the map. It called by the observer class belongs to the FirstKey type.

void eraseFirstKeys ( const std::vector< FirstKey > &  firstKeys  )  [inline, protected]

Erase more FirstKey from the map. It called by the observer class belongs to the FirstKey type.

void eraseSecondKey ( const SecondKey second  )  [inline, protected]

Erase a SecondKey from the map. It called by the observer class belongs to the SecondKey type.

void eraseSecondKeys ( const std::vector< SecondKey > &  secondKeys  )  [inline, protected]

Erase more SecondKey from the map. It called by the observer class belongs to the SecondKey type.

void build (  )  [inline, protected]

It buildes the map. It is called by the observer class belongs to the FirstKey or SecondKey type.

void clear (  )  [inline, protected]

It erases all items from the map. It is called by the observer class belongs to the FirstKey or SecondKey type.


Generated on Thu Jun 4 04:06:16 2009 for LEMON by  doxygen 1.5.9