yat  0.14.5pre
Public Member Functions | Related Functions | List of all members
theplu::yat::utility::DataWeight Class Reference

Holds a pair of data and associated weight. More...

#include <yat/utility/DataWeight.h>

Public Member Functions

 DataWeight (double data=0.0, double weight=1.0)
 Default constructor. More...
 
double & data (void)
 
const double & data (void) const
 
double & weight (void)
 
const double & weight (void) const
 

Related Functions

(Note that these are not member functions.)

bool operator== (const DataWeight &lhs, const DataWeight &rhs)
 equality operator More...
 
bool operator!= (const DataWeight &, const DataWeight &)
 inequality operator More...
 
bool operator< (const DataWeight &, const DataWeight &)
 comparison operator More...
 
bool operator> (const DataWeight &, const DataWeight &)
 comparison operator More...
 
bool operator<= (const DataWeight &, const DataWeight &)
 comparison operator More...
 
bool operator>= (const DataWeight &, const DataWeight &)
 comparison operator More...
 

Detailed Description

Holds a pair of data and associated weight.

The class has comparison operators (declared outside class) that are designed to ignore the weights, and behaves like the corresponding double operator behaves for data().

Since
New in yat 0.5

Constructor & Destructor Documentation

theplu::yat::utility::DataWeight::DataWeight ( double  data = 0.0,
double  weight = 1.0 
)
explicit

Default constructor.

Parameters
datadata value to hold
weightweight value to hold

Member Function Documentation

double& theplu::yat::utility::DataWeight::data ( void  )
Returns
reference to data
const double& theplu::yat::utility::DataWeight::data ( void  ) const
Returns
const reference to data
double& theplu::yat::utility::DataWeight::weight ( void  )
Returns
reference to weight
const double& theplu::yat::utility::DataWeight::weight ( void  ) const
Returns
const reference to weight

Friends And Related Function Documentation

bool operator!= ( const DataWeight ,
const DataWeight  
)
related

inequality operator

Returns
true if lhs.data() != rhs.data()
bool operator< ( const DataWeight ,
const DataWeight  
)
related

comparison operator

Returns
less_nan(lhs.data(), rhs.data())
See Also
less_nan
bool operator<= ( const DataWeight ,
const DataWeight  
)
related

comparison operator

Returns
true if lhs < rhs or lhs == rhs
bool operator== ( const DataWeight lhs,
const DataWeight rhs 
)
related

equality operator

Returns
true if lhs.data() == rhs.data()
bool operator> ( const DataWeight ,
const DataWeight  
)
related

comparison operator

Returns
rhs < lhs
bool operator>= ( const DataWeight ,
const DataWeight  
)
related

comparison operator

Returns
true if lhs > rhs or lhs == rhs

The documentation for this class was generated from the following file:

Generated on Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5