Definition of Linear Program

Share:

Description

This function creates an object of class "CLPD", by which a deterministic program is defined.

Usage

1
LPD(obj, A, dir, rhs, bounds = NULL, max = FALSE)

Arguments

obj

vector: Coefficients in objective function.

A

matrix: The lhs-matrix of the constraints.

dir

vector: The relational operators in the constraints. Allowed are "<=", "==" or ">=".

rhs

vector: The rhs-values of the constraints.

bounds

NULL or list: The lower and upper bounds of the variables. If left NULL, the default values of zero and infinity are used, otherwise a list-object as expected in Rglpk_solve_LP() must be provided.

max

logical: Whether the objective should be minimized (the default) or maximized.

Value

An object of S4-class "CLPD".

Author(s)

Bernhard Pfaff

References

Birge, J. R. and Louveaux, F., Introduction to Stochastic Programming, Springer Series in Operations Research and Financial Engineering, Second Edition, 2004, New York: Springer.

See Also

CLPD

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##
## Birge & Louveaux
## Chapter 5, Section 1a, master-problem
##
obj <- c(100, 150)
A <- matrix(c(1, 1,
              1, 0,
              0, 1),
            ncol = 2, nrow = 3, byrow = TRUE)
dir <- c("<=", ">=", ">=")
rhs <- c(120, 40, 20)
MLP <- LPD(obj, A, dir, rhs)
MLP

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.