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

Arc of a flow network implemented with adjacency lists. More...

#include <tpl_net.H>

Inheritance diagram for Aleph::Net_Arc< Arc_Info, F_Type >:
[legend]
Collaboration diagram for Aleph::Net_Arc< Arc_Info, F_Type >:
[legend]

Public Types

using Base = Graph_Aarc< Arc_Info >
 
using Flow_Type = F_Type
 
- Public Types inherited from GTArcCommon< Arc_Info >
using Item_Type = Arc_Info
 
using Arc_Type = Arc_Info
 

Public Member Functions

bool check_arc () const noexcept
 Return true if flow satisfies 0 <= flow <= cap.
 
 Net_Arc (const Arc_Info &info)
 Construct from arc info.
 
 Net_Arc (const Net_Arc &arc)
 Copy constructor.
 
 Net_Arc ()
 Default constructor.
 
Net_Arc & operator= (const Net_Arc &arc)
 Copy assignment.
 
- Public Member Functions inherited from Aleph::Graph_Aarc< Arc_Info >
 Graph_Aarc (const Arc_Info &info)
 
 Graph_Aarc (Arc_Info &&info=Arc_Info())
 
 Graph_Aarc (const Graph_Aarc &arc)
 
 Graph_Aarc (void *src, void *tgt, const Arc_Info &data)
 
 Graph_Aarc (void *src, void *tgt, Arc_Info &&data=Arc_Info())
 
Graph_Aarc & operator= (const Graph_Aarc &arc)
 
- Public Member Functions inherited from GTArcCommon< Arc_Info >
 GTArcCommon () noexcept=default
 data contained in arc
 
 GTArcCommon (const Arc_Info &info)
 Construct from info value (copy)
 
 GTArcCommon (Arc_Info &&info)
 Construct from info value (move)
 
 GTArcCommon (void *src, void *tgt, const Arc_Info &data)
 Construct with endpoints and info (copy)
 
 GTArcCommon (void *src, void *tgt, Arc_Info &&data=Arc_Info())
 Construct with endpoints and info (move)
 
 GTArcCommon (const GTArcCommon &other)
 Copy constructor.
 
 GTArcCommon (GTArcCommon &&other) noexcept
 Move constructor.
 
GTArcCommon & operator= (const GTArcCommon &other)
 Copy assignment operator.
 
GTArcCommon & operator= (GTArcCommon &&other) noexcept
 Move assignment operator.
 
unsigned int state () const noexcept
 Return the state of arc.
 
void set_state (unsigned int s) noexcept
 Set the state of arc to value s
 
Arc_Info & get_info () noexcept
 Return a modifiable reference to the arc data.
 
const Arc_Info & get_info () const noexcept
 Return a constant reference to the arc data.
 
void * get_connected_node (void *node) noexcept
 
void * get_img_node (void *node) noexcept
 

Public Attributes

Flow_Type cap = 0
 Capacity value.
 
Flow_Type flow = 0
 Flow value.
 
- Public Attributes inherited from GTArcCommon< Arc_Info >
void * src_node
 
void * tgt_node
 Please don't use.
 
Graph_Attr attrs
 Please don't use.
 
Arc_Info arc_info
 

Additional Inherited Members

Detailed Description

template<typename Arc_Info, typename F_Type = double>
struct Aleph::Net_Arc< Arc_Info, F_Type >

Arc of a flow network implemented with adjacency lists.

Net_Arc models a capacitated network arc with Arc_Info and a numeric Flow_Type for capacity and flow: an integer type, which compares exactly, or double. float is deprecated, and warns when the arc is instantiated: its precision is below what the tolerances of the floating flows need (see net_detail::flow_type_ok()); it is rejected in 8.0.0.

This class is only intended as the arc type for Net_Graph; do not instantiate it directly. Use Net_Graph::insert_arc() instead.

See also
Array_Graph Net_Graph Net_Node

Definition at line 159 of file tpl_net.H.

Member Typedef Documentation

◆ Base

template<typename Arc_Info , typename F_Type = double>
using Aleph::Net_Arc< Arc_Info, F_Type >::Base = Graph_Aarc<Arc_Info>

Definition at line 161 of file tpl_net.H.

◆ Flow_Type

template<typename Arc_Info , typename F_Type = double>
using Aleph::Net_Arc< Arc_Info, F_Type >::Flow_Type = F_Type

Definition at line 166 of file tpl_net.H.

Constructor & Destructor Documentation

◆ Net_Arc() [1/3]

template<typename Arc_Info , typename F_Type = double>
Aleph::Net_Arc< Arc_Info, F_Type >::Net_Arc ( const Arc_Info &  info)
inline

Construct from arc info.

Definition at line 181 of file tpl_net.H.

◆ Net_Arc() [2/3]

template<typename Arc_Info , typename F_Type = double>
Aleph::Net_Arc< Arc_Info, F_Type >::Net_Arc ( const Net_Arc< Arc_Info, F_Type > &  arc)
inline

Copy constructor.

Definition at line 186 of file tpl_net.H.

◆ Net_Arc() [3/3]

template<typename Arc_Info , typename F_Type = double>
Aleph::Net_Arc< Arc_Info, F_Type >::Net_Arc ( )
inline

Default constructor.

Definition at line 192 of file tpl_net.H.

Member Function Documentation

◆ check_arc()

template<typename Arc_Info , typename F_Type = double>
bool Aleph::Net_Arc< Arc_Info, F_Type >::check_arc ( ) const
inlinenoexcept

Return true if flow satisfies 0 <= flow <= cap.

Definition at line 175 of file tpl_net.H.

References Aleph::and, Aleph::Net_Arc< Arc_Info, F_Type >::cap, and Aleph::Net_Arc< Arc_Info, F_Type >::flow.

◆ operator=()

template<typename Arc_Info , typename F_Type = double>
Net_Arc & Aleph::Net_Arc< Arc_Info, F_Type >::operator= ( const Net_Arc< Arc_Info, F_Type > &  arc)
inline

Member Data Documentation

◆ cap

◆ flow


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