r-opt / rmpk

Mixed Integer Linear and Quadratic Programming in R
https://r-opt.github.io/rmpk/
Other
45 stars 4 forks source link

Set interface #37

Closed dirkschumacher closed 3 years ago

dirkschumacher commented 4 years ago

A set based interface as in other modelling packages like JuMP might be a good extension.

model$add_constraint(<expr>, <set>)
model$add_constraint(x + y, NegativeReal) #something like that
dirkschumacher commented 4 years ago

Then can then handle special cases like conic constraints which are also now supported in ROI.

Or concepts like SOS variables in certain solvers.

model$add_constraint(list(x, y, z), SOS1())
dirkschumacher commented 4 years ago

Or something like this:

model$add_constraint(
  list(t, x - 1, x - 2) %in_set% Set$SecondOrderCone()
)
dirkschumacher commented 4 years ago

For now I will settle with this:

model$add_constraint(x + 5, in_set = MOI::less_than_set(10))
dirkschumacher commented 4 years ago

49