set.row {lpSolveAPI}R Documentation

Set Row

Description

Set a column in an lpSolve linear program model object.

Usage

set.row(lprec, row, xt, indices = 1:n)

Arguments

lprec an lpSolve linear program model object.
row a single numeric value from the set {1, ..., m} (where m is the number of constraints in lprec) specifying which column to set.
xt a numeric vector containing the constraint coefficients (only the nonzero coefficients if indices is also given). The length of xt must be equal to the number of decision variables in lprec unless indices is provided.
indices a numeric vector the same length as xt of unique values from the set {1, ..., n} (where n is the number of decision variables in lprec); xt[j] becomes the constraint coefficient for variable indices[j]. Constraint coefficients not specified in indices are set to be zero.

Value

a logical value indicating whether the row was successfully set.

Author(s)

Kjell Konis kjell.konis@epfl.ch

References

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

Examples

lps.model <- make.lp(2, 4)

xt <- c(6,2,4,9)
set.row(lps.model, 2, xt)

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

[Package lpSolveAPI version 5.5.0.14 Index]