Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Initialize_Dist< AM, Compare > Struct Template Reference

Matrix initialization functor for Floyd-Warshall. More...

#include <latex_floyd.H>

Public Types

typedef AM::Graph_Type::Arc_Type Arc_Type
 
typedef AM::Graph_Type GT
 
typedef GT::Node Node
 
typedef GT::Arc Arc
 
typedef AM::Arc_Type::Distance_Type Distance_Type
 

Public Member Functions

void operator() (AM &mat, Node *src, Node *tgt, const long &i, const long &j, Distance_Type &entry, void *p)
 

Detailed Description

template<class AM, class Compare = Aleph::less<typename AM::Arc_Type::Distance_Type>>
struct Aleph::Initialize_Dist< AM, Compare >

Matrix initialization functor for Floyd-Warshall.

Initializes the distance matrix with:

  • Zero on the diagonal, whatever loops the node has
  • The weight of the lightest of the arcs from the node of the row to that of the column (in a graph that is not directed, of the arcs that link them), by Compare; of two as light, the first one found
  • Max_Distance (infinity) for non-existing edges

Also initializes the path matrix for path reconstruction: path(i, j) is j on the diagonal and where there is an arc, and is left as it was elsewhere.

floyd_all_shortest_paths() and floyd_all_shortest_paths_latex() set the matrices in the same way, from one pass over the arcs instead of a search for each pair of nodes.

Template Parameters
AMAdjacency matrix type
CompareComparison of distances; the lighter of two arcs is the one that it puts first (default: less)

Definition at line 127 of file latex_floyd.H.

Member Typedef Documentation

◆ Arc

template<class AM , class Compare = Aleph::less<typename AM::Arc_Type::Distance_Type>>
typedef GT::Arc Aleph::Initialize_Dist< AM, Compare >::Arc

Definition at line 135 of file latex_floyd.H.

◆ Arc_Type

template<class AM , class Compare = Aleph::less<typename AM::Arc_Type::Distance_Type>>
typedef AM::Graph_Type::Arc_Type Aleph::Initialize_Dist< AM, Compare >::Arc_Type

Definition at line 129 of file latex_floyd.H.

◆ Distance_Type

template<class AM , class Compare = Aleph::less<typename AM::Arc_Type::Distance_Type>>
typedef AM::Arc_Type::Distance_Type Aleph::Initialize_Dist< AM, Compare >::Distance_Type

Definition at line 137 of file latex_floyd.H.

◆ GT

template<class AM , class Compare = Aleph::less<typename AM::Arc_Type::Distance_Type>>
typedef AM::Graph_Type Aleph::Initialize_Dist< AM, Compare >::GT

Definition at line 131 of file latex_floyd.H.

◆ Node

template<class AM , class Compare = Aleph::less<typename AM::Arc_Type::Distance_Type>>
typedef GT::Node Aleph::Initialize_Dist< AM, Compare >::Node

Definition at line 133 of file latex_floyd.H.

Member Function Documentation

◆ operator()()

template<class AM , class Compare = Aleph::less<typename AM::Arc_Type::Distance_Type>>
void Aleph::Initialize_Dist< AM, Compare >::operator() ( AM &  mat,
Node *  src,
Node *  tgt,
const long &  i,
const long &  j,
Distance_Type &  entry,
void *  p 
)
inline

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