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.Base10Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
AbstractMathTransform1D.Inverse -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final LogarithmicTransform1D.Base10Commonly used instance with no offset.private static final doubleThe natural logarithm of 10.private final doubleThe offset to add to the logarithm.private static final longFor cross-version compatibility.Fields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBase10(double offset) Creates a new instance with the given offset. -
Method Summary
Modifier and TypeMethodDescription(package private) doublebase()Returns the base of this logarithmic function.protected intComputes a hash value for this transform.create(double offset) Creates a new instance with the given offset.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.(package private) doublelnBase()Returns the natural logarithm of the base of this logarithmic function.(package private) doublelog(double value) Returns the logarithm of the given value in the base of this logarithmic transform.(package private) doubleoffset()Returns the offset applied after this logarithmic function.(package private) doublepow(double value) Returns the base of this logarithmic transform raised to the given power.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.Methods inherited from class org.apache.sis.referencing.operation.transform.LogarithmicTransform1D
create, create, inverse, tryConcatenateMethods 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 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:
basein classLogarithmicTransform1D
-
lnBase
double lnBase()Returns the natural logarithm of the base of this logarithmic function. More specifically, returnsMath.log(.LogarithmicTransform1D.base())- Overrides:
lnBasein classLogarithmicTransform1D
-
offset
double offset()Returns the offset applied after this logarithmic function.- Overrides:
offsetin classLogarithmicTransform1D
-
derivative
public double derivative(double value) Gets the derivative of this function at a value.- Specified by:
derivativein interfaceorg.opengis.referencing.operation.MathTransform1D- Overrides:
derivativein 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:
powin 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:
login 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:
transformin interfaceorg.opengis.referencing.operation.MathTransform1D- Overrides:
transformin 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:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin 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:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin 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:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin 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:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin 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:
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:
-