Class ExponentialTransform1D
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
org.apache.sis.referencing.operation.transform.ExponentialTransform1D
- All Implemented Interfaces:
Serializable,Parameterized,LenientComparable,org.opengis.referencing.operation.MathTransform,org.opengis.referencing.operation.MathTransform1D
A one dimensional exponential transform.
Input values x are converted into output values y using the following equation:
y = scale⋅basex
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:
Serialization
Serialized instances of this class 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.- Since:
- 0.5
- Version:
- 0.5
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
AbstractMathTransform1D.Inverse -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final doubleThe base to be raised to a power.private org.opengis.referencing.operation.MathTransform1DThe inverse of this transform.(package private) final doubleNatural logarithm ofbase, used forderivative(double)computation.(package private) final doubleThe scale value to be multiplied.private static final longSerial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExponentialTransform1D(double base, double scale) Constructs a new exponential transform.(package private)Constructs a new exponential transform which is the inverse of the supplied logarithmic transform. -
Method Summary
Modifier and TypeMethodDescriptionprotected intComputes a hash value for this transform.(package private) final org.opengis.referencing.operation.MathTransformconcatenateLog(LogarithmicTransform1D other, boolean applyOtherFirst) static org.opengis.referencing.operation.MathTransform1Dcreate(double base, double scale) Constructs a new exponential transform which include the given scale factor applied after the exponentiation.doublederivative(double value) Gets the derivative of this function at a value.booleanequals(Object object, ComparisonMode mode) Compares the specified object with this math transform for equality.org.opengis.referencing.operation.MathTransform1Dinverse()Returns the inverse of this transform.doubletransform(double value) Transforms the specified value.voidtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.voidtransform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.voidtransform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.voidtransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.protected org.opengis.referencing.operation.MathTransformtryConcatenate(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform other, org.opengis.referencing.operation.MathTransformFactory factory) Concatenates in an optimized way aMathTransformotherto thisMathTransform.Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
derivative, getSourceDimensions, getTargetDimensions, transformMethods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
beforeFormat, equals, formatTo, getContextualParameters, getDomain, getParameterDescriptors, getParameterValues, hashCode, isIdentity, isInverseEquals, mismatchedDimension, transformMethods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKTMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opengis.referencing.operation.MathTransform
isIdentity, toWKT, transform
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
base
final double baseThe base to be raised to a power. -
lnBase
final double lnBaseNatural logarithm ofbase, used forderivative(double)computation. -
scale
final double scaleThe scale value to be multiplied.The scale could be handled by a concatenation withLinearTransform1Dinstead of 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. -
inverse
private org.opengis.referencing.operation.MathTransform1D inverseThe inverse of this transform. Created only when first needed. Serialized in order to avoid rounding error if this transform is actually the one which was created from the inverse.
-
-
Constructor Details
-
ExponentialTransform1D
ExponentialTransform1D(LogarithmicTransform1D inverse) Constructs a new exponential transform which is the inverse of the supplied logarithmic transform. -
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 Details
-
create
public static org.opengis.referencing.operation.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.
-
inverse
public org.opengis.referencing.operation.MathTransform1D inverse()Returns the inverse of this transform.- Specified by:
inversein interfaceorg.opengis.referencing.operation.MathTransform- Specified by:
inversein interfaceorg.opengis.referencing.operation.MathTransform1D- Overrides:
inversein classAbstractMathTransform1D
-
derivative
public double derivative(double value) Gets the derivative of this function at a value.- Specified by:
derivativein interfaceorg.opengis.referencing.operation.MathTransform1D- Specified by:
derivativein classAbstractMathTransform1D- Parameters:
value- the value where to evaluate the derivative.- Returns:
- the derivative at the specified point.
-
transform
public double transform(double value) Transforms the specified value.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform1D- Specified by:
transformin classAbstractMathTransform1D- Parameters:
value- the value to transform.- Returns:
- the transformed value.
-
transform
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classAbstractMathTransform- 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 thansrcPts.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 positions in a list of coordinate values.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classAbstractMathTransform- 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 thansrcPts.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 positions in a list of coordinate values.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classAbstractMathTransform- 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 positions in a list of coordinate values.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classAbstractMathTransform- 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.
-
tryConcatenate
protected org.opengis.referencing.operation.MathTransform tryConcatenate(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform other, org.opengis.referencing.operation.MathTransformFactory factory) throws org.opengis.util.FactoryException Concatenates in an optimized way aMathTransformotherto thisMathTransform. This implementation can optimize some concatenation withLinearTransform1DandLogarithmicTransform1D.- Overrides:
tryConcatenatein classAbstractMathTransform- Parameters:
applyOtherFirst-trueif the transformation order isotherfollowed bythis, orfalseif the transformation order isthisfollowed byother.other- the other math transform to (pre-)concatenate with this transform.factory- the factory which is (indirectly) invoking this method, ornullif none.- Returns:
- the combined math transform, or
nullif no optimized combined transform is available. - Throws:
org.opengis.util.FactoryException- if an error occurred while combining the transforms.- See Also:
-
concatenateLog
final org.opengis.referencing.operation.MathTransform concatenateLog(LogarithmicTransform1D other, boolean applyOtherFirst) - Parameters:
other- the math transform to apply.applyOtherFirst-trueif the transformation order isotherfollowed bythis, orfalseif the transformation order isthisfollowed byother.- Returns:
- the combined math transform, or
nullif no optimized combined transform is available.
-
computeHashCode
protected int computeHashCode()Computes a hash value for this transform. This method is invoked byAbstractMathTransform.hashCode()when first needed.- Overrides:
computeHashCodein classAbstractMathTransform- Returns:
- the hash code value. This value may change between different execution of the Apache SIS library.
-
equals
Compares the specified object with this math transform for equality.- Specified by:
equalsin interfaceLenientComparable- Overrides:
equalsin classAbstractMathTransform- Parameters:
object- the object to compare with this transform.mode- the strictness level of the comparison. Default toSTRICT.- Returns:
trueif the given object is considered equals to this math transform.- See Also:
-