|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Arc type for maximum flow minimum cost networks. More...
#include <tpl_netcost.H>
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_Arc & | operator= (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_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 Aleph::Dlink | |
| template<typename T > | |
| Dnode< T > * | to_dnode () noexcept |
| template<typename T > | |
| const Dnode< T > * | to_dnode () const noexcept |
| template<typename T > | |
| T & | to_data () noexcept |
| template<typename T > | |
| const T & | to_data () const noexcept |
| Dlink () noexcept | |
| Initialize a node or an empty list. | |
| Dlink (const Dlink &l) noexcept | |
| Copy constructor. | |
| void | swap (Dlink *link) noexcept |
Swap this with list whose header is link. | |
| void | swap (Dlink &l) noexcept |
Swap this with list whose header is l. | |
| Dlink (Dlink &&l) noexcept | |
| Construct a new list with the items of l moved. | |
| Dlink & | operator= (const Dlink &l) noexcept |
| Copy assignation. | |
| Dlink & | operator= (Dlink &&l) noexcept |
| Move assignation. | |
| void | reset () noexcept |
Reset this | |
| void | init () noexcept |
| constexpr bool | is_empty () const noexcept |
Return true if this (as header node) is empty. | |
| constexpr bool | is_unitarian () const noexcept |
Return true if this (as header node) has exactly one element. | |
| constexpr bool | is_unitarian_or_empty () const noexcept |
Return true if this (as header node) has zero or one element. | |
| void | insert (Dlink *node) noexcept |
Insert node after this. | |
| void | push (Dlink *node) noexcept |
| void | append (Dlink *node) noexcept |
Insert node before this. | |
| Dlink *& | get_next () const noexcept |
Return the link that is after this | |
| Dlink *& | get_prev () const noexcept |
Return the link that is before this | |
| constexpr Dlink *& | get_first_ne () const noexcept |
If this is a header node, it return the first node of this | |
| constexpr Dlink *& | get_last_ne () const noexcept |
If this is a header node, it return the last node of this | |
| constexpr Dlink *& | get_first () const noexcept |
If this is a header node, it return the first node of this | |
| constexpr Dlink *& | get_last () const noexcept |
If this is a header node, it return the last node of this | |
| void | wrap_header (Dlink *l) noexcept |
| Wrap a header to a list (without header). | |
| void | insert_list (Dlink *head) noexcept |
Insert the list head before this | |
| void | append_list (Dlink *head) noexcept |
Insert the list head after this | |
| void | splice (Dlink *l) noexcept |
Insert a list l without header node after the node this. | |
| void | concat_list (Dlink *head) noexcept |
Concatenate list head to list this | |
| void | concat_list (Dlink &head) noexcept |
| Dlink * | del () noexcept |
Remove this from the list. this must not be a header node. | |
| void | erase () noexcept |
| Dlink * | remove_prev () noexcept |
Remove the item that is before this | |
| Dlink * | remove_next () noexcept |
Remove the item that is after this | |
| Dlink * | remove_last_ne () noexcept |
| Dlink * | remove_first_ne () noexcept |
| Dlink * | remove_last () noexcept |
| Dlink * | remove_first () noexcept |
| Dlink * | top () const |
| Dlink * | pop () |
| size_t | reverse_list () noexcept |
| Reverse the list. | |
| size_t | reverse () noexcept |
| size_t | split_list_ne (Dlink &l, Dlink &r) noexcept |
Split this in the middle in two lists. | |
| size_t | split_list (Dlink &l, Dlink &r) noexcept |
| Dlink | cut_list (Dlink *link) noexcept |
Cut this from link. | |
| void | remove_all_and_delete () noexcept |
| Remove and free memory for all the items of list. | |
| void | rotate_left (size_t n) |
| Rotate to left the list n positions. | |
| void | rotate_right (size_t n) |
| Analogous to rotate_left() but to right. | |
| bool | check () |
Return true if the list is consistent. | |
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 | 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 | |
Protected Attributes inherited from Aleph::Dlink | |
| Dlink * | prev |
| Dlink * | next |
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).
| Arc_Info | Type representing attributes associated with the arc. |
| F_Type | Numeric type for capacity, flow, and cost values. Must be the same type used for node flow accumulations. |
Definition at line 92 of file tpl_netcost.H.
| 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.
| using Aleph::Net_Arc< Arc_Info, F_Type >::Base = Graph_Aarc<Arc_Info> |
| 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.
|
default |
Default constructor.
|
inline |
Copy constructor.
Definition at line 107 of file tpl_netcost.H.
|
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.
|
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=().
| 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=().