Skip to contents

The set {theta : a %*% theta <= b}, with eq flagging equality rows (e.g. sum(theta) == 1). The rows are kept as the region's facets; the generators are derived exactly.

Usage

h_region(a, b, eq = FALSE)

Arguments

a

(m, d) numeric matrix of facet normals, one constraint per row.

b

Numeric right-hand side, length m.

eq

Logical, length m or recycled; TRUE marks an equality row.

Examples

# The unit square in R^2:
h_region(a = rbind(diag(2), -diag(2)), b = c(1, 1, 0, 0))
#> <polyhedron_region>
#>   4 vertices in R^2
#>   facets: 4 inequalities

# The halfspace `{theta_1 <= theta_2}`:
h_region(a = matrix(c(1, -1), nrow = 1), b = 0)
#> <polyhedron_region>
#>   1 vertex, 1 ray, 1 line in R^2, unbounded
#>   facets: 1 inequality