1. 12 Mar, 2009 2 commits
  2. 10 Mar, 2009 1 commit
  3. 04 Mar, 2009 2 commits
    • Mark Olesen's avatar
    • Mark Olesen's avatar
      Switched from old hashing functions to use Bob Jenkins' hash routine · 17548296
      Mark Olesen authored
      - If the underlying type is contiguous, FixedList hashes its storage directly.
      - Drop labelPairHash (non-commutative) from fvMeshDistribute since
        FixedList::Hash does the right thing anyhow.
      - Hash<edge> specialization is commutative, without multiplication.
      - Hash<triFace> specialization kept multiplication (but now uLabel).
        There's not much point optimizing it, since it's not used much anyhow.
      Misc. changes
      - added StaticAssert to NamedEnum.H
      - label.H / uLabel.H : define FOAM_LABEL_MAX, FOAM_ULABEL_MAX with the
        values finally used for the storage.  These can be useful for pre-processor
        checks elsewhere (although I stopped needing them in the meantime).
  4. 27 Feb, 2009 4 commits
    • Mark Olesen's avatar
      StaticAssert added · 106d417d
      Mark Olesen authored
      - catch people using silly template sizes for FixedList, PackedList
    • mattijs's avatar
      operator== on result of operator[] behaves weird · 0f7b03e6
      mattijs authored
    • Mark Olesen's avatar
      PackedList iterator bugfix · dbc9b742
      Mark Olesen authored
      - compare iteratorBase == iteratorBase by value, not position
        thus this works
            list[a] == list[b] ...
      - compare iterator == iteratorBase and const_iterator == iteratorBase
        by position, not value. The inheritance rules means that this works:
            iter == list.end() ...
        this will compare positions:
            iter == list[5];
        Of course, this will still compare values:
            *iter == list[5];
    • Mark Olesen's avatar
      Preliminary work on hashing · 576d9388
      Mark Olesen authored
      - Hash returns unsigned
      - FixedList templated on unsigned int
      - include uLabel.H in UList, HashTable etc. so the output function is know
  5. 26 Feb, 2009 2 commits
    • Mark Olesen's avatar
      HashTable changes · a46c85f5
      Mark Olesen authored
      - make table power-of-two, but since it seems to give 1-2% performance
        improvement, maybe forget it too.
      - remove two-argument form of hashing classes and do the modulus direclty
        within HashTable instead. This simplifies things a fair bit.
      - migrate Hash<void*> from db/dlLibrary to primitives/hashes/Hash
    • Mark Olesen's avatar
      PackedList bugfix, HashTable tweak · 2aeee852
      Mark Olesen authored
      - it was possible to create a PackedList::iterator from a
        PackedList::const_iterator and violate const-ness
      - added HashTable::printInfo for emitting some information
      - changed default table sizes from 100 -> 128 in preparation for future
        2^n table sizes
  6. 25 Feb, 2009 1 commit
  7. 06 Feb, 2009 1 commit
    • Mark Olesen's avatar
      consistency update · 69918f23
      Mark Olesen authored
      - OSspecific: chmod() -> chMod(), even although it's not used anywhere
      - ListOps get subset() and inplaceSubset() templated on BoolListType
      - added UList<bool>::operator[](..) const specialization.
        Returns false (actually pTraits<bool>::zero) for out-of-range elements.
        This lets us use List<bool> with lazy evaluation and no noticeable
        change in performance.
      - use rcIndex() and fcIndex() wherever possible.
        Could check if branching or modulus is faster for fcIndex().
      - UList and FixedList get 'const T* cdata() const' and 'T* data()' members.
        Similar to the STL front() and std::string::data() methods, they return a
        pointer to the first element without needing to write '&myList[0]', recast
        begin() or violate const-ness.
  8. 29 Jan, 2009 3 commits
    • Mark Olesen's avatar
      PackedList - activated lazy evaluation · 1f6733d9
      Mark Olesen authored
      - moving back to original flat addressing in iterators means there is no
        performance issue with using lazy evaluation
      - set() method now has ~0 for a default value.
        We can thus simply write 'set(i) to trun on all of the bits.
        This means we can use it just like labelHashSet::set(i)
      - added flip() method for inverting bits. I don't know where we might need
        it, but the STL has it so we might as well too.
    • Mark Olesen's avatar
      PackedList with unsigned template parameter · 55d4fb2e
      Mark Olesen authored
    • Mark Olesen's avatar
      PackedList improvements · 4e56643e
      Mark Olesen authored
      - dropped auto-vivification for now (performance issue), but reworked to
        allow easy reinstatement
      - derived both iterator and const_iterator from iteratorBase and use
        iteratorBase as our proxy for non-const access to the list elements.
        This allows properly chaining assignments:
           list[1] = list[2];
           list[1] = list[2] = 10;
      - assigning iterators from iteratorBase or other iterators works:
           iterator iter = list[20];
      - made template parameter nBits=1 the default
  9. 28 Jan, 2009 1 commit
    • Mark Olesen's avatar
      PackedList gets count() and trim() methods · 7c739978
      Mark Olesen authored
      - the bit counting is relatively fast:
        under 0.2 seconds for 1M bits counted 1000 times
      - trim()'ing the final zero elements tested for a few cases,
        but might need more attention
  10. 26 Jan, 2009 1 commit
    • Mark Olesen's avatar
      PackedList tweaks · 295d503d
      Mark Olesen authored
      - set() handles overflow as max_value() - the principle of least surprise.
      - use pointers in iterator to avoid any assignment issues. Allows default
        bitwise copy/assignment.
  11. 25 Jan, 2009 1 commit
    • Mark Olesen's avatar
      PackedList changes · 84ec272d
      Mark Olesen authored
      - added Mattijs' speed tests
      - optimized resize() and assignment operators to avoid set() method
      - add const_iterator and re-did the proxy handling.
      Reading/writing by looping across iterators is still somewhat slow, but
      might be acceptable.
  12. 23 Jan, 2009 2 commits
    • mattijs's avatar
      missing assignment operator · 6bd41c51
      mattijs authored
    • Mark Olesen's avatar
      PackedList: encapsulate calculations in an iterator · cc4cd0a1
      Mark Olesen authored
      - eliminated previous PackedBitRef class, the iterator does all of that and
        can also be used to (forward) traverse the list
      - no const_iterator yet
      - Note that PackedList is also a bit like DynamicList in terms of storage
        management and the append() method. Since the underlying storage in
        integer, any auto-vivified elements will also flood-fill the gaps with
  13. 22 Jan, 2009 1 commit
  14. 21 Jan, 2009 1 commit
  15. 20 Jan, 2009 1 commit
  16. 19 Jan, 2009 2 commits
  17. 16 Jan, 2009 1 commit
    • Mark Olesen's avatar
      consistency update for null pointers · 246d569c
      Mark Olesen authored
      - uniform use of reinterpret_cast<foo*>(0) instead of
      - make all static null() members inline since they are really only a cast:
  18. 15 Jan, 2009 1 commit
  19. 14 Jan, 2009 1 commit
  20. 09 Jan, 2009 1 commit
  21. 05 Jan, 2009 1 commit
    • Mark Olesen's avatar
      rename xfer<T> class to Xfer<T> · 19503c93
      Mark Olesen authored
      - The capitalization is consistent with most other template classes, but
        more importantly frees up xfer() for use as method name without needing
        special treatment to avoid ambiguities.
        It seems reasonable to have different names for transfer(...) and xfer()
        methods, since the transfer is occuring in different directions.
        The xfer() method can thus replace the recently introduced zero-parameter
        transfer() methods.
        Other name candidates (eg, yield, release, etc.) were deemed too abstract.
  22. 02 Jan, 2009 1 commit
    • Mark Olesen's avatar
      added xfer<...> transfer() method to various containers · cf488912
      Mark Olesen authored
      - this should provide a slightly more naturally means to using transfer
        constructors, for example
                labelList list2(list1.transfer());
            vs. labelList list2(xferMove(list1));
      - returns a plain list where appropriate (eg, DynamicList, SortableList)
        for example
                labelList list2(dynList1.transfer());
            vs. labelList list2(xferMoveTo<labelList>(dynList1));
  23. 31 Dec, 2008 1 commit
  24. 29 Nov, 2008 1 commit
  25. 25 Nov, 2008 1 commit
    • Mark Olesen's avatar
      SortableList + ListOps changes · 7e2a940d
      Mark Olesen authored
      - dropped setSize() in favour of List::setSize().
        The size of the indices is set in sort() anyhow and undefined before that.
      - added reverseSort() method
      - added ListOps uniqueOrder() and duplicateOrder()
  26. 24 Nov, 2008 1 commit
    • Mark Olesen's avatar
      DynamicList changes. · 41bbcb63
      Mark Olesen authored
      - setSize() adjusts the addressable length only.
        Changed setSize(label) usage to setCapacity(label) or reserve(label)
        throughout. The final name (capacity vs. storageSize() vs. whatever) can
        easily be decided at a later date.
      - added setSize(label, const T&), which may still not be really useful, but
        is at least now meaningful
      - made shrink() a bit more legible.
      - added append(UList<T>&)
      - copying from a UList avoids reallocations where possible
      The following bits of code continue to use the DynamicList::setSize(), but
      appear to be legitimate (or the corresponding code itself needs rethinking).
        src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointCells.C:167: error: within this context
        src/OpenFOAM/lnInclude/faceTemplates.C:44: error: within this context
        src/surfMesh/surfaceFormats/tri/TRIsurfaceFormatCore.C:178: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:737: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:741: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:745: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:749: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:754: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:935: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:940: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:1041: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:1046: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2161: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2162: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2201: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2205: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2261: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2262: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2263: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2264: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:2265: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3011: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3076: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3244: error: within this context
        src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C:3371: error: within this context
        src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:73: error: within this context
        src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:91: error: within this context
        src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:73: error: within this context
        src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C:91: error: within this context
  27. 23 Nov, 2008 2 commits
    • Mark Olesen's avatar
    • Mark Olesen's avatar
      DynamicList improvements/disambiguities · 129e16f9
      Mark Olesen authored
      * DynamicList::allocSize(label)
        - Adjust the allocated size. The addressed list can be truncated but not
          extended, use setSize() for that.
      * DynamicList::reserve(label)
        - Reserve allocation for *at least* this number of elements.
          Never shrinks the allocated size, nor touches the addressed list size.
      * DynamicList::setSize(label)
        - proposed behaviour:
          Adjust the addressed list size, allocating extra space if required.
        - The current behaviour is ambiguous about what addressable size will
          actually get set and using it to extend the addressable size (as
          per List) automatically shrinks the allocated space to this size!
  28. 20 Nov, 2008 1 commit
  29. 19 Nov, 2008 1 commit
    • Mark Olesen's avatar
      SortableList improvements · 4645e93f
      Mark Olesen authored
        - now works as expected with transfer() and assignment from other Lists
        - shrink() method : clears indices and returns underlying List