|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Namespace for shortest path algorithm implementation details. More...
Functions | |
| template<typename T > | |
| T | checked_add (const T &a, const T &b) |
| Safely add two distance values with overflow checking. | |
Namespace for shortest path algorithm implementation details.
Safely add two distance values with overflow checking.
For integral types, checks for overflow/underflow before performing the addition. For floating-point types, performs regular addition.
| T | Distance type (integral or floating-point). |
| a | First operand. |
| b | Second operand. |
| std::overflow_error | If integer overflow/underflow would occur. |
Definition at line 120 of file shortest_path_common.H.
References ah_overflow_error_if, and Aleph::maps().
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::checked_add(), and Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::checked_add().