Skip to content
Snippets Groups Projects
Commit 10b69fa2 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: ListOp::inplaceMapValue using a Map<label> for the mapping.

For example, with some HashTable or Map container of models

    { model0 => 1, model1 => 4, model2 => 5, model3 => 12, model4 => 15, }

specify the remapping

    Map<label> mapper({{1, 3}, {2, 6}, {3, 12}, {5, 8}});

inplaceMapValue(mapper, models) then yields

    { model0 => 3, model1 => 4, model2 => 8, model3 => 12, model4 => 15, }

--

ENH: extend bitSet::count() to optionally count unset bits instead.

--

ENH: BitOps compatibility methods for boolList.

- These ease coding that uses a boolList instead of bitSet and use
  short-circuit logic when possible.

  Eg, when 'bitset' and 'bools' contain the same information

      bitset.count()  <->  BitOps::count(bools)
      bitset.all()    <->  BitOps::all(bools)
      bitset.any()    <->  BitOps::any(bools)
      bitset.none()   <->  BitOps::none(bools)

  These methods can then be used directly in parameters or in logic.
  Eg,

      returnReduce(bitset.any(), orOp<bool>());
      returnReduce(BitOps::any(bools), orOp<bool>());

      if (BitOps::any(bools)) ...
parent c0766ce8
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment