Package uk.ac.starlink.table.join
Class CuboidCoverage
- java.lang.Object
-
- uk.ac.starlink.table.join.CuboidCoverage
-
- All Implemented Interfaces:
Coverage
public abstract class CuboidCoverage extends java.lang.Object implements 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 Classes Modifier and Type Class Description static interface
CuboidCoverage.ErrorDecoder
Defines mapping of tuple to error value.static interface
CuboidCoverage.PointDecoder
Defines mapping of tuple to Cartesian position.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CuboidCoverage(int ndim)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
coverageText()
Provides 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
union(Coverage other)
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
-
-
-
-
Method Detail
-
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
public void union(Coverage other)
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
public void intersection(Coverage other)
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
public java.lang.String coverageText()
Description copied from interface:Coverage
Provides a short, human-readable indication of the coverage.- Specified by:
coverageText
in interfaceCoverage
- Returns:
- string representation
-
createFixedCartesianCoverage
public 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.- Parameters:
ndim
- dimensionalityerr
- maximum separation for match- Returns:
- new empty coverage
-
createFixedCartesianCoverage
public 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.- 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
public static CuboidCoverage.PointDecoder createCartesianPointDecoder(int ndim)
Returns a PointDecoder for simple Cartesian tuples.- Parameters:
ndim
- dimensionality of tuples and output vectors- Returns:
- new point decoder
-
-