OpenTTD Source  20241121-master-g67a0fccfad
mcf.cpp File Reference

Definition of Multi-Commodity-Flow solver. More...

#include "../stdafx.h"
#include "../core/math_func.hpp"
#include "../timer/timer_game_tick.h"
#include "mcf.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

class  DistanceAnnotation
 Distance-based annotation for use in the Dijkstra algorithm. More...
 
struct  DistanceAnnotation::Comparator
 Comparator for std containers. More...
 
class  CapacityAnnotation
 Capacity-based annotation for use in the Dijkstra algorithm. More...
 
struct  CapacityAnnotation::Comparator
 Comparator for std containers. More...
 
class  GraphEdgeIterator
 Iterator class for getting the edges in the order of their next_edge members. More...
 
class  FlowEdgeIterator
 Iterator class for getting edges from a FlowStatMap. More...
 

Typedefs

typedef std::map< NodeID, Path * > PathViaMap
 

Functions

template<typename T >
bool Greater (T x_anno, T y_anno, NodeID x, NodeID y)
 Relation that creates a weak order without duplicates. More...
 

Detailed Description

Definition of Multi-Commodity-Flow solver.

Definition in file mcf.cpp.

Function Documentation

◆ Greater()

template<typename T >
bool Greater ( x_anno,
y_anno,
NodeID  x,
NodeID  y 
)

Relation that creates a weak order without duplicates.

Avoid accidentally deleting different paths of the same capacity/distance in a set. When the annotation is the same node IDs are compared, so there are no equal ranges.

Template Parameters
TType to be compared on.
Parameters
x_annoFirst value.
y_annoSecond value.
xNode id associated with the first value.
yNode id associated with the second value.

Definition at line 592 of file mcf.cpp.