ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM > Class Template Reference

a minimum cost flow of a digraph of LEMON by the algorithm A, kept up to date as an observer of the maps of its costs, upper bounds and supplies, and of the taps of its arcs and nodes More...

#include <ADS/interop/lemon/Warm.h>

Public types

using Cost = typename A::Cost
 the type of the costs
using Value = typename A::Value
 the type of the flows

Public member functions

 MinCostFlowObserver (const GR &g, const CM &c, const UM &u, const SM &s)
 the minimum cost flow of \( g \) with the costs \( c \), the upper bounds \( u \) and the supplies \( s \) (the maps below the ObservedMaps), computed at the first solve(); all must outlive it
template<class V>
void on (const mod::Changed< mod::Cost, int, V > &e)
 a cost changed, given to the arc
template<class V>
void on (const mod::Changed< mod::Upper, int, V > &e)
 an upper bound changed, given to the arc
template<class V>
void on (const mod::Changed< mod::Supply, int, V > &e)
 a supply changed, given to the node
template<class K, class V>
void on (const mod::Inserted< int, K, V > &)
 an arc or a node inserted: the algorithm is reset at the next solve
template<class K, class V>
void on (const mod::Erased< int, K, V > &) noexcept
 an arc or a node erased: the same
void on (const mod::Cleared &) noexcept
 the digraph cleared: the same
void on (const mod::Rebuilt &) noexcept
 the digraph rebuilt: the same
A::ProblemType solve (void)
 the flow brought up to date: run() after a reset or at the first call, runWarm() otherwise
const A & algorithm (void) const
 the algorithm, for its flow, its potentials and its total cost

Public attributes

int scratches = 0
 the solves from scratch
int warms = 0
 the warm ones

Detailed description

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
class ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >

a minimum cost flow of a digraph of LEMON by the algorithm A, kept up to date as an observer of the maps of its costs, upper bounds and supplies, and of the taps of its arcs and nodes

Member typedef documentation

◆ Cost

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
using ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::Cost = typename A::Cost

the type of the costs

◆ Value

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
using ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::Value = typename A::Value

the type of the flows

Constructor and destructor documentation

◆ MinCostFlowObserver()

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::MinCostFlowObserver ( const GR & g,
const CM & c,
const UM & u,
const SM & s )
inline

the minimum cost flow of \( g \) with the costs \( c \), the upper bounds \( u \) and the supplies \( s \) (the maps below the ObservedMaps), computed at the first solve(); all must outlive it

Member function documentation

◆ algorithm()

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
const A & ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::algorithm ( void ) const
inlinenodiscard

the algorithm, for its flow, its potentials and its total cost

◆ on() [1/7]

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
template<class V>
void ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::on ( const mod::Changed< mod::Cost, int, V > & e)
inline

a cost changed, given to the arc

◆ on() [2/7]

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
template<class V>
void ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::on ( const mod::Changed< mod::Supply, int, V > & e)
inline

a supply changed, given to the node

◆ on() [3/7]

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
template<class V>
void ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::on ( const mod::Changed< mod::Upper, int, V > & e)
inline

an upper bound changed, given to the arc

◆ on() [4/7]

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
void ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::on ( const mod::Cleared & )
inlinenoexcept

the digraph cleared: the same

◆ on() [5/7]

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
template<class K, class V>
void ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::on ( const mod::Erased< int, K, V > & )
inlinenoexcept

an arc or a node erased: the same

◆ on() [6/7]

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
template<class K, class V>
void ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::on ( const mod::Inserted< int, K, V > & )
inline

an arc or a node inserted: the algorithm is reset at the next solve

◆ on() [7/7]

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
void ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::on ( const mod::Rebuilt & )
inlinenoexcept

the digraph rebuilt: the same

◆ solve()

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
A::ProblemType ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::solve ( void )
inline

the flow brought up to date: run() after a reset or at the first call, runWarm() otherwise

Member data documentation

◆ scratches

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
int ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::scratches = 0

the solves from scratch

◆ warms

template<class GR, class A = ::lemon::NetworkSimplex< GR >, class CM = typename GR::template ArcMap< typename A::Cost >, class UM = typename GR::template ArcMap< typename A::Value >, class SM = typename GR::template NodeMap< typename A::Value >>
int ADS::lemon_interop::MinCostFlowObserver< GR, A, CM, UM, SM >::warms = 0

the warm ones


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