objective: Get Problem Objective (read-only)

View source: R/257_zzz_R_specific_exports.R

objectiveR Documentation

Get Problem Objective (read-only)

Description

Returns the problem's objective.

Usage

objective(x)

Arguments

x

A Problem object.

Details

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

Value

A Minimize or Maximize object.

See Also

Problem(), constraints()

Examples

x <- Variable(2)
prob <- Problem(Minimize(sum_entries(x)), list(x >= 1))
objective(prob)


CVXR documentation built on March 6, 2026, 9:10 a.m.