1. 19 May, 2017 1 commit
  2. 18 May, 2017 4 commits
  3. 17 May, 2017 3 commits
  4. 15 May, 2017 5 commits
  5. 14 May, 2017 3 commits
    • Mark Olesen's avatar
      BUG: hashtable key_iterator ++ operator returning incorrect type · 4b0d1632
      Mark Olesen authored
      ENH: ensure std::distance works with hashtable iterators
      4b0d1632
    • Mark Olesen's avatar
      ENH: avoid std::distance for std::initializer_list · 0c53a815
      Mark Olesen authored
      - std::initializer_list has its own size() method, so no need to use
        std::distance.
      
      STYLE/BUG: use separate iterator de-reference and increment in List
      
      - avoids unnecessary copying of iterators, and avoids any potentially
        odd behaviour with the combination with incrementing.
      
      ENH: support construct from iterator pair for DynamicList, SortableList
      0c53a815
    • Mark Olesen's avatar
      ENH: improvements to labelRange const_iterator · 83669e28
      Mark Olesen authored
      - inherit from std::iterator to obtain the full STL typedefs, meaning
        that std::distance works and the following is now possible:
      
            labelRange range(100, 1500);
            scalarList list(range.begin(), range.end());
      
        --
        Note that this does not work (mismatched data-types):
      
            scalarList list = identity(12345);
      
        But this does, since the *iter promotes label to scalar:
      
            labelList ident = identity(12345);
            scalarList list(ident.begin(), ident.end());
      
        It is however more than slightly wasteful to create a labelList
        just for initializing a scalarList. An alternative could be a
        a labelRange for the same purpose.
      
            labelRange ident = labelRange::identity(12345);
            scalarList list(ident.begin(), ident.end());
      
        Or this
            scalarList list
            (
                labelRange::null.begin(),
                labelRange::identity(12345).end()
            );
      83669e28
  6. 12 May, 2017 1 commit
  7. 11 May, 2017 1 commit
    • Mark Olesen's avatar
      ENH: added HashTable 'lookup' and 'retain' methods · f73b5b62
      Mark Olesen authored
      - lookup(): with a default value (const access)
        For example,
            Map<label> something;
            value = something.lookup(key, -1);
      
          being equivalent to the following:
      
            Map<label> something;
            value = -1;  // bad value
            if (something.found(key))
            {
                value = something[key];
            }
      
          except that lookup also makes it convenient to handle const references.
          Eg,
      
            const labelList& ids = someHash.lookup(key, labelList());
      
      - For consistency, provide a two parameter HashTable '()' operator.
        The lookup() method is, however, normally preferable when
        const-only access is to be ensured.
      
      - retain(): the counterpart to erase(), it only retains entries
        corresponding to the listed keys.
      
        For example,
            HashTable<someType> largeCache;
            wordHashSet preserve = ...;
      
            largeCache.retain(preserve);
      
          being roughly equivalent to the following two-stage process,
          but with reduced overhead and typing, and fewer potential mistakes.
      
            HashTable<someType> largeCache;
            wordHashSet preserve = ...;
      
            {
                wordHashSet cull(largeCache.toc()); // all keys
                cull.erase(preserve);               // except those to preserve
                largeCache.erase(cull);             //
            }
      
        The HashSet &= operator and retain() are functionally equivalent,
        but retain() also works with dissimilar value types.
      f73b5b62
  8. 10 May, 2017 2 commits
  9. 08 May, 2017 6 commits
  10. 07 May, 2017 2 commits
  11. 05 May, 2017 3 commits
  12. 04 May, 2017 9 commits