Learn R Programming

rcdd (version 1.1-4)

makeH: make H-representation of convex polyhedron

Description

Construct H-representation of convex polyhedron, set of points x satisfying a1 %*% x <= b1="" a2="" %*%="" x="=" b2="" see="" scdd for description of valid representations.

Usage

makeH(a1, b1, a2, b2, x = NULL)
addHeq(a, b, x)
addHin(a, b, x)

Arguments

a1
numerical matrix for inequality constraints. If vector, treated as matrix with one row.
b1
numerical right hand side vector for inequality constraints.
a2
numerical matrix for equality constraints. If vector, treated as matrix with one row.
b2
numerical right hand side vector for equality constraints.
x
if not NULL, a valid H-representation.
a
numerical matrix for constraints. If vector, treated as matrix with one row. Constraints are equality in addHeq and inequality in addHin.
b
numerical right hand side vector for constraints.

Value

  • a cdd object that can be handed to scdd.

See Also

scdd, validcdd

Examples

Run this code
d <- 4
# unit simplex in H-representation
qux <- makeH(- diag(d), rep(0, d), rep(1, d), 1)
print(qux)
# add an inequality constraint
qux <- addHin(c(1, -1, 0, 0), 0, qux)
print(qux)
# drop a constraint
qux <- qux[- 3, ]
print(qux)

Run the code above in your browser using DataLab