Extract the objective function from a model

objective_function(model)

## Arguments

model the model

## Value

a list with two named elements, 'solution' and 'constant'. 'solution' is a sparse vector from the Matrix package. 'constant' is a constant that needs to be added to get the final obj. value.

## Examples

library(magrittr)
model <- MIPModel() %>%
objective_function(model)#> $solution #> sparse vector (nnz/length = 5/5) of class "dsparseVector" #> [1] 1 2 3 4 5 #> #>$constant
#>