lifebeyondfife / Decider

An Open Source .Net Constraint Programming Solver
MIT License
150 stars 21 forks source link

Allow negative values in constrained variable domains #21

Closed lifebeyondfife closed 5 years ago

lifebeyondfife commented 5 years ago

Owing to the underlying (bitwise) implementation of the domain representation, only positive integers and zero were able to be represented. This change includes an offset amount to allow variables to consider negative values.

The implementation is a little clumsy but avoids refactoring complex bitwise calculations.