set.constr.type: Set Constraint Type

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/set.constr.type.q

Description

Set constraint types in an lpSolve linear program model object.

Usage

1
set.constr.type(lprec, types, constraints = 1:m)

Arguments

lprec

an lpSolve linear program model object.

types

either a numeric vector or a character vector containing elements from the set {1 = "<=", 2 = ">=", 3 = "="} specifying the types of constraints. Additionally, the contraint type can be set to free uinsg the code 0.

constraints

a numeric vector of unique values from the set {1, ..., m} (where m is the number of constraints in lprec) specifying which constraints to set.

Value

a NULL value is invisibly returned.

Author(s)

Kjell Konis kjell.konis@me.com

References

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

See Also

resize.lp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lps.model <- make.lp(4, 2)

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

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

set.constr.type(lps.model, rep("<=", 4))

Example output



lpSolveAPI documentation built on July 8, 2020, 6:17 p.m.