Class NaNTransformers
java.lang.Object
org.apache.commons.statistics.descriptive.NaNTransformers
Support for creating
NaNTransformer implementations.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classA transformer that errors onNaN.private static final classA transformer that movesNaNto the upper end of the array.private static final classA NaN transformer that optionally copies the data. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static double[]copy(double[] data, int from, int to) Copy the specified range of data.(package private) static NaNTransformercreateNaNTransformer(NaNPolicy nanPolicy, boolean copy)
-
Constructor Details
-
NaNTransformers
private NaNTransformers()No instances.
-
-
Method Details
-
createNaNTransformer
Creates aNaNTransformerbased on thenanPolicyand datacopypolicy.The transformer is thread-safe.
- Parameters:
nanPolicy- NaN policy.copy- Set totrueto use a copy of the data.- Returns:
- the transformer
-
copy
static double[] copy(double[] data, int from, int to) Copy the specified range of data.This is a simplification of
and does not support range checks or padding of the original input to a longer output.invalid reference
Arrays#copyOfRange(double[], int, int)- Parameters:
data- Values.from- Inclusive start of the range.to- Exclusive end of the range.- Returns:
- the copy
-