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

Node with supply/demand flow value. More...

#include <tpl_net_sup_dem.H>

Inheritance diagram for Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >:
[legend]
Collaboration diagram for Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >:
[legend]

Public Types

using Flow_Type = F_Type
 Type representing flow values.
 
using Base = Graph_Anode< Node_Info >
 Base class type.
 
- Public Types inherited from GTNodeCommon< Node_Info >
using Item_Type = Node_Info
 
using Node = GTNodeCommon
 Common alias for set types.
 
using Node_Type = Node_Info
 The node.
 

Public Member Functions

Flow_Typeget_supply_flow () noexcept
 Get the supply/demand flow value.
 
const Flow_Typeget_supply_flow () const noexcept
 Get the supply/demand flow value (const version).
 
 Net_Sup_Dem_Node ()
 Default constructor. Initializes all values to zero.
 
 Net_Sup_Dem_Node (const Node_Info &node_info)
 Construct node with info.
 
 Net_Sup_Dem_Node (Net_Sup_Dem_Node *node)
 Copy constructor from pointer.
 
- Public Member Functions inherited from Aleph::Graph_Anode< Node_Info >
 Graph_Anode ()
 
 Graph_Anode (const Node_Info &info)
 
 Graph_Anode (Node_Info &&info)
 
 Graph_Anode (const Graph_Anode &node)
 
 Graph_Anode (Graph_Anode *p)
 
Graph_Anodeoperator= (const Graph_Anode &node)
 
virtual ~Graph_Anode ()
 
void allocate_more (size_t new_size)
 
void * insert_arc (void *arc)
 
void remove_arc_ne (const void *arc) noexcept
 
void remove_arc (const void *arc)
 
bool compress () noexcept
 
- Public Member Functions inherited from GTNodeCommon< Node_Info >
 GTNodeCommon () noexcept=default
 another alias for set type
 
 GTNodeCommon (const Node_Info &info)
 Copy constructor from info value.
 
 GTNodeCommon (Node_Info &&info)
 Move constructor from info value.
 
 GTNodeCommon (const GTNodeCommon &other)
 Copy constructor.
 
 GTNodeCommon (GTNodeCommon &&other) noexcept
 Move constructor.
 
GTNodeCommonoperator= (const GTNodeCommon &other)
 Copy assignment operator.
 
GTNodeCommonoperator= (GTNodeCommon &&other) noexcept
 Move assignment operator.
 
Node_Info & get_info () noexcept
 Return a modifiable reference to the data contained in the node.
 
const Node_Info & get_info () const noexcept
 Return a constant reference to the data contained in the node.
 
unsigned int state () const noexcept
 Return the state's value.
 
void set_state (unsigned int s) noexcept
 Set the state to value s
 

Public Attributes

Flow_Type supply_flow = Flow_Type{0}
 Supply flow value: positive = supply, negative = demand, zero = transit.
 
Flow_Type out_cap = Flow_Type{0}
 Outgoing capacity constraint.
 
Flow_Type in_cap = Flow_Type{0}
 Incoming capacity constraint.
 
Flow_Type out_flow = Flow_Type{0}
 Tracked outgoing flow.
 
Flow_Type in_flow = Flow_Type{0}
 Tracked incoming flow.
 
- Public Attributes inherited from Aleph::Graph_Anode< Node_Info >
void ** arc_array
 
size_t arcs_dim
 
size_t contract_threshold
 
- Public Attributes inherited from GTNodeCommon< Node_Info >
Graph_Attr attrs
 Attributes of node.
 
Node_Info node_info
 
size_t num_arcs
 data associated to the node. Access it with get_info()
 

Additional Inherited Members

Detailed Description

template<typename Node_Info, typename F_Type = long>
class Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >

Node with supply/demand flow value.

Extends Net_Node with a supply_flow attribute that indicates:

  • Positive value: the node supplies (produces) that amount of flow
  • Negative value: the node demands (consumes) the absolute amount
  • Zero: the node is a transit node (neither supplies nor demands)
Template Parameters
Node_InfoType of information stored in the node
F_TypeType representing flow values (default: long)

Definition at line 119 of file tpl_net_sup_dem.H.

Member Typedef Documentation

◆ Base

template<typename Node_Info , typename F_Type = long>
using Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::Base = Graph_Anode<Node_Info>

Base class type.

Definition at line 126 of file tpl_net_sup_dem.H.

◆ Flow_Type

template<typename Node_Info , typename F_Type = long>
using Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::Flow_Type = F_Type

Type representing flow values.

Definition at line 123 of file tpl_net_sup_dem.H.

Constructor & Destructor Documentation

◆ Net_Sup_Dem_Node() [1/3]

template<typename Node_Info , typename F_Type = long>
Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::Net_Sup_Dem_Node ( )
inline

Default constructor. Initializes all values to zero.

Definition at line 159 of file tpl_net_sup_dem.H.

◆ Net_Sup_Dem_Node() [2/3]

template<typename Node_Info , typename F_Type = long>
Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::Net_Sup_Dem_Node ( const Node_Info &  node_info)
inlineexplicit

Construct node with info.

Creates a node with the given information. Capacity and flow attributes are initialized to zero.

Parameters
node_infoInformation to store in the node

Definition at line 169 of file tpl_net_sup_dem.H.

◆ Net_Sup_Dem_Node() [3/3]

template<typename Node_Info , typename F_Type = long>
Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::Net_Sup_Dem_Node ( Net_Sup_Dem_Node< Node_Info, F_Type > *  node)
inline

Copy constructor from pointer.

Creates a copy of the node pointed to, including its supply_flow value.

Parameters
nodePointer to the node to copy

Definition at line 180 of file tpl_net_sup_dem.H.

Member Function Documentation

◆ get_supply_flow() [1/2]

template<typename Node_Info , typename F_Type = long>
const Flow_Type & Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::get_supply_flow ( ) const
inlinenoexcept

Get the supply/demand flow value (const version).

Returns
Const reference to the supply_flow attribute

Definition at line 153 of file tpl_net_sup_dem.H.

References Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::supply_flow.

◆ get_supply_flow() [2/2]

template<typename Node_Info , typename F_Type = long>
Flow_Type & Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::get_supply_flow ( )
inlinenoexcept

Get the supply/demand flow value.

Returns
Reference to the supply_flow attribute

Definition at line 147 of file tpl_net_sup_dem.H.

References Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::supply_flow.

Member Data Documentation

◆ in_cap

template<typename Node_Info , typename F_Type = long>
Flow_Type Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::in_cap = Flow_Type{0}

Incoming capacity constraint.

Definition at line 135 of file tpl_net_sup_dem.H.

◆ in_flow

template<typename Node_Info , typename F_Type = long>
Flow_Type Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::in_flow = Flow_Type{0}

Tracked incoming flow.

Definition at line 141 of file tpl_net_sup_dem.H.

◆ out_cap

template<typename Node_Info , typename F_Type = long>
Flow_Type Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::out_cap = Flow_Type{0}

Outgoing capacity constraint.

Definition at line 132 of file tpl_net_sup_dem.H.

◆ out_flow

template<typename Node_Info , typename F_Type = long>
Flow_Type Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::out_flow = Flow_Type{0}

Tracked outgoing flow.

Definition at line 138 of file tpl_net_sup_dem.H.

◆ supply_flow

template<typename Node_Info , typename F_Type = long>
Flow_Type Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::supply_flow = Flow_Type{0}

Supply flow value: positive = supply, negative = demand, zero = transit.

Definition at line 129 of file tpl_net_sup_dem.H.

Referenced by Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::get_supply_flow(), and Aleph::Net_Sup_Dem_Node< Node_Info, F_Type >::get_supply_flow().


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