|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
A sum of floating flows that keeps the error of its rounding, as hi + lo, by the error-free addition of Knuth: a small flow beside a large one, as 0.53 beside 7e13, which the sum rounds away, comes back when the large one goes. More...
#include <tpl_net.H>
Public Member Functions | |
| void | add (const Flow_Type &x) noexcept |
| Adds x. | |
| void | replace (const Flow_Type &from, const Flow_Type &to) noexcept |
| Replaces the term from, which the sum has, by to. | |
| Flow_Type | value () const noexcept |
| The sum, rounded once. | |
| Flow_Type | minus (const Flow_Sum &other) const noexcept |
| This sum less other, rounded once but for the errors of lo. | |
Public Attributes | |
| Flow_Type | hi {0} |
| The sum, rounded. | |
| Flow_Type | lo {0} |
| What its rounding lost. | |
A sum of floating flows that keeps the error of its rounding, as hi + lo, by the error-free addition of Knuth: a small flow beside a large one, as 0.53 beside 7e13, which the sum rounds away, comes back when the large one goes.
The preflows and HLPP sum so the flows of their nodes. It needs strict floating arithmetic, which -ffast-math and /fp:fast are not: with them a floating flow does not compile.
|
inlinenoexcept |
Adds x.
Definition at line 1316 of file tpl_net.H.
References Aleph::net_detail::Flow_Sum< Flow_Type >::hi, and Aleph::net_detail::Flow_Sum< Flow_Type >::lo.
Referenced by Aleph::net_detail::Flow_Sum< Flow_Type >::minus(), Aleph::net_detail::push_excess(), and Aleph::net_detail::Flow_Sum< Flow_Type >::replace().
|
inlinenoexcept |
This sum less other, rounded once but for the errors of lo.
Definition at line 1338 of file tpl_net.H.
References Aleph::net_detail::Flow_Sum< Flow_Type >::add(), Aleph::net_detail::Flow_Sum< Flow_Type >::hi, and Aleph::net_detail::Flow_Sum< Flow_Type >::lo.
Referenced by Aleph::generic_preflow_vertex_push_maximum_flow(), and Aleph::net_detail::push_excess().
|
inlinenoexcept |
Replaces the term from, which the sum has, by to.
Definition at line 1325 of file tpl_net.H.
References Aleph::net_detail::Flow_Sum< Flow_Type >::add().
|
inlinenoexcept |
The sum, rounded once.
Definition at line 1332 of file tpl_net.H.
References Aleph::net_detail::Flow_Sum< Flow_Type >::hi, and Aleph::net_detail::Flow_Sum< Flow_Type >::lo.
Referenced by Aleph::generic_preflow_vertex_push_maximum_flow().
| Flow_Type Aleph::net_detail::Flow_Sum< Flow_Type >::hi {0} |
The sum, rounded.
Definition at line 1312 of file tpl_net.H.
Referenced by Aleph::net_detail::Flow_Sum< Flow_Type >::add(), Aleph::net_detail::Flow_Sum< Flow_Type >::minus(), and Aleph::net_detail::Flow_Sum< Flow_Type >::value().
| Flow_Type Aleph::net_detail::Flow_Sum< Flow_Type >::lo {0} |
What its rounding lost.
Definition at line 1313 of file tpl_net.H.
Referenced by Aleph::net_detail::Flow_Sum< Flow_Type >::add(), Aleph::net_detail::Flow_Sum< Flow_Type >::minus(), and Aleph::net_detail::Flow_Sum< Flow_Type >::value().