Interface NaNTransformer
-
- All Known Implementing Classes:
NaNTransformers.ErrorNaNTransformer,NaNTransformers.ExcludeNaNTransformer,NaNTransformers.IncludeNaNTransformer
interface NaNTransformerDefines a transformer forNaNvalues in arrays.This interface is not intended for a public API. It provides a consistent method to handle partial sorting of
double[]data in theMedianandQuantileclasses.The transformer allows pre-processing floating-point data before applying a sort algorithm. This is required to handle
NaN.Note: The
<relation does not provide a total order on all double values:-0.0 == 0.0istrueand aNaNvalue compares neither less than, greater than, nor equal to any value, even itself.The
Double.compare(double, double)method imposes the ordering:-0.0is treated as less than value0.0andDouble.NaNis considered greater than any other value and allDouble.NaNvalues are considered equal.This interface allows implementations to respect the behaviour of
Double.compare(double, double), or implement different behaviour.- Since:
- 1.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double[]apply(double[] data, int[] bounds)Pre-process the data for partitioning.
-
-
-
Method Detail
-
apply
double[] apply(double[] data, int[] bounds)Pre-process the data for partitioning.This method will scan all the data and apply processing to
NaNvalues.The method will return:
- An array to partition; this may be a copy.
- The
sizeof the data; this can be smaller than the input array length if the transformer is configured to exclude NaN values.
- Parameters:
data- Data.bounds- [size].- Returns:
- pre-processed data (may be a copy)
-
-