Class LogarithmicTransform1D.Base10
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.LogarithmicTransform1D
org.apache.sis.referencing.operation.transform.LogarithmicTransform1D.Base10
- All Implemented Interfaces:
Serializable
,Parameterized
,LenientComparable
,org.opengis.referencing.operation.MathTransform
,org.opengis.referencing.operation.MathTransform1D
- Enclosing class:
LogarithmicTransform1D
Special case for base 10 taking advantage of extra precision provided by
Math.log10(double)
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.LogarithmicTransform1D
LogarithmicTransform1D.Base10
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
AbstractMathTransform1D.Inverse
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final LogarithmicTransform1D.Base10
Commonly used instance with no offset.private static final double
The natural logarithm of 10.private final double
The offset to add to the logarithm.private static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Base10
(double offset) Creates a new instance with the given offset. -
Method Summary
Modifier and TypeMethodDescription(package private) double
base()
Returns the base of this logarithmic function.protected int
Computes a hash value for this transform.create
(double offset) Creates a new instance with the given offset.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.(package private) double
lnBase()
Returns the natural logarithm of the base of this logarithmic function.(package private) double
log
(double value) Returns the logarithm of the given value in the base of this logarithmic transform.(package private) double
offset()
Returns the offset applied after this logarithmic function.(package private) double
pow
(double value) Returns the base of this logarithmic transform raised to the given power.double
transform
(double value) Transforms the specified value.void
transform
(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.void
transform
(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.void
transform
(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.void
transform
(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.Methods inherited from class org.apache.sis.referencing.operation.transform.LogarithmicTransform1D
create, create, inverse, tryConcatenate
Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
derivative, getSourceDimensions, getTargetDimensions, transform
Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
beforeFormat, equals, formatTo, getContextualParameters, getDomain, getParameterDescriptors, getParameterValues, hashCode, isIdentity, isInverseEquals, mismatchedDimension, transform
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.operation.MathTransform
isIdentity, toWKT, transform
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
LOG_10
private static final double LOG_10The natural logarithm of 10.- See Also:
-
INSTANCE
Commonly used instance with no offset. -
offset
private final double offsetThe offset to add to the logarithm.Note: the offset could be handled by a concatenation withLinearTransform1D
. instead of an explicit field in this class. However, the offset + logbase(x) formula is extensively used as a transfer function in grid coverages. Consequently, we keep this explicit field for performance reasons.
-
-
Constructor Details
-
Base10
private Base10(double offset) Creates a new instance with the given offset.- See Also:
-
-
Method Details
-
create
Creates a new instance with the given offset. -
base
double base()Returns the base of this logarithmic function.- Overrides:
base
in classLogarithmicTransform1D
-
lnBase
double lnBase()Returns the natural logarithm of the base of this logarithmic function. More specifically, returnsMath.log(
.LogarithmicTransform1D.base()
)- Overrides:
lnBase
in classLogarithmicTransform1D
-
offset
double offset()Returns the offset applied after this logarithmic function.- Overrides:
offset
in classLogarithmicTransform1D
-
derivative
public double derivative(double value) Gets the derivative of this function at a value.- Specified by:
derivative
in interfaceorg.opengis.referencing.operation.MathTransform1D
- Overrides:
derivative
in classLogarithmicTransform1D
- Parameters:
value
- the value where to evaluate the derivative.- Returns:
- the derivative at the specified point.
-
pow
double pow(double value) Returns the base of this logarithmic transform raised to the given power.- Overrides:
pow
in classLogarithmicTransform1D
- Parameters:
value
- the power to raise the base.- Returns:
- the base of this transform raised to the given power.
-
log
double log(double value) Returns the logarithm of the given value in the base of this logarithmic transform. This method is similar toLogarithmicTransform1D.transform(double)
except that the offset is not added.- Overrides:
log
in classLogarithmicTransform1D
- Parameters:
value
- the value for which to compute the log.- Returns:
- the log of the given value in the base used by this transform.
-
transform
public double transform(double value) Transforms the specified value.- Specified by:
transform
in interfaceorg.opengis.referencing.operation.MathTransform1D
- Overrides:
transform
in classLogarithmicTransform1D
- 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:
transform
in interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
transform
in classLogarithmicTransform1D
- 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:
transform
in interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
transform
in classLogarithmicTransform1D
- 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:
transform
in interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
transform
in classLogarithmicTransform1D
- 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:
transform
in interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
transform
in classLogarithmicTransform1D
- 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 byAbstractMathTransform.hashCode()
when first needed.- Overrides:
computeHashCode
in 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:
equals
in interfaceLenientComparable
- Overrides:
equals
in classAbstractMathTransform
- Parameters:
object
- the object to compare with this transform.mode
- the strictness level of the comparison. Default toSTRICT
.- Returns:
true
if the given object is considered equals to this math transform.- See Also:
-