OpenMS
ListUtils::DoubleTolerancePredicate_ Struct Reference

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

Collaboration diagram for ListUtils::DoubleTolerancePredicate_:
[legend]

Public Member Functions

 DoubleTolerancePredicate_ (const double &target, const double &tolerance)
 
bool operator() (const double &value) const
 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) const
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.