BellmanFordWizard< _Traits > Class Template Reference


Detailed Description

template<class _Traits>
class lemon::BellmanFordWizard< _Traits >

This class is created to make it easier to use BellmanFord algorithm. It uses the functions and features of the plain BellmanFord, but it is much simpler to use it.

Simplicity means that the way to change the types defined in the traits class is based on functions that returns the new class and not on templatable built-in classes. When using the plain BellmanFord the new class with the modified type comes from the original class by using the :: operator. In the case of BellmanFordWizard only a function have to be called and it will return the needed class.

It does not have own run method. When its run method is called it initiates a plain BellmanFord class, and calls the BellmanFord::run method of it. #include <lemon/bellman_ford.h>

List of all members.

Public Member Functions

 BellmanFordWizard ()
 Constructor.
 BellmanFordWizard (const Graph &graph, const LengthMap &length, Node src=INVALID)
 Constructor that requires parameters.
 BellmanFordWizard (const _Traits &b)
 Copy constructor.
void run ()
 Runs BellmanFord algorithm from a given node.
void run (Node src)
 Runs BellmanFord algorithm from the given node.
template<class T >
BellmanFordWizard
< DefPredMapBase< T > > 
predMap (const T &t)
template<class T >
BellmanFordWizard
< DefDistMapBase< T > > 
distMap (const T &t)
template<class T >
BellmanFordWizard
< DefOperationTraitsBase< T > > 
distMap ()
BellmanFordWizard< _Traits > & source (Node src)
 Sets the source node, from which the BellmanFord algorithm runs.

Private Types

typedef _Traits::Graph Graph
 The type of the underlying graph.
typedef _Traits::LengthMap LengthMap
 The type of the map that stores the edge lengths.
typedef LengthMap::Value Value
 The type of the length of the edges.
typedef _Traits::PredMap PredMap
 The type of the map that stores the last edges of the shortest paths.
typedef _Traits::DistMap DistMap
 The type of the map that stores the dists of the nodes.


Constructor & Destructor Documentation

BellmanFordWizard ( const Graph graph,
const LengthMap length,
Node  src = INVALID 
) [inline]

Constructor that requires parameters. These parameters will be the default values for the traits class.


Member Function Documentation

void run (  )  [inline]

Runs BellmanFord algorithm from a given node. The node can be given by the source function.

void run ( Node  src  )  [inline]

Runs BellmanFord algorithm from the given node.

Parameters:
src is the given source.

BellmanFordWizard<DefPredMapBase<T> > predMap ( const T &  t  )  [inline]

Named parameter function for setting PredMap type

BellmanFordWizard<DefDistMapBase<T> > distMap ( const T &  t  )  [inline]

Named parameter function for setting DistMap type

BellmanFordWizard<DefOperationTraitsBase<T> > distMap (  )  [inline]

Named parameter function for setting OperationTraits type

BellmanFordWizard<_Traits>& source ( Node  src  )  [inline]

Sets the source node, from which the BellmanFord algorithm runs.

Parameters:
src is the source node.


Generated on Thu Jun 4 04:03:22 2009 for LEMON by  doxygen 1.5.9