|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Functions | |
| template<typename GT > | |
| GT::Node * | get_node (DynArray< typename GT::Node * > &nodes, long i) |
| Get node pointer from sorted node array by index. | |
| template<typename GT > | |
| GT::Node * | get_node (const DynArray< typename GT::Node * > &nodes, long i) |
| Get node pointer from sorted node array by index (const version). | |
| template<typename GT > | |
| long | node_index (const DynArray< typename GT::Node * > &nodes, long n, typename GT::Node *p) |
| Find index of node in sorted array using binary search. | |
| long | index_array (long i, long j, long n) noexcept |
| Convert 2D matrix indices to 1D array index. | |
| long | checked_index_array (long i, long j, long n) |
| Validate and convert indices to linear index. | |
| template<typename Entry > | |
| Entry * | read_matrix (const DynArray< Entry > &mat, long i, long j, long n) |
| Read matrix entry if it exists. | |
| template<typename Entry > | |
| void | write_matrix (DynArray< Entry > &mat, long i, long j, long n, const Entry &entry) |
| Write entry to matrix. | |
Validate and convert indices to linear index.
| i | Row index |
| j | Column index |
| n | Matrix dimension |
| std::out_of_range | if i or j >= n |
Definition at line 154 of file tpl_matgraph.H.
References ah_out_of_range_error_if, index_array(), and Aleph::maps().
Referenced by Aleph::Matrix_Graph< GT, SA >::operator()(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operator()(), Aleph::Matrix_Graph< GT, SA >::operator()(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operator()(), read_matrix(), TEST(), TEST(), and write_matrix().
|
inline |
Get node pointer from sorted node array by index (const version).
| GT | Graph type |
| nodes | Sorted array of node pointers |
| i | Index to retrieve |
| std::out_of_range | if i >= nodes.size() |
Definition at line 109 of file tpl_matgraph.H.
References ah_out_of_range_error_if, Aleph::maps(), nodes, and Aleph::HTList::size().
|
inline |
Get node pointer from sorted node array by index.
| GT | Graph type |
| nodes | Sorted array of node pointers |
| i | Index to retrieve |
| std::out_of_range | if i >= nodes.size() |
Definition at line 92 of file tpl_matgraph.H.
References ah_out_of_range_error_if, Aleph::maps(), nodes, and Aleph::HTList::size().
Convert 2D matrix indices to 1D array index.
| i | Row index |
| j | Column index |
| n | Matrix dimension |
| std::out_of_range | if indices are out of bounds |
Definition at line 140 of file tpl_matgraph.H.
Referenced by checked_index_array(), Aleph::Matrix_Graph< GT, SA >::copy(), Aleph::Matrix_Graph< GT, SA >::copy(), Aleph::Bit_Mat_Graph< GT, SA >::copy_list_graph(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_list_graph(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_list_graph(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_matrix(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::operate_all_arcs_matrix(), and TEST().
|
inline |
Find index of node in sorted array using binary search.
| GT | Graph type |
| nodes | Sorted array of node pointers |
| n | Number of nodes |
| p | Node pointer to find |
Definition at line 126 of file tpl_matgraph.H.
References Aleph::binary_search(), and nodes.
|
inline |
Read matrix entry if it exists.
| Entry | Entry type |
| mat | Dynamic array storing matrix |
| i | Row index |
| j | Column index |
| n | Matrix dimension |
Definition at line 172 of file tpl_matgraph.H.
References Aleph::DynArray< T >::access(), checked_index_array(), Aleph::DynArray< T >::exist(), and Aleph::maps().
|
inline |
Write entry to matrix.
| Entry | Entry type |
| mat | Dynamic array storing matrix |
| i | Row index |
| j | Column index |
| n | Matrix dimension |
| entry | Value to write |
Definition at line 191 of file tpl_matgraph.H.
References checked_index_array().