get.kind: Get Kind

View source: R/get.kind.R

get.kindR Documentation

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.

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.

Value

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

Author(s)

Kjell Konis kjell.konis@me.com

References

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

Examples

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)

lpSolveAPI documentation built on Sept. 11, 2024, 9:27 p.m.