public class LinearScaling extends Object implements StaticScalingFunction
Modifier and Type | Field and Description |
---|---|
private double |
factor
Scaling factor
|
private double |
shift
Shift
|
Constructor and Description |
---|
LinearScaling()
Constructor with defaults resulting in identity.
|
LinearScaling(double factor)
Constructor with scaling only.
|
LinearScaling(double factor,
double shift)
Full constructor.
|
LinearScaling(DoubleMinMax minmax)
Constructor from a double minmax.
|
Modifier and Type | Method and Description |
---|---|
static LinearScaling |
fromMinMax(double min,
double max)
Make a linear scaling from a given minimum and maximum.
|
double |
getMax()
Get maximum resulting value.
|
double |
getMin()
Get minimum resulting value.
|
double |
getScaled(double d)
Transform a given value using the scaling function.
|
public LinearScaling()
public LinearScaling(double factor)
factor
- Scaling factorpublic LinearScaling(double factor, double shift)
factor
- Scaling factorshift
- Shift valuepublic LinearScaling(DoubleMinMax minmax)
minmax
- Minimum and Maximumpublic double getScaled(double d)
ScalingFunction
getScaled
in interface ScalingFunction
d
- Original valuepublic double getMin()
ScalingFunction
Double.NaN
or
Double.NEGATIVE_INFINITY
.getMin
in interface ScalingFunction
public double getMax()
ScalingFunction
Double.NaN
or
Double.POSITIVE_INFINITY
.getMax
in interface ScalingFunction
public static LinearScaling fromMinMax(double min, double max)
min
- Minimummax
- MaximumCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.