Package uk.ac.starlink.table.join
Class CuboidCoverage
java.lang.Object
uk.ac.starlink.table.join.CuboidCoverage
- All Implemented Interfaces:
Coverage
Partial coverage implementation representing an N-dimensional hypercuboid.
It is suitable for representing simple contiguous regions in
N-dimensional Cartesian space.
Factory methods are provided for concrete instances of this class.
- Since:
- 8 Jun 2022
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Defines mapping of tuple to error value.static interface
Defines mapping of tuple to Cartesian position. -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvides a short, human-readable indication of the coverage.static CuboidCoverage.PointDecoder
createCartesianPointDecoder
(int ndim) Returns a PointDecoder for simple Cartesian tuples.static CuboidCoverage
createFixedCartesianCoverage
(int ndim, double err) Creates a coverage suitable for a fixed isotropic match error in an N-dimensional Cartesian space, where tuples are simple N-dimensional coordinate vectors.static CuboidCoverage
createFixedCartesianCoverage
(int ndim, double[] errs) Creates a coverage suitable for a fixed anisotropic match error in an N-dimensional Cartesian space, where tuples are simple N-dimensional coordinate vectors.static CuboidCoverage
createFixedErrorCoverage
(int ndim, double[] errors, CuboidCoverage.PointDecoder pointDecoder) Creates a coverage suitable for a fixed anisotropic match error in an N-dimensional coordinate space, with custom tuple->coordinate mapping.static CuboidCoverage
createVariableErrorCoverage
(int ndim, CuboidCoverage.PointDecoder pointDecoder, CuboidCoverage.ErrorDecoder errorDecoder) Creates a coverage suitable for variable isotropic match errors in an N-dimensional coordinate space.void
intersection
(Coverage other) Narrows this coverage object to contain only the intersection of its current state and the supplied coverage.boolean
isEmpty()
Returns true if the coverage represents the empty set.void
Modifies the state of this coverage object as if all the tuples fed to the other had been fed to this one as well as its current contents.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.ac.starlink.table.join.Coverage
createTestFactory, extend
-
Constructor Details
-
CuboidCoverage
protected CuboidCoverage(int ndim) Constructor. Instance is empty on construction.- Parameters:
ndim
- dimensionality of region
-
-
Method Details
-
isEmpty
public boolean isEmpty()Description copied from interface:Coverage
Returns true if the coverage represents the empty set.- Specified by:
isEmpty
in interfaceCoverage
- Returns:
- true iff the
Coverage.createTestFactory()
test is guaranteed to return false
-
union
Description copied from interface:Coverage
Modifies the state of this coverage object as if all the tuples fed to the other had been fed to this one as well as its current contents. -
intersection
Description copied from interface:Coverage
Narrows this coverage object to contain only the intersection of its current state and the supplied coverage.- Specified by:
intersection
in interfaceCoverage
- Parameters:
other
- different coverage object of a type assumed compatible with this object
-
coverageText
Description copied from interface:Coverage
Provides a short, human-readable indication of the coverage.- Specified by:
coverageText
in interfaceCoverage
- Returns:
- string representation
-
createFixedCartesianCoverage
Creates a coverage suitable for a fixed isotropic match error in an N-dimensional Cartesian space, where tuples are simple N-dimensional coordinate vectors.- Parameters:
ndim
- dimensionalityerr
- maximum separation for match- Returns:
- new empty coverage
-
createFixedCartesianCoverage
Creates a coverage suitable for a fixed anisotropic match error in an N-dimensional Cartesian space, where tuples are simple N-dimensional coordinate vectors.- Parameters:
ndim
- dimensionalityerrs
- ndim-dimensional array giving maximum separations along each axis- Returns:
- new empty coverage
-
createFixedErrorCoverage
public static CuboidCoverage createFixedErrorCoverage(int ndim, double[] errors, CuboidCoverage.PointDecoder pointDecoder) Creates a coverage suitable for a fixed anisotropic match error in an N-dimensional coordinate space, with custom tuple->coordinate mapping.- Parameters:
ndim
- dimensionality of Cartesian spaceerrors
- ndim-dimensional array giving maximum separations along each axispointDecoder
- thread-safe converter of tuples into N-dimensional Cartesian position vectors- Returns:
- new empty coverage
-
createVariableErrorCoverage
public static CuboidCoverage createVariableErrorCoverage(int ndim, CuboidCoverage.PointDecoder pointDecoder, CuboidCoverage.ErrorDecoder errorDecoder) Creates a coverage suitable for variable isotropic match errors in an N-dimensional coordinate space.- Parameters:
ndim
- dimensionality of Cartesian spacepointDecoder
- thread-safe converter of tuples into N-dimensional Cartesian position vectorserrorDecoder
- thread-safe extractor of isotropic maximum match separation from tuples- Returns:
- new empty coverage
-
createCartesianPointDecoder
Returns a PointDecoder for simple Cartesian tuples.- Parameters:
ndim
- dimensionality of tuples and output vectors- Returns:
- new point decoder
-