Changeset 4087


Ignore:
Timestamp:
Aug 30, 2021, 4:00:02 AM (3 months ago)
Author:
Peter
Message:

extend docs; closes #710

Location:
trunk/yat/utility
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Ranking.h

    r4083 r4087  
    5454    /// type used to compare elements
    5555    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;
    5664    /// size type
    5765    typedef size_t size_type;
     
    254262       \return An iterator pointing to the element that follows the
    255263       last element removed.
     264
     265       Complexity: constant time.
    256266     */
    257267    iterator erase(const_iterator position);
     
    260270       Erase all elements that are equivalent with \c value
    261271       \return number of elements removed
     272
     273       Complexity: logarithmic in size of container.
    262274     */
    263275    size_type erase(const T& value);
     
    268280       \return An iterator pointing to the element that follows the
    269281       last element removed.
     282
     283       Complexity: Linear in number of elements erased.
    270284     */
    271285    iterator erase(const_iterator first, const_iterator last);
    272286
    273287    /**
    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.
    275293     */
    276294    const_iterator find(const T& x) const;
     
    279297    /**
    280298       \brief insert an element
     299
     300       \return a n iterator pointing to just inserted element
     301
     302       Complexity: logarithmic in size of container.
    281303     */
    282304    iterator insert(const T& element)
     
    290312    /**
    291313       \brief insert an element
     314
     315       Same as insert(const T& element) but moves rather than copy \c
     316       element.
    292317     */
    293318    iterator insert(T&& element)
     
    316341    /**
    317342       \brief insert with hint
     343
     344       Same as as insert(const_iterator, const T&) but move instead of
     345       copy \c element.
    318346     */
    319347    iterator insert(const_iterator hint,  T&& element)
     
    327355    /**
    328356       \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.
    329361     */
    330362    template<typename InputIterator>
     
    338370    /**
    339371       \return the first element which is equal (or greater) to \c x
     372
     373       Complexity: logarithmic in size of container.
    340374     */
    341375    const_iterator lower_bound(const T& x) const
     
    349383    /**
    350384       \return the first element which is greater than \c x
     385
     386       Complexity: logarithmic in size of container.
    351387     */
    352388    const_iterator upper_bound(const T& x) const
     
    360396    /**
    361397       \return number of elements smaller than \c it
     398
     399       Complexity: logarithmic in size of container.
    362400     */
    363401    size_t ranking(const_iterator it) const
     
    370408    /**
    371409       \return number of elements in container
     410
     411       Complexity: constant time
    372412     */
    373413    size_t size(void) const
     
    378418  private:
    379419    Compare compare_;
     420    // Things that are agnostic to T are implemented in impl_.
    380421    ranking::Impl impl_;
    381422
  • trunk/yat/utility/ranking/Impl.h

    r4079 r4087  
    3939  namespace ranking {
    4040
     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     */
    4148    class Impl
    4249    {
Note: See TracChangeset for help on using the changeset viewer.