AlmaBTE  1.3
A solver of the space- and time-dependent Boltzmann transport equation for phonons
alma::Min_keeper< T > Class Template Reference

Convenience class for updating a minimum value and keeping track of all the objects associated to it. More...

#include <utilities.hpp>

Public Member Functions

 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...
 

Detailed Description

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.

Member Function Documentation

◆ get_value()

template<typename T >
double alma::Min_keeper< T >::get_value ( ) const
inline
Returns
the current minimum value.

◆ get_vector()

template<typename T >
std::vector<T> alma::Min_keeper< T >::get_vector ( ) const
inline
Returns
the vector of objects associated to the current minimum.

◆ update()

template<typename T >
void alma::Min_keeper< T >::update ( const T &  obj,
double  value 
)
inline

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: