Learn R Programming

lpSolveAPI (version 5.5.2.0-17.12)

resize.lp: Resize LP

Description

Resize the data structures in an lpSolve linear program model object.

Usage

resize.lp(lprec, nrow, ncol)

Value

a NULL value is invisibly returned.

Arguments

lprec

an lpSolve linear program model object.

nrow

a single nonnegative integer value specifying the new number of rows for the lpSolve linear program model object.

ncol

a single nonnegative integer value specifying the new number of rows for the lpSolve linear program model object.

Author

Kjell Konis kjell.konis@me.com

Details

If the new size of the model is smaller than the size of the current model, the excess rows and/or columns are deleted. If the new size is larger, no change will be immediately apparent. However, the internal structures of lprec will have been adjusted to accommodate the larger model. Efficiency of model building can be improved by calling this function before adding additional columns (for example).

References

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

Examples

Run this code
lps.model <- make.lp(4, 0)
resize.lp(lps.model, 4, 2)

x <- c(6,2,4,9)
add.column(lps.model, x)

y <- c(3,1,5)
ind <- c(1,2,4)
add.column(lps.model, y, ind)

Run the code above in your browser using DataLab