Skip to content

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

@fhermeni

Description

@fhermeni

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions