This small library provides exact bitwise operations on integer intervals. The results are exact in the sense that they are the same than a brute-force implementation, but faster. Integer intervals can be either signed (SInterval
) or unsigned (UInterval
).
The four operations are:
- NOT:
bitwiseUnsignedNot()
orbitwiseSignedNot()
- OR:
bitwiseUnsignedOr()
orbitwiseSignedOr()
- AND:
bitwiseUnsignedAnd()
orbitwiseSignedAnd()
- XOR:
bitwiseUnsignedXOr()
orbitwiseSignedXOr()
Only NOT and OR are really implemented. AND and XOR operations are implemented by De Morgan equivalences.
The implementation is in two files bitwiseOperations.hh,.cpp
. All the other files implements brute force methods and tests.
The random tests are implemented in main.cpp
.