Class PowerTransform1D
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.PowerTransform1D
- All Implemented Interfaces:
Serializable
,Parameterized
,LenientComparable
,org.opengis.referencing.operation.MathTransform
,org.opengis.referencing.operation.MathTransform1D
Raises the given value at some fixed power. Current implementation is defined mostly for the
needs of the
ExponentialTransform1D.concatenateLog(LogarithmicTransform1D, boolean)
.
Future version may expand on that.
Before to make this class public (if we do), we need to revisit the class name, define parameters
and improve the tryConcatenate(boolean, MathTransform, MathTransformFactory)
method.
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 TypeFieldDescriptionprivate PowerTransform1D
The inverse of this transform.(package private) final double
The power.private static final long
Serial 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
ConstructorsModifierConstructorDescriptionprotected
PowerTransform1D
(double power) Constructs a new exponential transform. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Computes a hash value for this transform.static org.opengis.referencing.operation.MathTransform1D
create
(double power) Constructs a new power transform.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.org.opengis.referencing.operation.MathTransform1D
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 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.protected org.opengis.referencing.operation.MathTransform
tryConcatenate
(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform other, org.opengis.referencing.operation.MathTransformFactory factory) Concatenates in an optimized way aMathTransform
other
to thisMathTransform
.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 serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
power
final double powerThe power. -
inverse
The 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
-
PowerTransform1D
protected PowerTransform1D(double power) 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:
power
- the power at which to raise the values.
-
-
Method Details
-
create
public static org.opengis.referencing.operation.MathTransform1D create(double power) Constructs a new power transform.- Parameters:
power
- the power at which to raise the values.- Returns:
- the math transform.
-
inverse
public org.opengis.referencing.operation.MathTransform1D inverse()Creates the inverse transform of this object.- Specified by:
inverse
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
inverse
in interfaceorg.opengis.referencing.operation.MathTransform1D
- Overrides:
inverse
in classAbstractMathTransform1D
-
derivative
public double derivative(double value) Gets the derivative of this function at a value.- Specified by:
derivative
in interfaceorg.opengis.referencing.operation.MathTransform1D
- Specified by:
derivative
in 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:
transform
in interfaceorg.opengis.referencing.operation.MathTransform1D
- Specified by:
transform
in 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:
transform
in interfaceorg.opengis.referencing.operation.MathTransform
- 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(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 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:
transform
in interfaceorg.opengis.referencing.operation.MathTransform
- 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.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 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 aMathTransform
other
to thisMathTransform
.- Overrides:
tryConcatenate
in classAbstractMathTransform
- Parameters:
applyOtherFirst
-true
if the transformation order isother
followed bythis
, orfalse
if the transformation order isthis
followed byother
.other
- the other math transform to (pre-)concatenate with this transform.factory
- the factory which is (indirectly) invoking this method, ornull
if none.- Returns:
- the combined math transform, or
null
if no optimized combined transform is available. - Throws:
org.opengis.util.FactoryException
- if an error occurred while combining the transforms.- See Also:
-
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:
-