set.column: Set Column

Description Usage Arguments Value Author(s) References Examples

View source: R/set.column.q

Description

Set a column in an lpSolve linear program model object.

Usage

1
set.column(lprec, column, x, indices)

Arguments

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

optional for sparse x. 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 set in constraint indices[i] in the specified column. The coefficients for the constraints not in indices are set to zero. In particular, index 0 is the objective function coefficient in the specified column and is set to zero by default. This argument should be omitted when length(x) == m.

Value

a NULL value is invisibly returned.

Author(s)

Kjell Konis [email protected]

References

http://lpsolve.sourceforge.net/5.5/index.htm

Examples

1
2
3
lps.model <- make.lp(4, 2)
set.column(lps.model, 2, c(6,2,4,9))
set.column(lps.model, 1, c(3,1,5), indices = c(1,2,4))

Example output



lpSolveAPI documentation built on May 30, 2017, 7:12 a.m.