public class LinearScalerImpl extends Object implements LinearScaler, Serializable
Constructor and Description |
---|
LinearScalerImpl(double min,
double max)
Construct a scaler.
|
Modifier and Type | Method and Description |
---|---|
double |
byteDiffSumToDouble(long diffSum)
Scale the sum of differences of bytes into double.
|
double |
byteDomainToDouble(double b)
Scale byte domain representation to the original.
|
double |
byteSqrDiffSumToDouble(long diffSqrSum)
Scale the square sum of differences of bytes into double.
|
float[] |
bytesToFloats(byte[] b)
Map
LinearScaler.byteToFloat(byte) to an array. |
float |
byteToFloat(byte b)
Scale byte representation to float.
|
byte[] |
floatsToBytes(float[] f)
Map
LinearScaler.floatToByte(float) to an array. |
short[] |
floatsToShorts(float[] f)
Map
LinearScaler.floatToShort(float) to an array. |
byte |
floatToByte(float f)
Scale float into the byte representation.
|
short |
floatToShort(float f)
Scale float into the short representation.
|
double |
shortDiffSumToDouble(long diffSum)
Scale the sum of differences of shorts into double.
|
double |
shortDomainToDouble(double s)
Scale short domain representation to the original.
|
double |
shortSqrDiffSumToDouble(long diffSqrSum)
Scale the square sum of differences of shorts into double.
|
float[] |
shortsToFloats(short[] s)
Map
LinearScaler.shortToFloat(short) to an array. |
float |
shortToFloat(short s)
Scale short representation to float.
|
String |
toString() |
public LinearScalerImpl(double min, double max)
min
- Lower bound of the represented floating points range\max
- Upper bound of the represented floating points range\public float byteToFloat(byte b)
LinearScaler
byteToFloat
in interface LinearScaler
b
- Byte representation to scale.public float[] bytesToFloats(byte[] b)
LinearScaler
LinearScaler.byteToFloat(byte)
to an array.bytesToFloats
in interface LinearScaler
b
- Array of bytespublic float shortToFloat(short s)
LinearScaler
shortToFloat
in interface LinearScaler
s
- Short to scalepublic float[] shortsToFloats(short[] s)
LinearScaler
LinearScaler.shortToFloat(short)
to an array.shortsToFloats
in interface LinearScaler
s
- Array of shortspublic byte floatToByte(float f)
LinearScaler
floatToByte
in interface LinearScaler
f
- Float valuepublic byte[] floatsToBytes(float[] f)
LinearScaler
LinearScaler.floatToByte(float)
to an array.floatsToBytes
in interface LinearScaler
f
- Array of floatspublic short floatToShort(float f)
LinearScaler
floatToShort
in interface LinearScaler
f
- Float valuepublic short[] floatsToShorts(float[] f)
LinearScaler
LinearScaler.floatToShort(float)
to an array.floatsToShorts
in interface LinearScaler
f
- Array of floatspublic double byteDiffSumToDouble(long diffSum)
LinearScaler
byteDiffSumToDouble
in interface LinearScaler
diffSum
- Sum of the differences of byte representationspublic double byteSqrDiffSumToDouble(long diffSqrSum)
LinearScaler
byteSqrDiffSumToDouble
in interface LinearScaler
diffSqrSum
- Sum of the differences of byte representationspublic double shortDiffSumToDouble(long diffSum)
LinearScaler
shortDiffSumToDouble
in interface LinearScaler
diffSum
- Sum of the differences of byte representationspublic double shortSqrDiffSumToDouble(long diffSqrSum)
LinearScaler
shortSqrDiffSumToDouble
in interface LinearScaler
diffSqrSum
- Sum of the differences of byte representationspublic double byteDomainToDouble(double b)
LinearScaler
byteDomainToDouble
in interface LinearScaler
b
- Value in scaled byte domain.public double shortDomainToDouble(double s)
LinearScaler
shortDomainToDouble
in interface LinearScaler
s
- Value in scaled short domain.