1. 18 May, 2020 1 commit
  2. 13 May, 2020 1 commit
  3. 27 Apr, 2020 1 commit
    • Mark Olesen's avatar
      ENH: retain compound type on List output (continuation of 68de0528) · 394a3a9b
      Mark Olesen authored
      - can help in circumstances when an zero-sized entry is written on
        some processors, but the compound-type may be useful for determining
        a particular code path when re-reading the files. Ensures that the
        information is consistent on all processors.
      STYLE: adjust separation of includes between List.H and UList.H
  4. 10 Dec, 2019 1 commit
  5. 06 Dec, 2019 1 commit
    • Mark Olesen's avatar
      ENH: add ITstream append and seek methods. · 9fd696e1
      Mark Olesen authored
      - ITstream append() would previously have used the append from the
        underlying tokenList, which leaves the tokenIndex untouched and
        renders the freshly appended tokens effectively invisible if
        interspersed with primitiveEntry::read() that itself uses tokenIndex
        when building the list.
        The new append() method makes this hidden ITstream bi-directionality
        easier to manage. For efficiency, we only append lists
        (not individual tokens) and support a 'lazy' resizing that allows
        the final resizing to occur later when all tokens have been appended.
      - The new ITstream seek() method provides a conveniently means to move
        to the end of the list or reposition to the middle.
        Using rewind() and using seek(0) are identical.
      ENH: added OTstream to output directly to a list of tokens
      BUG: List::newElem resized incorrectly
      - had a simple doubling of the List size without checking that this
        would indeed be sufficient for the requested index.
        Bug was not triggered since primitiveEntry was the only class using
        this call, and it added the tokens sequentially.
  6. 31 Oct, 2019 1 commit
  7. 05 Nov, 2019 1 commit
  8. 28 Oct, 2019 1 commit
  9. 02 Oct, 2019 1 commit
  10. 29 Jul, 2019 2 commits
    • Mark Olesen's avatar
      ENH: add readContiguous detail (#1378) · 39834d8f
      Mark Olesen authored
      - allows some internal handling for reading dissimilar storage types.
        Eg, scalars written as float (WM_SP), but read as double (WM_DP)
      - reading binary parcel coordinates with dissimilar storage types is
        still pending
    • Mark Olesen's avatar
      ENH: additional contiguous traits (#1378) · 1d79c045
      Mark Olesen authored
      - change contiguous from a series of global functions to separate
        templated traits classes:
          - is_contiguous
          - is_contiguous_label
          - is_contiguous_scalar
        The static constexpr 'value' and a constexpr conversion operator
        allow use in template expressions.  The change also makes it much
        easier to define general traits and to inherit from them.
        The is_contiguous_label and is_contiguous_scalar are special traits
        for handling data of homogeneous components of the respective types.
  11. 11 Apr, 2019 2 commits
    • Mark Olesen's avatar
      STYLE: remove unneeded, rarely used construct/assign List from BiIndirectList · cf916554
      Mark Olesen authored
      - the only code location using BiIndirectList are debug sections
        within polyTopoChange.
        No need to construct/assign directly from a BiIndirectList since
        the '()' method provides a simple alternative.
    • Mark Olesen's avatar
      ENH: generalize indirect lists and support new types · 765493b6
      Mark Olesen authored
      - use an IndirectListBase class for various indirect list types.
      - new SortList type
        In some places the SortList can be used as a lightweight alternative
        to SortableList to have the convenience of bundling data and sort
        indices together, but while operating on existing data lists.
        In other situations, it can be useful as an alternative to
        sortedOrder.  For example,
              pointField points = ...;
              labelList order;
              sortedOrder(points, order);
              forAll(order, i)
                  points[order[i]] = ...;
         Can be replaced with the following (with the same memory overhead)
              pointField points = ...;
              SortList<point> sortedPoints(points);
              for (point& pt : sortedPoints)
                  pt = ...;
      - new SliceList type (#1220), which can be used for stride-based
        addressing into existing lists
  12. 08 Feb, 2019 1 commit
  13. 07 Feb, 2019 1 commit
    • Mark Olesen's avatar
      ENH: code adjustments for updated NullObject · 078e3474
      Mark Olesen authored
      - can now safely use labelList::null() instead of emptyLabelList for
        return values. No special treatment required for lists.
        Possible replacements:
            if (notNull(list) && list.size())  ->  if (list.size())
            if (isNull(list) || list.empty())  ->  if (list.empty())
        The receiver may still wish to handle differently to distinguish
        between a null list and an empty list, but no additional special
        protection is required when obtaining sizes, traversing, outputting
  14. 06 Feb, 2019 1 commit
  15. 16 Jan, 2019 1 commit
  16. 10 Jan, 2019 1 commit
  17. 08 Jan, 2019 1 commit
  18. 09 Aug, 2018 1 commit
  19. 08 Aug, 2018 1 commit
    • Mark Olesen's avatar
      ENH: add missing Hash function for List/UList (issue #966) · dd9ecd49
      Mark Olesen authored
      - there were previously no hashing mechanisms for lists so they
        would fall back to the definition for primitives and hash the
        memory location of the allocated List object.
      - provide a UList::Hash<> sub-class for inheritance, and also a global
        specialization for UList<T>, List<T> such that the hash value for
        List<List<T>> cascades properly.
      - provide similar function in triFace to ensure that it remains
        similar in behaviour to face.
      - added SymmHash to Pair, for use when order is unimportant.
      STYLE: use string::hash() more consistently
      - no particular reason to use Hash<word>() which forwards to
        string::hash() anyhow
  20. 01 Aug, 2018 1 commit
    • Mark Olesen's avatar
      STYLE: ensure that emptyLabelList is known from List.H · d8c0167e
      Mark Olesen authored
      - treat as a List constant without requiring inclusion of ListOps.H
      - replace use of emptyList<label>() with emptyLabelList directly.
        The emptyList<T>() casting is disallowed with many modern compilers
        and now marked as deprecated (expect early removal).
      - relocate labelList typedef to List.H for more general access.
        Similar reasoning to having labelUList defined in UList.H
  21. 27 Jul, 2018 1 commit
  22. 30 May, 2018 1 commit
  23. 05 Mar, 2018 1 commit
  24. 26 Feb, 2018 1 commit
  25. 01 Mar, 2018 1 commit
    • Mark Olesen's avatar
      ENH: cleanup of ListOps, ListListOps. Adjustments to List, PackedList. · 15f72608
      Mark Olesen authored
      - relocated ListAppendEqOp and ListUniqueEqOp to ListOps::appendEqOp
        and ListOps::UniqueEqOp, respectively for better code isolation and
        documentation of purpose.
      - relocated setValues to ListOps::setValue() with many more
        alternative selectors possible
      - relocated createWithValues to ListOps::createWithValue
        for better code isolation. The default initialization value is itself
        now a default parameter, which allow for less typing.
        Negative indices in the locations to set are now silently ignored,
        which makes it possible to use an oldToNew mapping that includes
        negative indices.
      - additional ListOps::createWithValue taking a single position to set,
        available both in copy assign and move assign versions.
        Since a negative index is ignored, it is possible to combine with
        the output of List::find() etc.
      STYLE: changes for PackedList
      - code simplication in the PackedList iterators, including dropping
        the unused operator() on iterators, which is not available in plain
        list versions either.
      - improved sizing for PackedBoolList creation from a labelUList.
      ENH: additional List constructors, for handling single element list.
      - can assist in reducing constructor ambiguity, but can also helps
        memory optimization when creating a single element list.
        For example,
          labelListList labels(one(), identity(mesh.nFaces()));
  26. 08 Feb, 2018 1 commit
    • Mark Olesen's avatar
      ENH: cleanup List constructors (issue #725) · e42c2281
      Mark Olesen authored
      - add copy construct from UList
      - remove copy construct from dissimilar types.
        This templated constructor was too generous in what it accepted.
        For the special cases where a copy constructor is required with
        a change in the data type, now use the createList factory method,
        which accepts a unary operator. Eg,
            auto scalars = scalarList::createList
                [](const label& val){ return 1.5*val; }
  27. 27 Nov, 2017 1 commit
    • Mark Olesen's avatar
      ENH: several improvements for linked-lists · cc5f30f2
      Mark Olesen authored
      - support move construct/assignment for linked-lists themselves
        and when moving into a 'normal' list
      - better consistency with begin/end signatures and the various
      - for indirect linked-lists, provide iterator access to the underlying
        data element address:   iter.get()  vs  &(iter())
      - add standard '->' indirection for iterators (as per normal STL
  28. 09 Nov, 2017 1 commit
  29. 05 Nov, 2017 1 commit
  30. 04 Nov, 2017 1 commit
  31. 26 Nov, 2017 1 commit
    • Mark Olesen's avatar
      STYLE: relegate special purpose readList<T> function to points of use · 2787a866
      Mark Olesen authored
      - the readList<T>(Istream&) function was introduced to handle command
        -options with either a single or a list value, but was also used for
        the #remove dictionary directive. However, the parsing was fragile
        if the list did not start with a '('.
        Now handle command-line arg/option list directly (via ITstream)
        and #remove with special-purpose reading of a string or word list.
        This removes ambiguity and reduces potential future problems.
      STYLE: use ITstream instead of IStringStream for command-line lookups
      - parses directly to a tokenList without a string copy.
  32. 15 Aug, 2017 1 commit
  33. 25 Oct, 2017 1 commit
    • Mark Olesen's avatar
      ENH: relocate protected List::size(label) to UList (issue #595) · 5c1ec7ec
      Mark Olesen authored
      - makes it accessible for containers that manage their own storage
        and derive directly from UList.
      - DynamicList::min_size() method to access the corresponding
        SizeMin template parameter.
      - ensure consistency in the reserve size for the constructor
            DynamicList<..> lst(N);
        now has identical sizing as
            DynamicList<..> lst();
  34. 20 Oct, 2017 1 commit
    • Mark Olesen's avatar
      ENH: additional low-level raw binary output for Ostream. · 74f667a8
      Mark Olesen authored
      - low-level beginRaw(), writeRaw(), endRaw() methods.
        These can be used to directly add '()' decorators for serial output
        or prepare/cleanup parallel buffers.
        Used, for example, when outputting indirect lists in binary to avoid.
  35. 20 Sep, 2017 2 commits
    • Mark Olesen's avatar
      ENH: update List and DynamicList methods (issue #595) · 049617d0
      Mark Olesen authored
      - improve functional compatibility with DynList (remove methods)
        * eg, remove an element from any position in a DynamicList
        * reduce the number of template parameters
        * remove/subset regions of DynamicList
      - propagate Swap template specializations for lists, hashtables
      - move construct/assignment to various containers.
      - add find/found methods for FixedList and UList for a more succinct
        (and clearer?) usage than the equivalent global findIndex() function.
      - simplify List_FOR_ALL loops
    • Mark Olesen's avatar
  36. 26 May, 2017 1 commit
  37. 14 May, 2017 1 commit
    • 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
      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