createBoundBox {hitandrun} | R Documentation |
Calculate a bounding box
Description
Calculate a bounding box around a polytope given by a set of linear constraints.
Usage
createBoundBox(constr, homogeneous=FALSE)
Arguments
constr |
Constraint definition |
homogeneous |
Whether constr is given in homogeneous coordinate representation |
Details
See har
for a description of the constraint definition and the homogeneous coordinate representation.
This function uses findExtremePoints
to find extreme points along each dimension.
Value
lb |
Lower bound for each dimension (not including homogeneous coordinate). |
ub |
Upper bound for each dimension (not including homogeneous coordinate). |
Author(s)
Gert van Valkenhoef
See Also
Examples
# constraints: x_1 >= 0, x_2 >= 0, x_1 + x_2 <= 1
A <- rbind(c(-1, 0), c(0, -1), c(1, 1))
b <- c(0, 0, 1)
d <- c("<=", "<=", "<=")
constr <- list(constr=A, rhs=b, dir=d)
bb <- createBoundBox(constr)
stopifnot(bb$lb == c(0.0, 0.0))
stopifnot(bb$ub == c(1.0, 1.0))
[Package hitandrun version 0.5-6 Index]