org.geotoolkit.referencing.operation.transform
Class AbstractMathTransform1D
Object
FormattableObject
AbstractMathTransform
AbstractMathTransform1D
- All Implemented Interfaces:
- Formattable, Parameterized, LenientComparable, MathTransform, MathTransform1D
- Direct Known Subclasses:
- ExponentialTransform1D, LinearTransform1D, LogarithmicTransform1D
@ThreadSafe
public abstract class AbstractMathTransform1D
- extends AbstractMathTransform
- implements MathTransform1D
Base class for math transforms that are known to be one-dimensional in all cases.
One-dimensional math transforms are not required to extend this
class, however doing so may simplify their implementation.
- Since:
- 3.17
- Version:
- 3.20
- Author:
- Martin Desruisseaux (Geomatys)
- Module:
|
Method Summary |
Matrix |
derivative(DirectPosition point)
Gets the derivative of this transform at a point. |
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. |
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. |
| Methods inherited from class AbstractMathTransform |
computeHashCode, createTransformedShape, derivative, ensureNonNull, equals, equals, formatWKT, getName, getParameterDescriptors, getParameterValues, hashCode, isIdentity, rollLongitude, transform, transform, transform, transform, transform, transform |
AbstractMathTransform1D
protected AbstractMathTransform1D()
- Constructs a default math transform.
getSourceDimensions
public final int getSourceDimensions()
- Returns the dimension of input points, which is always 1.
- Specified by:
getSourceDimensions in interface MathTransform- Specified by:
getSourceDimensions in class AbstractMathTransform
getTargetDimensions
public final int getTargetDimensions()
- Returns the dimension of output points, which is always 1.
- Specified by:
getTargetDimensions in interface MathTransform- Specified by:
getTargetDimensions in class AbstractMathTransform
transform
public Matrix transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
boolean derivate)
throws TransformException
- Transforms a single point in the given array and opportunistically computes its derivative
if requested. The default implementation delegates to
MathTransform1D.transform(double) and
potentially to MathTransform1D.derivative(double). Subclasses may override this method for
performance reason.
- Specified by:
transform in class AbstractMathTransform
- Parameters:
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.
- Returns:
- The matrix of the transform derivative at the given source position, or
null
if the derivate argument is false.
- Throws:
TransformException - If the point can't be transformed or if a problem occurred while
calculating the derivative.- Since:
- 3.20 (derived from 3.00)
- See Also:
AbstractMathTransform.derivative(DirectPosition),
AbstractMathTransform.transform(DirectPosition, DirectPosition),
MathTransforms.derivativeAndTransform(MathTransform, double[], int, double[], int)
derivative
public Matrix derivative(DirectPosition point)
throws TransformException
- Gets the derivative of this transform at a point. The default implementation ensures that
point is one-dimensional, then delegates to MathTransform1D.derivative(double).
- Specified by:
derivative in interface MathTransform- Overrides:
derivative in class AbstractMathTransform
- Parameters:
point - The coordinate point where to evaluate the derivative, or null.
- Returns:
- The derivative at the specified point (never
null).
- Throws:
MismatchedDimensionException - if point doesn't have the expected dimension.
TransformException - if the derivative can't be evaluated at the specified point.
inverse
public MathTransform1D inverse()
throws NoninvertibleTransformException
- Returns the inverse transform of this object. The default implementation
returns
this if this transform is an identity transform, and throws
a NoninvertibleTransformException otherwise. Subclasses should override
this method.
- Specified by:
inverse in interface MathTransform- Specified by:
inverse in interface MathTransform1D- Overrides:
inverse in class AbstractMathTransform
- Throws:
NoninvertibleTransformException
Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.