Algorithm
Development Kit 1.0

algs.model
Interface IHypercube

All Known Implementing Classes:
Hypercube

public interface IHypercube

Represents a hypercube in the n-dimensional Cartesian plane. Note that it is an invariant that getLeft(d) <= getRight(d) for all dimensions d

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Method Summary
 boolean contains(IHypercube h)
          Determine if the hypercube wholly contains the given hypercube h.
 int dimensionality()
          return the dimensionality of this hypercube.
 double getLeft(int d)
          return the coordinate value for the left-side of the given dimension.
 double getRight(int d)
          return the coordinate value for the right-side of the given dimension.
 boolean intersects(double[] coords)
          Optimized version of intersects(IMultiPoint).
 boolean intersects(IHypercube h)
          Determine if the hypercube intersects the given hypercube h.
 boolean intersects(IMultiPoint p)
          Determine if the given point intersects the hypercube.
 

Method Detail

dimensionality

int dimensionality()
return the dimensionality of this hypercube.


getLeft

double getLeft(int d)
return the coordinate value for the left-side of the given dimension.

Parameters:
d - dimension value in the range 1 <= d <= dimensionality()

getRight

double getRight(int d)
return the coordinate value for the right-side of the given dimension.

Parameters:
d - dimension value in the range 1 <= d <= dimensionality()

intersects

boolean intersects(IMultiPoint p)
                   throws java.lang.IllegalArgumentException
Determine if the given point intersects the hypercube. The hypercube presents closed intervals on all dimensions.

Throws:
If - dimensions are not the same
java.lang.IllegalArgumentException

intersects

boolean intersects(double[] coords)
Optimized version of intersects(IMultiPoint).


intersects

boolean intersects(IHypercube h)
                   throws java.lang.IllegalArgumentException
Determine if the hypercube intersects the given hypercube h.

Parameters:
h - The target hypercube.
Throws:
If - dimensions are not the same
java.lang.IllegalArgumentException

contains

boolean contains(IHypercube h)
                 throws java.lang.IllegalArgumentException
Determine if the hypercube wholly contains the given hypercube h. The hypercube presents closed intervals on all dimensions.

Parameters:
h - The target hypercube.
Throws:
If - dimensions are not the same
java.lang.IllegalArgumentException

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.