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 interfaceDefines mapping of tuple to error value.static interfaceDefines 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.PointDecodercreateCartesianPointDecoder(int ndim) Returns a PointDecoder for simple Cartesian tuples.static CuboidCoveragecreateFixedCartesianCoverage(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 CuboidCoveragecreateFixedCartesianCoverage(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 CuboidCoveragecreateFixedErrorCoverage(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 CuboidCoveragecreateVariableErrorCoverage(int ndim, CuboidCoverage.PointDecoder pointDecoder, CuboidCoverage.ErrorDecoder errorDecoder) Creates a coverage suitable for variable isotropic match errors in an N-dimensional coordinate space.voidintersection(Coverage other) Narrows this coverage object to contain only the intersection of its current state and the supplied coverage.booleanisEmpty()Returns true if the coverage represents the empty set.voidModifies 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, waitMethods 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:CoverageReturns true if the coverage represents the empty set.- Specified by:
isEmptyin interfaceCoverage- Returns:
- true iff the
Coverage.createTestFactory()test is guaranteed to return false
-
union
Description copied from interface:CoverageModifies 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:CoverageNarrows this coverage object to contain only the intersection of its current state and the supplied coverage.- Specified by:
intersectionin interfaceCoverage- Parameters:
other- different coverage object of a type assumed compatible with this object
-
coverageText
Description copied from interface:CoverageProvides a short, human-readable indication of the coverage.- Specified by:
coverageTextin 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
-