yat  0.21pre
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

◆ DataWeight()

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

◆ data() [1/2]

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

◆ data() [2/2]

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

◆ weight() [1/2]

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

◆ weight() [2/2]

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

Friends And Related Function Documentation

◆ operator!=()

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

inequality operator

Returns
true if lhs.data() != rhs.data()

◆ operator<()

bool operator< ( const DataWeight ,
const DataWeight  
)
related

comparison operator

Returns
less_nan(lhs.data(), rhs.data())
See also
less_nan

◆ operator<=()

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

comparison operator

Returns
true if lhs < rhs or lhs == rhs

◆ operator==()

bool operator== ( const DataWeight lhs,
const DataWeight rhs 
)
related

equality operator

Returns
true if lhs.data() == rhs.data()

◆ operator>()

bool operator> ( const DataWeight ,
const DataWeight  
)
related

comparison operator

Returns
rhs < lhs

◆ operator>=()

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 Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14