min

Returns the minimum/supremum point or convex hull of the intervals. Both minimum and supremum are undefined for empty regions but the convex hull is not.

  1. auto min(R region)
    min
    (
    R
    )
    ()
    if (
    is(R : Region!Args,
    Args...
    )
    )
  2. auto sup(R region)
  3. auto convexHull(R region)

Throws

MismatchingTagsException if tags differ. EmptyRegionException if region is empty.

Examples

1 alias R = Region!(int, int);
2 alias TI = R.TaggedInterval;
3 
4 R emptyRegion;
5 auto region1 = R([TI(0, 0, 10), TI(0, 20, 30)]);
6 auto region2 = R([TI(0, 0, 10), TI(1, 0, 10)]);
7 
8 assert(min(region1) == 0);
9 assert(sup(region1) == 30);
10 assertThrown!EmptyRegionException(min(emptyRegion));
11 assertThrown!EmptyRegionException(sup(emptyRegion));
12 assertThrown!(MismatchingTagsException!int)(min(region2));
13 assertThrown!(MismatchingTagsException!int)(sup(region2));

Meta