Determine if a problem or expression complies with the disciplined convex programming rules.

is_dcp(object)

Arguments

object

A Problem or Expression object.

Value

A logical value indicating whether the problem or expression is DCP compliant, i.e. no unknown curvatures.

Examples

x <- Variable()
prob <- Problem(Minimize(x^2), list(x >= 5))
is_dcp(prob)
#> [1] TRUE
solve(prob)
#>  Status: optimal
#>  Objective value: 25.000000
#>  Solver: OSQP
#> → <me>$getValue(x) returns value of variable/constraint x