Package com.google.common.math
Class LinearTransformation.NaNLinearTransformation
- java.lang.Object
-
- com.google.common.math.LinearTransformation
-
- com.google.common.math.LinearTransformation.NaNLinearTransformation
-
- Enclosing class:
- LinearTransformation
private static final class LinearTransformation.NaNLinearTransformation extends LinearTransformation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.math.LinearTransformation
LinearTransformation.LinearTransformationBuilder
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static LinearTransformation.NaNLinearTransformationINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privateNaNLinearTransformation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearTransformationinverse()Returns the inverse linear transformation.booleanisHorizontal()Returns whether this is a horizontal transformation.booleanisVertical()Returns whether this is a vertical transformation.doubleslope()Returns the slope of the transformation, i.e.java.lang.StringtoString()doubletransform(double x)Returns theycorresponding to the givenx.-
Methods inherited from class com.google.common.math.LinearTransformation
forNaN, horizontal, mapping, vertical
-
-
-
-
Field Detail
-
INSTANCE
static final LinearTransformation.NaNLinearTransformation INSTANCE
-
-
Method Detail
-
isVertical
public boolean isVertical()
Description copied from class:LinearTransformationReturns whether this is a vertical transformation.- Specified by:
isVerticalin classLinearTransformation
-
isHorizontal
public boolean isHorizontal()
Description copied from class:LinearTransformationReturns whether this is a horizontal transformation.- Specified by:
isHorizontalin classLinearTransformation
-
slope
public double slope()
Description copied from class:LinearTransformationReturns the slope of the transformation, i.e. the rate of change ofywith respect tox. This must not be called on a vertical transformation (i.e. whenLinearTransformation.isVertical()is true).- Specified by:
slopein classLinearTransformation
-
transform
public double transform(double x)
Description copied from class:LinearTransformationReturns theycorresponding to the givenx. This must not be called on a vertical transformation (i.e. whenLinearTransformation.isVertical()is true).- Specified by:
transformin classLinearTransformation
-
inverse
public LinearTransformation inverse()
Description copied from class:LinearTransformationReturns the inverse linear transformation. The inverse of a horizontal transformation is a vertical transformation, and vice versa. The inverse of theLinearTransformation.forNaN()transformation is itself. In all other cases, the inverse is a transformation such that applying both the original transformation and its inverse to a value gives you the original value give-or-take numerical errors. Calling this method multiple times on the same instance will always return the same instance. Calling this method on the result of calling this method on an instance will always return that original instance.- Specified by:
inversein classLinearTransformation
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-