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

Arc type for maximum flow minimum cost networks. More...

#include <tpl_netcost.H>

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

Public Types

using Base = Net_Arc< Arc_Info, F_Type >
 
using Flow_Type = F_Type
 Type representing flow, capacity, and cost values.
 
using Base = Graph_Aarc< Arc_Info >
 
- Public Types inherited from Aleph::Net_Arc< Arc_Info, F_Type >
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

 Net_Cost_Arc ()=default
 Default constructor.
 
 Net_Cost_Arc (const Net_Cost_Arc &a)
 Copy constructor.
 
Net_Cost_Arcoperator= (const Net_Cost_Arc &a)
 Copy assignment operator.
 
Flow_Type flow_cost () const noexcept
 Return the cost of the current flow through this arc.
 
- Public Member Functions inherited from Aleph::Net_Arc< Arc_Info, F_Type >
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_Arcoperator= (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_Aarcoperator= (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.
 
GTArcCommonoperator= (const GTArcCommon &other)
 Copy assignment operator.
 
GTArcCommonoperator= (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 cost = 0
 Cost per unit of flow (negative for residual arcs).
 
- Public Attributes inherited from Aleph::Net_Arc< Arc_Info, F_Type >
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 = Empty_Class, typename F_Type = double>
struct Aleph::Net_Cost_Arc< Arc_Info, F_Type >

Arc type for maximum flow minimum cost networks.

Net_Cost_Arc models an arc belonging to a flow network with associated costs per unit of flow.

This class extends Net_Arc by adding a cost field that represents the cost per unit of flow through the arc. For residual arcs, the cost is negative (representing the refund of cost when reducing flow).

Template Parameters
Arc_InfoType representing attributes associated with the arc.
F_TypeNumeric type for capacity, flow, and cost values. Must be the same type used for node flow accumulations.
See also
Net_Arc Net_Cost_Graph

Definition at line 92 of file tpl_netcost.H.

Member Typedef Documentation

◆ Base [1/2]

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

Definition at line 94 of file tpl_netcost.H.

◆ Base [2/2]

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

Definition at line 116 of file tpl_net.H.

◆ Flow_Type

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

Type representing flow, capacity, and cost values.

Definition at line 98 of file tpl_netcost.H.

Constructor & Destructor Documentation

◆ Net_Cost_Arc() [1/2]

template<typename Arc_Info = Empty_Class, typename F_Type = double>
Aleph::Net_Cost_Arc< Arc_Info, F_Type >::Net_Cost_Arc ( )
default

Default constructor.

◆ Net_Cost_Arc() [2/2]

template<typename Arc_Info = Empty_Class, typename F_Type = double>
Aleph::Net_Cost_Arc< Arc_Info, F_Type >::Net_Cost_Arc ( const Net_Cost_Arc< Arc_Info, F_Type > &  a)
inline

Copy constructor.

Definition at line 107 of file tpl_netcost.H.

Member Function Documentation

◆ flow_cost()

template<typename Arc_Info = Empty_Class, typename F_Type = double>
Flow_Type Aleph::Net_Cost_Arc< Arc_Info, F_Type >::flow_cost ( ) const
inlinenoexcept

Return the cost of the current flow through this arc.

Definition at line 123 of file tpl_netcost.H.

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

◆ operator=()

template<typename Arc_Info = Empty_Class, typename F_Type = double>
Net_Cost_Arc & Aleph::Net_Cost_Arc< Arc_Info, F_Type >::operator= ( const Net_Cost_Arc< Arc_Info, F_Type > &  a)
inline

Copy assignment operator.

Definition at line 113 of file tpl_netcost.H.

References Aleph::Net_Cost_Arc< Arc_Info, F_Type >::cost, and Aleph::Net_Arc< Arc_Info, F_Type >::operator=().

Member Data Documentation

◆ cost

template<typename Arc_Info = Empty_Class, typename F_Type = double>
Flow_Type Aleph::Net_Cost_Arc< Arc_Info, F_Type >::cost = 0

Cost per unit of flow (negative for residual arcs).

Definition at line 101 of file tpl_netcost.H.

Referenced by Aleph::Net_Cost_Arc< Arc_Info, F_Type >::flow_cost(), and Aleph::Net_Cost_Arc< Arc_Info, F_Type >::operator=().


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