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.
The simplest way to implement this abstract class is to provide an implementation for the following methods only:
Immutability and thread safetyAll Apache SIS implementations of
MathTransform1Dare 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,
MathTransform1Dinstances can be shared by many objects and passed between threads without synchronization.
MathTransform1Dmay 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
Nested Class SummaryModifier and TypeClassDescription
protected static classBase class for implementation of inverse math transforms.
protectedConstructor for subclasses.
Method SummaryModifier and TypeMethodDescription
(double value)Gets the derivative of this function at a value.Gets the derivative of this transform at a point.
final intReturns the dimension of input points, which is always 1.
final intReturns the dimension of output points, which is always 1.
inverse()Returns the inverse transform of this object.
(double value)Transforms the specified value.
(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, equals, equals, formatTo, getContextualParameters, getParameterDescriptors, getParameterValues, hashCode, isIdentity, transform, transform, transform, transform, transform, tryConcatenate
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
AbstractMathTransform1Dprotected AbstractMathTransform1D()Constructor for subclasses.
getSourceDimensionspublic final int getSourceDimensions()Returns the dimension of input points, which is always 1.
getTargetDimensionspublic final int getTargetDimensions()Returns the dimension of output points, which is always 1.
transformpublic abstract double transform
(double value) throws TransformExceptionTransforms the specified value.
transformpublic Matrix transform
(double srcPts, int srcOff, double dstPts, int dstOff, boolean derivate) throws TransformExceptionTransforms a single point in the given array and opportunistically computes its derivative if requested. The default implementation delegates to
transform(double)and potentially to
derivative(double). Subclasses may override this method for performance reason.
- Specified by:
srcPts- the array containing the source coordinate (can not be
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
nullif only the derivative matrix is desired.
dstOff- the offset to the location of the transformed point that is stored in the destination array.
truefor computing the derivative, or
falseif not needed.
- the matrix of the transform derivative at the given source position,
TransformException- if the point can not be transformed or if a problem occurred while calculating the derivative.
- See Also:
derivativepublic abstract double derivative
(double value) throws TransformExceptionGets the derivative of this function at a value. The derivative is the 1×1 matrix of the non-translating portion of the approximate affine map at the value.
derivativeGets the derivative of this transform at a point. The default implementation ensures that
pointis one-dimensional, then delegates to
- Specified by:
point- the coordinate point where to evaluate the derivative, or
- the derivative at the specified point (never
pointdoes not have the expected dimension.
TransformException- if the derivative can not be evaluated at the specified point.
inverseReturns the inverse transform of this object. The default implementation returns
thisif this transform is an identity transform, or throws an exception otherwise. Subclasses should override this method.