AutoPas  3.0.0
Loading...
Searching...
No Matches
Functions
autopas::OptimumSelector Namespace Reference

Collection of functions for selecting the optimum value out of a vector of values according to a given strategy. More...

Functions

long minValue (const std::vector< long > &values)
 Minimal value.
 
long meanValue (const std::vector< long > &values)
 Arithmetic mean.
 
template<class T >
medianValue (std::vector< T > values)
 Median value.
 
long optimumValue (const std::vector< long > &values, SelectorStrategyOption strategy)
 Optimal value according to passed strategy.
 

Detailed Description

Collection of functions for selecting the optimum value out of a vector of values according to a given strategy.

Function Documentation

◆ meanValue()

long autopas::OptimumSelector::meanValue ( const std::vector< long > &  values)
inline

Arithmetic mean.

Parameters
values
Returns
Arithmetic mean of the vector.

◆ medianValue()

template<class T >
T autopas::OptimumSelector::medianValue ( std::vector< T >  values)
inline

Median value.

Parameters
values
Returns
Middle ((size-1) /2) of the sorted vector.
Todo:
C++20: replace by std::midpoint

◆ minValue()

long autopas::OptimumSelector::minValue ( const std::vector< long > &  values)
inline

Minimal value.

Parameters
values
Returns
Smallest value of the vector.

◆ optimumValue()

long autopas::OptimumSelector::optimumValue ( const std::vector< long > &  values,
SelectorStrategyOption  strategy 
)
inline

Optimal value according to passed strategy.

Parameters
values
strategyFor possible selector strategy choices see AutoPas::SelectorStrategy.
Returns
value or 0 if values is empty.