set.column {lpSolveAPI} | R Documentation |
Set a column in an lpSolve linear program model object.
set.column(lprec, column, x, indices = 1:m)
lprec |
an lpSolve linear program model object. |
column |
a single numeric value from the set {1, ..., n} specifying which column to set. |
x |
a numeric vector containing the elements (only the nonzero elements if indices is also given) to be used in the added column. The length of x must be equal to the number of constraints in lprec unless indices is provided. |
indices |
a numeric vector the same length as x of unique values from the set {0, ..., m} where m is the number of constraints in lprec ; x[i] is entered into constraint indices[i] in the column. The coefficients for the constraints not in indices are set to zero. In particular, index 0 is the objective function coefficient in the column and is set to zero by default. |
a logical value indicating whether the column was successfully set is invisibly returned.
Kjell Konis kjell.konis@epfl.ch
http://lpsolve.sourceforge.net/5.5/index.htm
lps.model <- make.lp(4, 2) x <- c(6,2,4,9) set.column(lps.model, 2, x) y <- c(3,1,5) ind <- c(1,2,4) set.column(lps.model, 1, y, ind)