I am using eplex and ic library and trying to solve a problem. I see that the eplex and ic provide explicit support for addition,multiplication and subtraction but there is no support for modulo or division.
More precisely, I have this code :
FirstResult #= (Result[I] mod Val), % Here it gives error because Result[I] is not instantiated.
NewVal is Val+1,
SecondResult #= (Result[I] mod NewVal)
and mod requires its two arguments to be ground but Result[I] is not instantiated, rather it has range of values. So my question is how such constraints which involve mod operation can be delayed.
You can normally reformulate
as
This assumes you are using
library(ic)and you don't have any special requirements for the behaviour with negative arguments.For
library(eplex), which uses a MILP solver, you can do almost the same (as long as Y is an integer parameter), but you have to be a bit more explicit about integrality: