org.geotoolkit.referencing.operation.transform
Class AbstractMathTransform1D

Object
  extended by FormattableObject
      extended by AbstractMathTransform
          extended by 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.18
Author:
Martin Desruisseaux (Geomatys)
Module:
referencing/geotk-referencing (download)    View source code for this class

Nested Class Summary
 
Nested classes/interfaces inherited from class AbstractMathTransform
AbstractMathTransform.Inverse
 
Field Summary
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Constructor Summary
protected AbstractMathTransform1D()
          Constructs a default math transform.
 
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.
protected  void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff)
          Transforms a single point in the given array.
 
Methods inherited from class AbstractMathTransform
computeHashCode, createTransformedShape, derivative, ensureNonNull, equals, equals, formatWKT, getName, getParameterDescriptors, getParameterValues, hashCode, isIdentity, rollLongitude, transform, transform, transform, transform, transform, transform
 
Methods inherited from class FormattableObject
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface MathTransform1D
derivative, transform
 
Methods inherited from interface MathTransform
isIdentity, toWKT, transform, transform, transform, transform, transform
 

Constructor Detail

AbstractMathTransform1D

protected AbstractMathTransform1D()
Constructs a default math transform.

Method Detail

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

protected void transform(double[] srcPts,
                         int srcOff,
                         double[] dstPts,
                         int dstOff)
                  throws TransformException
Transforms a single point in the given array. The default implementation delegates to MathTransform1D.transform(double). Subclasses may override this method for performance reason.

Specified by:
transform in class AbstractMathTransform
Parameters:
srcPts - The array containing the source point coordinates.
srcOff - The offset to the point to be transformed in the source array.
dstPts - the array into which the transformed point coordinate are returned. May be the same than srcPts.
dstOff - The offset to the location of the transformed point that is stored in the destination array.
Throws:
TransformException - If the point can't be transformed.

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-2011 Geotoolkit.org. All Rights Reserved.