Extract the objective function from a model

objective_function(model)

Arguments

model
the model

Examples

library(magrittr) model <- MIPModel() %>% add_variable(x[i], i = 1:5) %>% set_objective(sum_expr(i * x[i], i = 1:5) + 10) objective_function(model)
#> $vector #> [1] 1 2 3 4 5 #> #> $constant #> [1] 10 #>