choco-solver
choco-solver copied to clipboard
Model.intVar() should accept enumerated domains provided in bitsets
int[] is a confortable approach to state the domain but
- in terms of memory usage it is not necessarily concise
- it requires the solver to clone the array which can be costly (refer to point 1 as well)
- eventually, it is only used to populate a backtrackable bitset when we use a BitsetIntVarImpl backend
It would be great to be able to provide a bitset
- more concise
- faster and cheaper clone if needed
- can be reused by the caller given it is more flexible than an int[]
- no need to sort
- it should speed up BitsetIntVarImpl initialisation using bitset magic