yat  0.16pre
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 Thu Jan 10 2019 02:54:20 for yat by  doxygen 1.8.11