powered by
Returns a copy of the problem's constraint list.
constraints(x)
A list of constraint objects.
A Problem object.
Problem objects are immutable: constraints cannot be modified after construction. To change constraints, create a new Problem(). This matches CVXPY's design where problems are immutable except through Parameter value changes.
Problem()
Problem(), objective()
objective()
x <- Variable(2) prob <- Problem(Minimize(sum_entries(x)), list(x >= 1)) length(constraints(prob)) # 1
Run the code above in your browser using DataLab