This class represents an optimization objective for maximization.

Maximize(expr)

# S4 method for Maximize
canonicalize(object)

# S4 method for Maximize
is_dcp(object)

# S4 method for Maximize
is_dgp(object)

Arguments

expr

A scalar Expression to maximize.

object

A Maximize object.

Methods (by generic)

  • canonicalize(Maximize): Negates the target expression's objective.

  • is_dcp(Maximize): A logical value indicating whether the objective is concave.

  • is_dgp(Maximize): A logical value indicating whether the objective is log-log concave.

Slots

expr

A scalar Expression to maximize.

Examples

x <- Variable(3)
alpha <- c(0.8,1.0,1.2)
obj <- sum(log(alpha + x))
constr <- list(x >= 0, sum(x) == 1)
prob <- Problem(Maximize(obj), constr)
result <- solve(prob)
result$value
#> [1] 0.8630462
result$getValue(x)
#>           [,1]
#> [1,] 0.5333338
#> [2,] 0.3333332
#> [3,] 0.1333331