Convenience class for updating a minimum value and keeping track of all the objects associated to it.
More...
#include <utilities.hpp>
|
| Min_keeper (const double _abstol=1e-8, const double _reltol=1e-5) |
| Basic constructor.
|
|
double | get_value () const |
|
std::vector< T > | get_vector () const |
|
void | update (const T &obj, double value) |
| Update the minimum value with a new one if the latter is lower. More...
|
|
template<typename T>
class alma::Min_keeper< T >
Convenience class for updating a minimum value and keeping track of all the objects associated to it.
◆ get_value()
- Returns
- the current minimum value.
◆ get_vector()
- Returns
- the vector of objects associated to the current minimum.
◆ update()
Update the minimum value with a new one if the latter is lower.
If the new value is almost equal to the current minimum, append obj to the vector of objects. If the new value is lower than the current minimum, empty the vector of objects, append obj and update the minimum value. If the new value is higher than the current minimum, do nothing.
- Parameters
-
[in] | obj | - new object |
[in] | value | - associated value |
The documentation for this class was generated from the following file: