Learn R Programming

lineqGPR (version 0.1.1)

bounds2lineqSys: Linear Systems of Inequalities

Description

Build the linear system of inequalities given specific bounds.

Usage

bounds2lineqSys(
  d = nrow(A),
  l = 0,
  u = 1,
  A = diag(d),
  lineqSysType = "twosides",
  rmInf = TRUE
)

Arguments

d

the number of linear inequality constraints.

l

the value (or vector) with the lower bound.

u

the value (or vector) with the upper bound.

A

a matrix containing the structure of the linear equations.

lineqSysType

a character string corresponding to the type of the linear system. Options: twosides, oneside. - twosides : Linear system given by $$\boldsymbol{l} \leq \boldsymbol{A x} \leq \boldsymbol{u}.$$

- oneside : Extended linear system given by $$\boldsymbol{M x} + \boldsymbol{g} \geq \boldsymbol{0} \quad \mbox{with} \quad \boldsymbol{M} = [\boldsymbol{A}, -\boldsymbol{A}]^\top \quad \mbox{and} \quad \boldsymbol{g} = [-\boldsymbol{l}, \boldsymbol{u}]^\top.$$

rmInf

If TRUE, inactive constraints are removed (e.g. \(-\infty \leq x \leq \infty\)).

Value

A list with the linear system of inequalities: list(A,l,u) (twosides) or list(M,g) (oneside).

Examples

Run this code
# NOT RUN {
n <- 5
A <- diag(n)
l <- rep(0, n)
u <- c(Inf, rep(1, n-1))
bounds2lineqSys(n, l, u, A, lineqSysType = "twosides")
bounds2lineqSys(n, l, u, A, lineqSysType = "oneside", rmInf = FALSE)
bounds2lineqSys(n, l, u, A, lineqSysType = "oneside", rmInf = TRUE)

# }

Run the code above in your browser using DataLab