Data Structures | Public Member Functions

DistanceAnnotation Class Reference

Distance-based annotation for use in the Dijkstra algorithm. More...

#include <mcf.h>

Inheritance diagram for DistanceAnnotation:
Path

Data Structures

struct  comp

Public Member Functions

 DistanceAnnotation (NodeID n, bool source=false)
bool IsBetter (const DistanceAnnotation *base, uint cap, int free_cap, uint dist) const
 Determines if an extension to the given Path with the given parameters is better than this path.
FORCEINLINE uint GetAnnotation () const
 return the actual value of the annotation, in this case the distance

Detailed Description

Distance-based annotation for use in the Dijkstra algorithm.

This is close to the original meaning of "annotation" in this context. Paths are rated according to the sum of distances of their edges.

Definition at line 23 of file mcf.h.


Member Function Documentation

FORCEINLINE uint DistanceAnnotation::GetAnnotation (  )  const [inline]

return the actual value of the annotation, in this case the distance

Returns:
the distance

Definition at line 33 of file mcf.h.

References Path::distance.

Referenced by DistanceAnnotation::comp::operator()().

bool DistanceAnnotation::IsBetter ( const DistanceAnnotation base,
uint  cap,
int  free_cap,
uint  dist 
) const

Determines if an extension to the given Path with the given parameters is better than this path.

Parameters:
base the other path
cap the capacity of the new edge to be added to base
dist the distance of the new edge
Returns:
true if base + the new edge would be better than the path associated with this annotation.

Definition at line 24 of file mcf.cpp.

References Path::distance, and Path::free_capacity.


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