Learn R Programming

gMOIP (version 1.0.0)

integerPoints: Integer points inside an LP.

Description

Integer points inside an LP.

Usage

integerPoints(LP)

Arguments

LP
The LP object defined using lpSolveAPI

Value

A data frame with all integer points inside the feasible region (columns x1, x2, lbl).

Examples

Run this code
# Create the LP using lpSolveAPI package
LP <- make.lp(0, 2)
set.objfn(LP, c(7.75, 10))
add.constraint(LP, c(9, 10), "<=", 90)
add.constraint(LP, c(2, 4), "<=", 27)
add.constraint(LP, c(-3, 2), "<=", 3)
colNames <- c("x1", "x2")
colnames(LP) <- colNames
set.type(LP, c(1,2), type = "integer")

control <- lp.control(LP, sense='max')
cPoints<-cornerPoints(getA(LP), get.rhs(LP))
iPoints<-integerPoints(LP)

plotPolytope(cPoints, iPoints, iso = getC(LP), crit = substr(lp.control(LP)$sense,1,3))

Run the code above in your browser using DataLab