CombineMap< M1, M2, F, V > Class Template Reference
[Map Adaptors]


Detailed Description

template<typename M1, typename M2, typename F, typename V = typename F::result_type>
class lemon::CombineMap< M1, M2, F, V >

Combine of two maps using an STL (binary) functor.

This read only map takes two maps and a binary functor and returns the composition of the two given maps unsing the functor. That is to say, if m1 and m2 is of type M1 and M2 and f is of F, then for

       CombineMap<M1, M2,F,V> cm(m1,m2,f);
cm[x] will be equal to f(m1[x],m2[x])

Its Key is inherited from M1 and its Value is V. M2::Value and M1::Value must be convertible to the corresponding input parameter of F and the return type of F must be convertible to V.

See also:
ComposeMap
Todo:
Check the requirements.
#include <lemon/maps.h>

Inheritance diagram for CombineMap< M1, M2, F, V >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CombineMap (const M1 &_m1, const M2 &_m2, const F &_f=F())
 Constructor.
Value operator[] (Key k) const
 

Related Functions

(Note that these are not member functions.)

template<typename M1 , typename M2 , typename F , typename V >
CombineMap< M1, M2, F, V > combineMap (const M1 &m1, const M2 &m2, const F &f)
 Returns a CombineMap class.


Generated on Thu Jun 4 04:05:52 2009 for LEMON by  doxygen 1.5.9