choco-solver icon indicating copy to clipboard operation
choco-solver copied to clipboard

Model.intVar() should accept enumerated domains provided in bitsets

Open fhermeni opened this issue 11 months ago • 1 comments

int[] is a confortable approach to state the domain but

  1. in terms of memory usage it is not necessarily concise
  2. it requires the solver to clone the array which can be costly (refer to point 1 as well)
  3. 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

  1. more concise
  2. faster and cheaper clone if needed
  3. can be reused by the caller given it is more flexible than an int[]
  4. no need to sort
  5. it should speed up BitsetIntVarImpl initialisation using bitset magic

fhermeni avatar Dec 13 '24 20:12 fhermeni