Skip to contents

Returns the problem's objective.

Usage

objective(x)

Arguments

x

A Problem object.

Value

A Minimize or Maximize object.

Details

Problem objects are immutable: the objective cannot be modified after construction. To change the objective, create a new Problem().

Examples

x <- Variable(2)
prob <- Problem(Minimize(sum_entries(x)), list(x >= 1))
objective(prob)
#> minimize SumEntries(var79, NULL, FALSE)