Class LinearInterpolator1D.Inverse
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.AbstractMathTransform.Inverse
org.apache.sis.referencing.operation.transform.AbstractMathTransform1D.Inverse
org.apache.sis.referencing.operation.transform.LinearInterpolator1D.Inverse
- All Implemented Interfaces:
Serializable
,Parameterized
,LenientComparable
,org.opengis.referencing.operation.MathTransform
,org.opengis.referencing.operation.MathTransform1D
- Enclosing class:
LinearInterpolator1D
private static final class LinearInterpolator1D.Inverse
extends AbstractMathTransform1D.Inverse
implements org.opengis.referencing.operation.MathTransform1D, Serializable
The inverse of the enclosing
LinearInterpolator1D
. Given a y value, this class performs
a bilinear search for locating the lower and upper x values as integers, then interpolates the
x real value.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
AbstractMathTransform.Inverse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LinearInterpolator1D
The enclosing transform.private static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
derivative
(double y) Returns the derivative at the given y value.org.opengis.referencing.operation.MathTransform1D
inverse()
Returns the inverse of this math transform.double
transform
(double y) Locates by bilinear search and interpolates the x value for the given y.org.opengis.referencing.operation.Matrix
transform
(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) Combinestransform(double)
,derivative(double)
in a single method call.Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform1D.Inverse
derivative
Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform.Inverse
beforeFormat, computeHashCode, equals, formatTo, getDomain, getSourceDimensions, getTargetDimensions, isIdentity
Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
equals, getContextualParameters, getParameterDescriptors, getParameterValues, hashCode, isInverseEquals, mismatchedDimension, transform, transform, transform, transform, transform, tryConcatenate
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.operation.MathTransform
derivative, getSourceDimensions, getTargetDimensions, isIdentity, toWKT, transform, transform, transform, transform, transform
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
forward
The enclosing transform.
-
-
Constructor Details
-
Inverse
Inverse(LinearInterpolator1D forward) Creates a new inverse transform.
-
-
Method Details
-
inverse
public org.opengis.referencing.operation.MathTransform1D inverse()Returns the inverse of this math transform.- Specified by:
inverse
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
inverse
in interfaceorg.opengis.referencing.operation.MathTransform1D
- Specified by:
inverse
in classAbstractMathTransform1D.Inverse
- Returns:
- the inverse of this transform.
-
transform
public org.opengis.referencing.operation.Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws org.opengis.referencing.operation.TransformException Combinestransform(double)
,derivative(double)
in a single method call. The intent is to avoid to callArrays.binarySearch(double[], double)
twice for the same value.- Overrides:
transform
in classAbstractMathTransform1D.Inverse
- Parameters:
srcPts
- the array containing the source coordinates (cannot benull
).srcOff
- the offset to the point to be transformed in the source array.dstPts
- the array into which the transformed coordinates is returned. May be the same thansrcPts
. May benull
if only the derivative matrix is desired.dstOff
- the offset to the location of the transformed point that is stored in the destination array.derivate
-true
for computing the derivative, orfalse
if not needed.- Returns:
- the matrix of the transform derivative at the given source position,
or
null
if thederivate
argument isfalse
. - Throws:
org.opengis.referencing.operation.TransformException
- if the point cannot be transformed or if a problem occurred while calculating the derivative.- See Also:
-
transform
public double transform(double y) Locates by bilinear search and interpolates the x value for the given y.- Specified by:
transform
in interfaceorg.opengis.referencing.operation.MathTransform1D
-
derivative
public double derivative(double y) Returns the derivative at the given y value.- Specified by:
derivative
in interfaceorg.opengis.referencing.operation.MathTransform1D
-