Class LogarithmicTransform1D
Object
Formattable
AbstractMathTransform
LogarithmicTransform1D
- All Implemented Interfaces:
Serializable
,MathTransform
,MathTransform1D
public class LogarithmicTransform1D
extends AbstractMathTransform
implements MathTransform1D, Serializable
A one dimensional, logarithmic transform. Input values x are converted into output values y
using the following equation:
y = offset + logbase(x)
= offset + ln(x)/ln(base) This transform is the
inverse of ExponentialTransform1D
.
- Since:
- 2.0
- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractMathTransform
AbstractMathTransform.Inverse
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double
The base of the logarithm.final double
The offset to add to the logarithm.Fields inherited from class Formattable
SINGLE_LINE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LogarithmicTransform1D
(double base, double offset) Constructs a new logarithmic transform. -
Method Summary
Modifier and TypeMethodDescriptionstatic MathTransform1D
create
(double base, double offset) Constructs a new logarithmic transform.double
derivative
(double value) Gets the derivative of this function at a value.boolean
Compares the specified object with this math transform for equality.Returns the parameter descriptors for this math transform.Returns the parameter values for this math transform.int
Gets the dimension of input points, which is 1.int
Gets the dimension of output points, which is 1.int
hashCode()
Returns a hash value for this transform.inverse()
Creates the inverse transform of this object.double
transform
(double value) Transforms the specified value.void
transform
(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms a list of coordinate point ordinal values.void
transform
(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms a list of coordinate point ordinal values.Methods inherited from class AbstractMathTransform
createTransformedShape, derivative, derivative, ensureNonNull, formatWKT, getName, isIdentity, needCopy, normalizeAngle, rollLongitude, transform, transform, transform, transform
Methods inherited from class Formattable
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKT
Methods inherited from interface MathTransform
derivative, isIdentity, toWKT, transform, transform, transform
-
Field Details
-
base
public final double baseThe base of the logarithm. -
offset
public final double offsetThe offset to add to the logarithm.
-
-
Constructor Details
-
LogarithmicTransform1D
protected LogarithmicTransform1D(double base, double offset) Constructs a new logarithmic 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 of the logarithm (typically 10).offset
- The offset to add to the logarithm.
-
-
Method Details
-
create
Constructs a new logarithmic transform.- Parameters:
base
- The base of the logarithm (typically 10).offset
- The offset to add to the logarithm.- Returns:
- The math transform.
-
getParameterDescriptors
Returns the parameter descriptors for this math transform.- Overrides:
getParameterDescriptors
in classAbstractMathTransform
- Returns:
- The parameter descriptors for this math transform, or
null
. - See Also:
-
getParameterValues
Returns the parameter values for this math transform.- Overrides:
getParameterValues
in classAbstractMathTransform
- Returns:
- A copy of the parameter values for this math transform.
- See Also:
-
getSourceDimensions
public int getSourceDimensions()Gets the dimension of input points, which is 1.- Specified by:
getSourceDimensions
in interfaceMathTransform
- Specified by:
getSourceDimensions
in classAbstractMathTransform
- Returns:
- The dimension of input points.
-
getTargetDimensions
public int getTargetDimensions()Gets the dimension of output points, which is 1.- Specified by:
getTargetDimensions
in interfaceMathTransform
- Specified by:
getTargetDimensions
in classAbstractMathTransform
- Returns:
- The dimension of output points.
-
inverse
Creates the inverse transform of this object.- Specified by:
inverse
in interfaceMathTransform
- Specified by:
inverse
in interfaceMathTransform1D
- Overrides:
inverse
in classAbstractMathTransform
- Returns:
- The inverse transform.
-
derivative
public double derivative(double value) Gets the derivative of this function at a value.- Specified by:
derivative
in interfaceMathTransform1D
- 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:
transform
in interfaceMathTransform1D
- Parameters:
value
- The value to transform.- Returns:
- the transformed value.
-
transform
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms a list of coordinate point ordinal values.- Specified by:
transform
in interfaceMathTransform
- Overrides:
transform
in 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, double[] dstPts, int dstOff, int numPts) Transforms a list of coordinate point ordinal values.- Specified by:
transform
in interfaceMathTransform
- 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.
-
hashCode
public int hashCode()Returns a hash value for this transform. This value need not remain consistent between different implementations of the same class.- Overrides:
hashCode
in classAbstractMathTransform
-
equals
Compares the specified object with this math transform for equality.- Overrides:
equals
in classAbstractMathTransform
- Parameters:
object
- The object to compare with this transform.- 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.
-