openfoam/applications/test/bitSet2
Mark Olesen 036abb8ecb BUG: bitSet &= operation does not mask out non-overlapping (#2456)
- the values from non-overlapping blocks were simply ignored,
  which meant that ('111111111111' & '111111') would not mask out
  the unset values at all.

- similar oddities in other operations (|=, ^= etc)
  where the original implementation tried hard to avoid touching the
  sizing at all, but now better resolved as follows:

  - '|=' : Set may grow to accommodate new 'on' bits.
  - '^=' : Set may grow to accommodate new 'on' bits.
  - '-=' : Never changes the original set size.
  - '&=' : Never changes the original set size.
           Non-overlapping elements are considered 'off'.

  These definitions are consistent with HashSet behaviour
  and also ensures that (a & b) == (b & a)

ENH: improve short-circuiting within bitSet ops

- in a few places can optimise by checking for none() instead of
  empty() and avoid unnecessary block operations.

ENH: added bitSet::resize_last() method

- as the name says: resizes to the last bit set.
  A friendlier way of writing `resize(find_last()+1)`
2022-05-10 10:47:01 +02:00
..
Make STYLE: adds comments in empty Make/options files 2018-11-13 15:21:13 +01:00
Test-bitSet2.C BUG: bitSet &= operation does not mask out non-overlapping (#2456) 2022-05-10 10:47:01 +02:00