org.geotoolkit.referencing.operation.transform
Class ExponentialTransform1D

Object
  extended by FormattableObject
      extended by AbstractMathTransform
          extended by AbstractMathTransform1D
              extended by ExponentialTransform1D
All Implemented Interfaces:
Serializable, Formattable, Parameterized, LenientComparable, MathTransform, MathTransform1D

@Immutable
public class ExponentialTransform1D
extends AbstractMathTransform1D
implements Serializable

A one dimensional exponential transform. Input values x are converted into output values y using the following equation:

y  =  scale · basex
See any of the following providers for a list of programmatic parameters:

Tip: If a linear transform is applied before this exponential transform, then the equation can be rewritten as:

scale · basea + b·x  =  scale · basea · (baseb)x
It is possible to find back the coefficients of the original linear transform by pre-concatenating a logarithmic transform before the exponential one, as below:
LinearTransform1D linear = (LinearTransform1D) ConcatenatedTransform.create(exponentialTransform,
        LogarithmicTransform1D.create(base, -Math.log(scale) / Math.log(base)));

Since:
2.0
Version:
3.18
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
LogarithmicTransform1D, LinearTransform1D, Serialized Form
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
 double base
          The base to be raised to a power.
 double scale
          The scale value to be multiplied.
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Constructor Summary
protected ExponentialTransform1D(double base, double scale)
          Constructs a new exponential transform.
 
Method Summary
protected  int computeHashCode()
          Computes a hash value for this transform.
static MathTransform1D create(double base)
          Constructs a new exponential transform with no scale.
static MathTransform1D create(double base, double scale)
          Constructs a new exponential transform which include the given scale factor applied after the exponentiation.
 double derivative(double value)
          Gets the derivative of this function at a value.
 boolean equals(Object object, ComparisonMode mode)
          Compares the specified object with this math transform for equality.
 ParameterDescriptorGroup getParameterDescriptors()
          Returns the parameter descriptors for this math transform.
 ParameterValueGroup getParameterValues()
          Returns the parameter values for this math transform.
 MathTransform1D inverse()
          Creates the inverse transform of this object.
 double transform(double value)
          Transforms the specified value.
protected  void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff)
          Transforms a single coordinate in a list of ordinal values.
 void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms many coordinates in a list of ordinal values.
 void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms many coordinates in a list of ordinal values.
 void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms many coordinates in a list of ordinal values.
 void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms many coordinates in a list of ordinal values.
 
Methods inherited from class AbstractMathTransform1D
derivative, getSourceDimensions, getTargetDimensions
 
Methods inherited from class AbstractMathTransform
createTransformedShape, derivative, ensureNonNull, equals, formatWKT, getName, hashCode, isIdentity, rollLongitude, 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 MathTransform
isIdentity, toWKT, transform
 

Field Detail

base

public final double base
The base to be raised to a power.


scale

public final double scale
The scale value to be multiplied.
Note: The scale could be handled by a concatenation with LinearTransform1D instead than an explicit field in this class. However the scale · basex formula is extensively used as a transfer function in grid coverages. Consequently we keep this explicit field for performance reasons.

Constructor Detail

ExponentialTransform1D

protected ExponentialTransform1D(double base,
                                 double scale)
Constructs a new exponential transform. This constructor is provided for subclasses only. Instances should be created using the factory method, which may returns optimized implementations for some particular argument values.

Parameters:
base - The base to be raised to a power.
scale - The scale value to be multiplied.
Method Detail

create

public static MathTransform1D create(double base)
Constructs a new exponential transform with no scale.

Parameters:
base - The base to be raised to a power.
Returns:
The math transform.
Since:
3.17

create

public static MathTransform1D create(double base,
                                     double scale)
Constructs a new exponential transform which include the given scale factor applied after the exponentiation.

Parameters:
base - The base to be raised to a power.
scale - The scale value to be multiplied.
Returns:
The math transform.

getParameterDescriptors

public ParameterDescriptorGroup getParameterDescriptors()
Returns the parameter descriptors for this math transform.

Specified by:
getParameterDescriptors in interface Parameterized
Overrides:
getParameterDescriptors in class AbstractMathTransform
Returns:
The parameter descriptors for this math transform, or null.
See Also:
OperationMethod.getParameters()

getParameterValues

public ParameterValueGroup getParameterValues()
Returns the parameter values for this math transform.

Specified by:
getParameterValues in interface Parameterized
Overrides:
getParameterValues in class AbstractMathTransform
Returns:
A copy of the parameter values for this math transform.
See Also:
SingleOperation.getParameterValues()

inverse

public MathTransform1D inverse()
Creates the inverse transform of this object.

Specified by:
inverse in interface MathTransform
Specified by:
inverse in interface MathTransform1D
Overrides:
inverse in class AbstractMathTransform1D

derivative

public double derivative(double value)
Gets the derivative of this function at a value.

Specified by:
derivative in interface MathTransform1D

transform

public double transform(double value)
Transforms the specified value.

Specified by:
transform in interface MathTransform1D

transform

protected void transform(double[] srcPts,
                         int srcOff,
                         double[] dstPts,
                         int dstOff)
Transforms a single coordinate in a list of ordinal values.

Overrides:
transform in class AbstractMathTransform1D
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.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms many coordinates in a list of ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Parameters:
srcPts - The array containing the source point coordinates.
srcOff - The offset to the first point to be transformed in the source array.
dstPts - The array into which the transformed point coordinates are returned. May be the same than srcPts.
dstOff - The offset to the location of the first transformed point that is stored in the destination array.
numPts - The number of point objects to be transformed.

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms many coordinates in a list of ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Parameters:
srcPts - The array containing the source point coordinates.
srcOff - The offset to the first point to be transformed in the source array.
dstPts - The array into which the transformed point coordinates are returned. May be the same than srcPts.
dstOff - The offset to the location of the first transformed point that is stored in the destination array.
numPts - The number of point objects to be transformed.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms many coordinates in a list of ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Parameters:
srcPts - The array containing the source point coordinates.
srcOff - The offset to the first point to be transformed in the source array.
dstPts - The array into which the transformed point coordinates are returned.
dstOff - The offset to the location of the first transformed point that is stored in the destination array.
numPts - The number of point objects to be transformed.

transform

public void transform(float[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms many coordinates in a list of ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Parameters:
srcPts - The array containing the source point coordinates.
srcOff - The offset to the first point to be transformed in the source array.
dstPts - The array into which the transformed point coordinates are returned.
dstOff - The offset to the location of the first transformed point that is stored in the destination array.
numPts - The number of point objects to be transformed.

computeHashCode

protected int computeHashCode()
Computes a hash value for this transform. This method is invoked by AbstractMathTransform.hashCode() when first needed.

Overrides:
computeHashCode in class AbstractMathTransform
Returns:
The hash code value. This value may change between different execution of the Geotk library.

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compares the specified object with this math transform for equality.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractMathTransform
Parameters:
object - The object to compare with this transform.
mode - The strictness level of the comparison. Default to STRICT.
Returns:
true if the given object is a transform of the same class and if, given identical source position, the transformed position would be the equals.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.