yat  0.20.3pre
DataWeight.h
1 #ifndef _theplu_yat_utility_data_weight_
2 #define _theplu_yat_utility_data_weight_
3 
4 // $Id: DataWeight.h 4207 2022-08-26 04:36:28Z peter $
5 
6 /*
7  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009, 2022 Peter Johansson
9 
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11 
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16 
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 namespace theplu {
27 namespace yat {
28 namespace utility {
29 
39  class DataWeight
40  {
41  public:
48  explicit DataWeight(double data=0.0, double weight=1.0);
49 
53  double& data(void);
54 
58  const double& data(void) const;
59 
63  double& weight(void);
64 
68  const double& weight(void) const;
69  private:
70  double data_;
71  double weight_;
72  // using compiler generated copy
73  // DataWeight(const DataWeight&)
74  // DataWeight& operator=(const DataWeight&);
75  };
76 
84  bool operator==(const DataWeight& lhs, const DataWeight& rhs);
85 
93  bool operator!=(const DataWeight&, const DataWeight&);
94 
104  bool operator<(const DataWeight&, const DataWeight&);
105 
113  bool operator>(const DataWeight&, const DataWeight&);
114 
122  bool operator<=(const DataWeight&, const DataWeight&);
123 
131  bool operator>=(const DataWeight&, const DataWeight&);
132 
133 
134 }}} // of namespace utility, yat, and theplu
135 
136 #endif
bool operator<=(const Range< T1 > &lhs, const Range< T2 > &rhs)
Definition: Range.h:236
DataWeight(double data=0.0, double weight=1.0)
Default constructor.
The Department of Theoretical Physics namespace as we define it.
Holds a pair of data and associated weight.
Definition: DataWeight.h:39
bool operator!=(const Range< T1 > &, const Range< T2 > &)
Based on operator==.
Definition: Range.h:214
bool operator>(const Range< T1 > &, const Range< T2 > &)
Definition: Range.h:229
bool operator<(const Range< T1 > &lhs, const Range< T2 > &rhs)
Ordering relation.
Definition: Range.h:221
bool operator==(const Range< T1 > &, const Range< T2 > &)
Equality comparison.
Definition: Range.h:194
bool operator>=(const Range< T1 > &, const Range< T2 > &)
Definition: Range.h:243

Generated on Sat Feb 18 2023 03:31:44 for yat by  doxygen 1.8.14