Changeset 4065
- Timestamp:
- Aug 5, 2021, 8:11:05 AM (11 months ago)
- Location:
- branches/kendall-score/yat/utility
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/kendall-score/yat/utility/Ranking.h
r4064 r4065 38 38 namespace utility { 39 39 40 /** 41 Class is a binary tree with the special extension that it allow 42 fast access to the rank of an element in the tree. 43 */ 40 44 template<typename T, class Compare = std::less<T> > 41 45 class Ranking 42 46 { 43 47 public: 48 /// value type 44 49 typedef T value_type; 50 /// type used to compare elements 45 51 typedef Compare key_compare; 52 /// size type 46 53 typedef size_t size_type; 47 54 /// iterator 48 55 typedef ranking::Iterator<T> iterator; 56 /// iterator 49 57 typedef ranking::Iterator<T> const_iterator; 58 /// reverse iterator 50 59 typedef std::reverse_iterator<iterator> reverse_iterator; 60 /// reverse iterator 51 61 typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 52 62 … … 66 76 67 77 78 /** 79 \brief Copy constructor 80 */ 68 81 Ranking(const Ranking& other) 69 82 : compare_(other.compare()) … … 72 85 impl_.head_.parent_ = copy(other); 73 86 } 87 88 /** 89 \brief move constructor 90 */ 74 91 Ranking(Ranking&& other) = default; 92 93 /** 94 \brief assignment operator 95 */ 75 96 Ranking& operator=(const Ranking& other); 97 98 /** 99 \brief move assignment 100 */ 76 101 Ranking& operator=(Ranking&& other); 77 102 78 103 104 /** 105 \return iterator pointing to the first element 106 */ 79 107 iterator begin(void) 80 108 { … … 83 111 84 112 113 /** 114 \return iterator pointing to the first element 115 */ 85 116 const_iterator begin(void) const 86 117 { … … 89 120 90 121 122 /** 123 \return iterator pointing to the first element 124 */ 91 125 const_iterator cbegin(void) const 92 126 { … … 95 129 96 130 131 /** 132 \return iterator pointing to one-passed-last element 133 */ 97 134 iterator end(void) 98 135 { … … 101 138 102 139 140 /** 141 \return iterator pointing to one-passed-last element 142 */ 103 143 const_iterator end(void) const 104 144 { … … 107 147 108 148 149 /** 150 \return iterator pointing to one-passed-last element 151 */ 109 152 const_iterator cend(void) const 110 153 { … … 113 156 114 157 158 /** 159 \return reverse iterator pointing to first element 160 */ 115 161 reverse_iterator rbegin(void) 116 162 { … … 119 165 120 166 167 /** 168 \return reverse iterator pointing to one-passed-last element 169 */ 121 170 reverse_iterator rend(void) 122 171 { … … 125 174 126 175 176 /** 177 \return reverse iterator pointing to one-passed-last element 178 */ 127 179 const_reverse_iterator rend(void) const 128 180 { … … 131 183 132 184 185 /** 186 \return reverse iterator pointing to first element 187 */ 133 188 const_reverse_iterator rbegin(void) const 134 189 { … … 137 192 138 193 194 /** 195 \return reverse iterator pointing to first element 196 */ 139 197 const_reverse_iterator crbegin(void) const 140 198 { … … 142 200 } 143 201 144 202 /** 203 \return reverse iterator pointing to the one-passed-last element 204 */ 145 205 const_reverse_iterator crend(void) const 146 206 { … … 149 209 150 210 211 /** 212 access comparison function which is used to sort elements 213 */ 151 214 const Compare& compare(void) const 152 215 { … … 155 218 156 219 220 /** 221 \return true if (and only if) container has zero elements 222 */ 157 223 bool empty(void) const 158 224 { … … 161 227 162 228 229 /** 230 Find an element that is equivalent to x 231 */ 163 232 const_iterator find(const T& x) const; 164 233 165 234 235 /** 236 \brief insert an element 237 */ 166 238 iterator insert(const T& element) 167 239 { … … 172 244 173 245 246 /** 247 \brief insert an element 248 */ 174 249 iterator insert(T&& element) 175 250 { … … 180 255 181 256 257 /** 258 \brief insert with hint 259 */ 182 260 iterator insert(const_iterator hint, const T& element) 183 261 { … … 187 265 188 266 267 /** 268 \brief insert with hint 269 */ 189 270 iterator insert(const_iterator hint, T&& element) 190 271 { … … 194 275 195 276 277 /** 278 \brief insert range 279 */ 196 280 template<typename InputIterator> 197 281 void insert(InputIterator first, InputIterator last) … … 202 286 203 287 288 /** 289 \return the first element which is equal (or greater) to \c x 290 */ 204 291 const_iterator lower_bound(const T& x) const 205 292 { … … 210 297 211 298 299 /** 300 \return the first element which is greater than \c x 301 */ 212 302 const_iterator upper_bound(const T& x) const 213 303 { … … 218 308 219 309 310 /** 311 \return number of elements smaller than \c it 312 */ 220 313 size_t ranking(const_iterator it) const 221 314 { … … 225 318 226 319 320 /** 321 \return number of elements in container 322 */ 227 323 size_t size(void) const 228 324 { -
branches/kendall-score/yat/utility/ranking/Impl.h
r4064 r4065 23 23 */ 24 24 25 // This is a private file used by "yat/utility/Ranking.h" 26 25 27 #include "NodeBase.h" 26 28 … … 30 32 namespace yat { 31 33 namespace utility { 34 35 /// \cond IGNORE_DOXYGEN 32 36 33 37 // namespace for internal classes used in class Ranking … … 55 59 } // end of namespace ranking 56 60 61 /// \endcond 62 57 63 }}} // of namespace utility, yat, and theplu 58 64 #endif -
branches/kendall-score/yat/utility/ranking/Iterator.h
r4064 r4065 23 23 */ 24 24 25 // This is a private file used by yat/utility/Ranking.h 26 25 27 #include "NodeBase.h" 26 28 #include "NodeValue.h" … … 35 37 namespace yat { 36 38 namespace utility { 39 40 /// \cond IGNORE_DOXYGEN 37 41 38 42 // namespace for internal classes used in class Ranking … … 155 159 } // end of namespace ranking 156 160 161 /// \endcond 162 157 163 }}} // of namespace utility, yat, and theplu 158 164 #endif -
branches/kendall-score/yat/utility/ranking/NodeBase.h
r4064 r4065 23 23 */ 24 24 25 // This is a private file used by yat/utility/Ranking.h 26 25 27 namespace theplu { 26 28 namespace yat { 27 29 namespace utility { 30 31 /// \cond IGNORE_DOXYGEN 28 32 29 33 // namespace for internal classes used in class Ranking … … 52 56 } // end of namespace ranking 53 57 58 /// \endcond 59 54 60 }}} // of namespace utility, yat, and theplu 55 61 #endif -
branches/kendall-score/yat/utility/ranking/NodeValue.h
r4064 r4065 23 23 */ 24 24 25 // This is a private file used by yat/utility/Ranking.h 26 25 27 #include "NodeBase.h" 26 28 … … 30 32 namespace yat { 31 33 namespace utility { 34 35 /// \cond IGNORE_DOXYGEN 32 36 33 37 // namespace for internal classes used in class Ranking … … 53 57 } // end of namespace ranking 54 58 59 /// \endcond 60 55 61 }}} // of namespace utility, yat, and theplu 56 62 #endif
Note: See TracChangeset
for help on using the changeset viewer.