A region is a subset of \(\mathbb{R}^d\) with convex geometry: a
null hypothesis, a family's parameter space, or a truncated prior's support.
Unlike a count_space, it can be charted, projected onto and combined with
the set algebra.
Details
region is abstract. A convex_region carries the geometry
(space_dim(), contains(), project(), chart()); a union_region is a
finite union of convex regions and need not be convex. Every region answers
parts() (the convex regions it was declared as) and cells() (the convex
regions the algorithms decompose it into); these differ once a region is
triangulated.
Examples
# Every convex_region is a region:
s <- simplex_region(vertices = diag(3))
S7::S7_inherits(s, region)
#> [1] TRUE
S7::S7_inherits(s, convex_region)
#> [1] TRUE
# A union of them is a region, but not a convex one:
u <- union_region(s, halfspace_region(normal = c(1, -1, 0)))
S7::S7_inherits(u, region)
#> [1] TRUE
S7::S7_inherits(u, convex_region)
#> [1] FALSE