|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Bit fields for nodes and arcs used for marking visit state during processing. More...
#include <aleph-graph.H>
Public Member Functions | |
| Bit_Fields () noexcept | |
| All the bits are set to zero. | |
| bool | get_bit (int bit) const noexcept |
| Get a control bit. | |
| void | set_bit (int bit, int value) noexcept |
| Set a control bit. | |
| unsigned int | get_state () const noexcept |
| Return the state value. | |
| std::string | str_state () const |
| Return a stringification version of state. | |
| void | set_state (unsigned char s) noexcept |
Set the state to the value s | |
| void | reset (int bit) noexcept |
Reset bit to zero. | |
| void | reset () noexcept |
| Reset all bits and state to zero. | |
Public Attributes | |
| unsigned int | depth_first: 1 |
| unsigned int | breadth_first: 1 |
| Depth first search. | |
| unsigned int | test_cycle: 1 |
| Breadth first search. | |
| unsigned int | find_path: 1 |
| Cycle existence test. | |
| unsigned int | euler: 1 |
| Path searching (there are several types) | |
| unsigned int | maximum_flow: 1 |
| Used during eulerian searching. | |
| unsigned int | spanning_tree: 1 |
| Used by the maximum flow algorithms. | |
| unsigned int | build_subtree: 1 |
| Used by spannign tree algorithms. | |
| unsigned int | convert_tree: 1 |
| Used by subtree or subgraph building. | |
| unsigned int | cut: 1 |
| Used for Tree_Node conversion. | |
| unsigned int | min: 1 |
| Used for cut points computing. | |
| unsigned int | state: 2 |
| Used for min path or min spanning. | |
Bit fields for nodes and arcs used for marking visit state during processing.
Each node and arc of a graph contains a bitmask intended to mark visit state during the execution of an algorithm. The bits are named according to their use by the library.
If your you intend to use some of these bits for your own processing, then make sure of two things:
Make sure that the bit that you use will no be used by an algorithm that you invoke
Definition at line 132 of file aleph-graph.H.
|
inlinenoexcept |
Get a control bit.
It is recommended to use the bit name. By example
NODE_BITS(p).get_bit(Breadth_First) @param[in] bit number (or name) of the bit to be read @return the logical value of bit @throw out_of_range if bit is greater or equal than Num_Bits_Graph.
Definition at line 171 of file aleph-graph.H.
References Aleph::Breadth_First, breadth_first, Aleph::Build_Subtree, build_subtree, Aleph::Convert_Tree, convert_tree, Aleph::Cut, cut, Aleph::Depth_First, depth_first, Aleph::Euler, euler, Aleph::Find_Path, find_path, Aleph::maps(), Aleph::Maximum_Flow, maximum_flow, Aleph::Min, min, Aleph::Spanning_Tree, spanning_tree, Aleph::Test_Cycle, and test_cycle.
|
inlinenoexcept |
Reset all bits and state to zero.
Definition at line 249 of file aleph-graph.H.
References breadth_first, build_subtree, convert_tree, cut, depth_first, euler, find_path, maximum_flow, min, spanning_tree, state, and test_cycle.
Referenced by Bit_Fields().
Reset bit to zero.
Definition at line 246 of file aleph-graph.H.
References Aleph::maps(), and set_bit().
Referenced by Aleph::Graph_Attr::reset().
Set a control bit.
Set a specific control bit to zero or one.
The real value of value is not verified. Anything different than zero will be considered as 1.
| [in] | bit | to set |
| [in] | value | the value to set |
| out_of_range | if bit is greater or equal than Num_Bits_Graph. |
Definition at line 202 of file aleph-graph.H.
References Aleph::Breadth_First, breadth_first, Aleph::Build_Subtree, build_subtree, Aleph::Convert_Tree, convert_tree, Aleph::Cut, cut, Aleph::Depth_First, depth_first, Aleph::Euler, euler, Aleph::Find_Path, find_path, Aleph::maps(), Aleph::Maximum_Flow, maximum_flow, Aleph::Min, min, Aleph::Spanning_Tree, spanning_tree, Aleph::Test_Cycle, and test_cycle.
Referenced by reset().
Set the state to the value s
Definition at line 239 of file aleph-graph.H.
References Aleph::maps(), and state.
|
inline |
Return a stringification version of state.
Definition at line 226 of file aleph-graph.H.
References state.
Depth first search.
Definition at line 137 of file aleph-graph.H.
Used by spannign tree algorithms.
Definition at line 143 of file aleph-graph.H.
Used by subtree or subgraph building.
Definition at line 144 of file aleph-graph.H.
Definition at line 136 of file aleph-graph.H.
Cycle existence test.
Definition at line 139 of file aleph-graph.H.
Used during eulerian searching.
Definition at line 141 of file aleph-graph.H.
Used for cut points computing.
Definition at line 146 of file aleph-graph.H.
Used by the maximum flow algorithms.
Definition at line 142 of file aleph-graph.H.
Used for min path or min spanning.
tree Visit state.
Note that there are two bits. So you can manage 4 different states.
Definition at line 153 of file aleph-graph.H.
Referenced by get_state(), reset(), set_state(), and str_state().
Breadth first search.
Definition at line 138 of file aleph-graph.H.