Skip to content
Snippets Groups Projects

Feature indirect lists

Merged Mark OLESEN requested to merge feature-indirect-lists into develop
  1. Apr 24, 2019
    • Mark OLESEN's avatar
      ENH: add partial sorting to SortableList · dd11951c
      Mark OLESEN authored
      dd11951c
    • Mark OLESEN's avatar
      STYLE: remove UList operator[] taking std::initializer_list · 1d77aeb5
      Mark OLESEN authored
      - unnecessary. Can deduce labelRange from the pair of labels.
        These are all the same:
      
            list[labelRange(18,3)] = 100;
            list[labelRange{18,3}] = 100;
            list[{18,3}] = 100;
      
        Removing the run-time handling of std::initializer_list in favour of
        compile-time deduction allows the future use of sliceRange as well.
        Eg,
      
           list[sliceRange{18,3,2}] = 100;
           list[{18,3,2}] = 100;
      1d77aeb5
    • Mark OLESEN's avatar
      ENH: generalize indirect lists and support new types · c3403761
      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
      c3403761