OpenMS  2.4.0
Public Member Functions | Private Attributes | List of all members
ListUtils::DoubleTolerancePredicate_ Struct Reference

Predicate to check double equality with a given tolerance. More...

Public Member Functions

 DoubleTolerancePredicate_ (const double &target, const double &tolerance)
 
bool operator() (const double &value)
 Returns true if | value - target | < tolerance. More...
 

Private Attributes

double tolerance_
 The allowed tolerance. More...
 
double target_
 The target value that should be found. More...
 

Detailed Description

Predicate to check double equality with a given tolerance.

Constructor & Destructor Documentation

◆ DoubleTolerancePredicate_()

DoubleTolerancePredicate_ ( const double target,
const double tolerance 
)
inline

Member Function Documentation

◆ operator()()

bool operator() ( const double value)
inline

Returns true if | value - target | < tolerance.

Parameters
valueThe value to test.
Returns
true if | value - target | < tolerance, false otherwise.

Member Data Documentation

◆ target_

double target_
private

The target value that should be found.

◆ tolerance_

double tolerance_
private

The allowed tolerance.