lpSolveAPI (version 5.5.2.0-17.6)

get.kind: Get Kind

Description

Retrieve the kind of a decision variable from an lpSolve linear program model object.

Usage

get.kind(lprec, columns = 1:n)

Arguments

lprec

an lpSolve linear program model object.

columns

a numeric vector of unique values from the set {1, …, n} (where n is the number of decision variables in lprec) specifying the columns for which the kind will be retrieved.

Value

a character vector containing the kind of each decision variable specified in columns.

Details

Decision variables have both a type and a kind. The type is either real or integer and indicates the type of values the decision variable may take. The kind is one of {standard, semi-continuous, SOS}. Semi-continuous decision variables can take allowed values between their upper and lower bound as well as zero. Please see the link in the references for a discussion of special ordered set (SOS) constraints.

References

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

Examples

Run this code
# NOT RUN {
lps.model <- make.lp(0, 3)
xt <- c(6,2,4)
add.constraint(lps.model, xt, "<=", 150)
xt <- c(1,1,6)
add.constraint(lps.model, xt, ">=", 0)
xt <- c(4,5,4)
add.constraint(lps.model, xt, "=", 40)
set.objfn(lps.model, c(-3,-4,-3))

get.kind(lps.model)
# }

Run the code above in your browser using DataLab