Changeset 1734
- Timestamp:
- Jan 16, 2009, 8:20:57 PM (12 years ago)
- Location:
- trunk/yat/utility
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/DataWeight.cc
r1534 r1734 2 2 3 3 /* 4 Copyright (C) 2008 Peter Johansson4 Copyright (C) 2008, 2009 Peter Johansson 5 5 6 6 This file is part of the yat library, http://dev.thep.lu.se/yat … … 61 61 bool operator!=(const DataWeight& lhs, const DataWeight& rhs) 62 62 { 63 return ! (lhs == rhs);63 return lhs.data() != rhs.data(); 64 64 } 65 65 … … 73 73 bool operator>(const DataWeight& lhs, const DataWeight& rhs) 74 74 { 75 return rhs < lhs;75 return lhs.data() > rhs.data(); 76 76 } 77 77 … … 79 79 bool operator<=(const DataWeight& lhs, const DataWeight& rhs) 80 80 { 81 return !(lhs > rhs);81 return lhs.data() <= rhs.data(); 82 82 } 83 83 … … 85 85 bool operator>=(const DataWeight& lhs, const DataWeight& rhs) 86 86 { 87 return !(lhs < rhs);87 return lhs.data() >= rhs.data(); 88 88 } 89 89 -
trunk/yat/utility/DataWeight.h
r1533 r1734 5 5 6 6 /* 7 Copyright (C) 2008 Peter Johansson7 Copyright (C) 2008, 2009 Peter Johansson 8 8 9 9 This file is part of the yat library, http://dev.thep.lu.se/yat … … 29 29 /** 30 30 \brief Holds a pair of data and associated weight 31 32 The class has comparison operators (declared outside class) that 33 are designed to ignore the weights, and behaves like the 34 corresponding double operator behaves for data(). 31 35 32 36 \since New in yat 0.5 … … 73 77 \brief equality operator 74 78 75 \return true if data are equal79 \return true if lhs.data() == rhs.data() 76 80 */ 77 bool operator==(const DataWeight& , const DataWeight&);81 bool operator==(const DataWeight& lhs, const DataWeight& rhs); 78 82 79 83 /** 80 84 \brief inequality operator 81 85 82 \return true if data are inequal86 \return true if lhs.data() != rhs.data() 83 87 */ 84 88 bool operator!=(const DataWeight&, const DataWeight&); … … 101 105 \brief comparison operator 102 106 103 \return true if rhs > lhs107 \return true if lhs.data() <= rhs.data() 104 108 */ 105 109 bool operator<=(const DataWeight&, const DataWeight&); … … 108 112 \brief comparison operator 109 113 110 \return true if rhs < lhs114 \return true if lhs.data() >= rhs.data() 111 115 */ 112 116 bool operator>=(const DataWeight&, const DataWeight&);
Note: See TracChangeset
for help on using the changeset viewer.