addConstraint add additional constraints to optimization problem.

addConstraint(p, ...)

Arguments

p

optimization problem to add constraints.

...

additional constraints.

Value

the optimization problem with the additional constraints.

Examples

# NOT RUN {
    convex_setup()
    x <- Variable(4)
    b <- J(c(1:4))
    p <- minimize(sum((x - b) ^ 2))
    p <- addConstraint(p, x >= 0, x <= 3)
# }