Class AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P extends Point<P>,S extends HyperplaneConvexSubset<P>>

java.lang.Object
org.apache.commons.geometry.core.partitioning.AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P,S>
Type Parameters:
P - Point implementation type
S - Hyperplane convex subset implementation type
Enclosing class:
AbstractConvexHyperplaneBoundedRegion<P extends Point<P>,S extends HyperplaneConvexSubset<P>>

protected static class AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P extends Point<P>,S extends HyperplaneConvexSubset<P>> extends Object
Internal class encapsulating the logic for building convex region boundaries from collections of hyperplanes.
  • Field Details

  • Constructor Details

    • ConvexRegionBoundaryBuilder

      public ConvexRegionBoundaryBuilder(Class<S> subsetType)
      Construct a new instance for building convex region boundaries with the given hyperplane convex subset implementation type.
      Parameters:
      subsetType - Hyperplane convex subset implementation type
  • Method Details

    • build

      public List<S> build(Iterable<? extends Hyperplane<P>> bounds)
      Compute a list of hyperplane convex subsets representing the boundaries of the convex region bounded by the given collection of hyperplanes.
      Parameters:
      bounds - hyperplanes defining the convex region
      Returns:
      a list of hyperplane convex subsets representing the boundaries of the convex region
      Throws:
      IllegalArgumentException - if the given hyperplanes do not form a convex region
    • splitBound

      private HyperplaneConvexSubset<P> splitBound(Hyperplane<P> currentBound, Iterable<? extends Hyperplane<P>> bounds, int currentBoundIdx)
      Split the given bounding hyperplane by all of the other hyperplanes in the given collection, returning the remaining hyperplane subset.
      Parameters:
      currentBound - the bound to split; this value is assumed to have come from bounds
      bounds - collection of bounds to use to split currentBound
      currentBoundIdx - the index of currentBound in bounds
      Returns:
      the part of currentBound's hyperplane subset that lies on the minus side of all of the splitting hyperplanes
      Throws:
      IllegalArgumentException - if the hyperplanes do not form a convex region
    • nonConvexException

      private IllegalArgumentException nonConvexException(Iterable<? extends Hyperplane<P>> bounds)
      Return an exception indicating that the given collection of hyperplanes do not produce a convex region.
      Parameters:
      bounds - collection of hyperplanes
      Returns:
      an exception indicating that the given collection of hyperplanes do not produce a convex region