public abstract class AbstractMathTransform1D extends AbstractMathTransform implements MathTransform1D
The simplest way to implement this abstract class is to provide an implementation for the following methods only:
MathTransform1D
are immutable and thread-safe.
It is highly recommended that third-party implementations be immutable and thread-safe too.
This means that unless otherwise noted in the javadoc, MathTransform1D
instances can
be shared by many objects and passed between threads without synchronization.
MathTransform1D
may or may not be serializable, at implementation choices.
Most Apache SIS implementations are serializable, but the serialized objects are not guaranteed to be compatible
with future SIS versions. Serialization should be used only for short term storage or RMI between applications
running the same SIS version.Defined in the sis-referencing
module
AbstractMathTransform.Inverse
Modifier | Constructor and Description |
---|---|
protected |
AbstractMathTransform1D()
Constructor for subclasses.
|
Modifier and Type | Method and Description |
---|---|
Matrix |
derivative(DirectPosition point)
Gets the derivative of this transform at a point.
|
abstract double |
derivative(double value)
Gets the derivative of this function at a value.
|
int |
getSourceDimensions()
Returns the dimension of input points, which is always 1.
|
int |
getTargetDimensions()
Returns the dimension of output points, which is always 1.
|
MathTransform1D |
inverse()
Returns the inverse transform of this object.
|
abstract double |
transform(double value)
Transforms the specified value.
|
Matrix |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
boolean derivate)
Transforms a single point in the given array and opportunistically computes its derivative if requested.
|
computeHashCode, equals, equals, formatTo, getParameterDescriptors, getParameterValues, hashCode, isIdentity, transform, transform, transform, transform, transform
print, toString, toString, toWKT
isIdentity, toWKT, transform, transform, transform, transform, transform
protected AbstractMathTransform1D()
public final int getSourceDimensions()
getSourceDimensions
in interface MathTransform
getSourceDimensions
in class AbstractMathTransform
public final int getTargetDimensions()
getTargetDimensions
in interface MathTransform
getTargetDimensions
in class AbstractMathTransform
public abstract double transform(double value) throws TransformException
transform
in interface MathTransform1D
value
- The value to transform.TransformException
- if the value can not be transformed.public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws TransformException
transform(double)
and potentially to derivative(double)
.
Subclasses may override this method for performance reason.transform
in class AbstractMathTransform
srcPts
- The array containing the source coordinate (can not be null
).srcOff
- The offset to the point to be transformed in the source array.dstPts
- The array into which the transformed coordinate is returned. May be the same than srcPts
.
May be null
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, or false
if not needed.null
if the derivate
argument is false
.TransformException
- If the point can not be transformed or if a problem occurred while calculating the
derivative.AbstractMathTransform.derivative(DirectPosition)
,
AbstractMathTransform.transform(DirectPosition, DirectPosition)
,
MathTransforms.derivativeAndTransform(MathTransform, double[], int, double[], int)
public abstract double derivative(double value) throws TransformException
derivative
in interface MathTransform1D
value
- The value where to evaluate the derivative.TransformException
- if the derivative can not be evaluated at the specified point.public Matrix derivative(DirectPosition point) throws TransformException
point
is one-dimensional, then delegates to derivative(double)
.derivative
in interface MathTransform
derivative
in class AbstractMathTransform
point
- The coordinate point where to evaluate the derivative, or null
.null
).MismatchedDimensionException
- if point
does not have the expected dimension.TransformException
- if the derivative can not be evaluated at the specified point.public MathTransform1D inverse() throws NoninvertibleTransformException
this
if this transform is an identity transform,
or throws an exception otherwise. Subclasses should override this method.inverse
in interface MathTransform
inverse
in interface MathTransform1D
inverse
in class AbstractMathTransform
NoninvertibleTransformException
Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.