Learn R Programming

lpSolveAPI (version 5.5.2.0-17.12)

get.basis: Get Basis

Description

Retrieve the basis from a solved lpSolve linear program model object.

Usage

get.basis(lprec, nonbasic = FALSE)

Value

an integer vector containing the indices of the basic (and nonbasic if requested) variables. If an error occurs (for instance when calling get.basis on a model that has not yet been solved) a NULL value is returned.

Arguments

lprec

an lpSolve linear program model object.

nonbasic

a logical value. If TRUE, the nonbasic variables are returned as well.

Author

Kjell Konis kjell.konis@me.com

References

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

Examples

Run this code
lps.model <- make.lp(3, 3)
## build and solve model ##
get.basis(lps.model)

Run the code above in your browser using DataLab