Changeset 4087
- Timestamp:
- Aug 30, 2021, 4:00:02 AM (18 months ago)
- Location:
- trunk/yat/utility
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/Ranking.h
r4083 r4087 54 54 /// type used to compare elements 55 55 typedef Compare key_compare; 56 /// reference 57 typedef const T& reference; 58 /// reference 59 typedef const T& const_reference; 60 /// pointer 61 typedef const T* pointer; 62 /// const pointer 63 typedef const T* const_pointer; 56 64 /// size type 57 65 typedef size_t size_type; … … 254 262 \return An iterator pointing to the element that follows the 255 263 last element removed. 264 265 Complexity: constant time. 256 266 */ 257 267 iterator erase(const_iterator position); … … 260 270 Erase all elements that are equivalent with \c value 261 271 \return number of elements removed 272 273 Complexity: logarithmic in size of container. 262 274 */ 263 275 size_type erase(const T& value); … … 268 280 \return An iterator pointing to the element that follows the 269 281 last element removed. 282 283 Complexity: Linear in number of elements erased. 270 284 */ 271 285 iterator erase(const_iterator first, const_iterator last); 272 286 273 287 /** 274 Find an element that is equivalent to x 288 Find an element that is equivalent to x. 289 290 \return end() if no such element exists 291 292 Complexity: logarithmic in size of container. 275 293 */ 276 294 const_iterator find(const T& x) const; … … 279 297 /** 280 298 \brief insert an element 299 300 \return a n iterator pointing to just inserted element 301 302 Complexity: logarithmic in size of container. 281 303 */ 282 304 iterator insert(const T& element) … … 290 312 /** 291 313 \brief insert an element 314 315 Same as insert(const T& element) but moves rather than copy \c 316 element. 292 317 */ 293 318 iterator insert(T&& element) … … 316 341 /** 317 342 \brief insert with hint 343 344 Same as as insert(const_iterator, const T&) but move instead of 345 copy \c element. 318 346 */ 319 347 iterator insert(const_iterator hint, T&& element) … … 327 355 /** 328 356 \brief insert range 357 358 Complexity: N log S, where S is size of container and N is 359 number of inserted elements. If inserted range is sorted, 360 complexity linear, N. 329 361 */ 330 362 template<typename InputIterator> … … 338 370 /** 339 371 \return the first element which is equal (or greater) to \c x 372 373 Complexity: logarithmic in size of container. 340 374 */ 341 375 const_iterator lower_bound(const T& x) const … … 349 383 /** 350 384 \return the first element which is greater than \c x 385 386 Complexity: logarithmic in size of container. 351 387 */ 352 388 const_iterator upper_bound(const T& x) const … … 360 396 /** 361 397 \return number of elements smaller than \c it 398 399 Complexity: logarithmic in size of container. 362 400 */ 363 401 size_t ranking(const_iterator it) const … … 370 408 /** 371 409 \return number of elements in container 410 411 Complexity: constant time 372 412 */ 373 413 size_t size(void) const … … 378 418 private: 379 419 Compare compare_; 420 // Things that are agnostic to T are implemented in impl_. 380 421 ranking::Impl impl_; 381 422 -
trunk/yat/utility/ranking/Impl.h
r4079 r4087 39 39 namespace ranking { 40 40 41 /** 42 This class is a helpwer class for Ranking that handles 43 everything that is independent of template parameter T. Copy 44 constructor and assignment are deleted because copying a tree 45 needs to be aware of T so the nodes can be copied (cloned) 46 correctly, i.e., copied as NoveValue<T> objects (not NodeBase). 47 */ 41 48 class Impl 42 49 {
Note: See TracChangeset
for help on using the changeset viewer.