addVariable: Add a new variable to a LP or MIP

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

Description

addVariable creates a new variable (continuous, integer or binary) and adds it to a linear program (LP) or mixed integer program (MIP) represented by an object of class lpmodeler.

Usage

1
addVariable(p, t = c("C", "I", "B"), o = 0, name = NULL)

Arguments

p

an object of class lpmodeler

t

type of the variable to create, C = continuous (default), I = integer, B = binary

o

numeric value representing the coefficient of the variable in the objective function (objective point), 0 by default

name

an optional string to name the new variable

Details

TODO

Value

An object of class lpmodeler.

Author(s)

Cyrille Szymanski <cnszym at gmail.com>

See Also

TODO

Examples

1
2
3
4
5
6
p <- newProblem()

# add an integer variable called x to the
# problem, and set its coefficient in the
# objective function to a value of 5.
p <- addVariable(p, "I", 5, "x")

lpmodeler documentation built on May 2, 2019, 2:46 p.m.