delete.constraint {lpSolveAPI} | R Documentation |
Delete a constraint from an lpSolve linear program model object.
delete.constraint(lprec, constraints)
lprec |
an lpSolve linear program model object. |
constraints |
a numeric vector of unique values from the set {1, ..., m} (where m is the number of constraints in lprec ) specifying which constraints should be deleted. |
a logical value is invisibly returned: TRUE
indicates that the operation was successful and FALSE
indicates that an error occurred.
Kjell Konis kjell.konis@epfl.ch
http://lpsolve.sourceforge.net/5.5/index.htm
lps.model <- make.lp(0, 4) set.objfn(lps.model, rep(1, 4)) xt <- c(6,2,4,9) add.constraint(lps.model, xt, "<=", 50) yt <- c(3,1,5) ind <- c(1,2,4) add.constraint(lps.model, yt, 2, 75, ind) delete.constraint(lps.model, 1)