|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpapaya.NaNs
public final class NaNs
Contains various methods for dealing with NaNs in your data.
Currently only accommodates float and double arrays. Java's Integer.isNaN doesn't seem to exist or I'd include that as well.
Method Summary | |
---|---|
static boolean |
containsNaNs(double[] data)
Checks for presence of NaNs in the data array. |
static boolean |
containsNaNs(float[] data)
Checks for presence of NaNs in the data array. |
static double[] |
eliminate(double[] data)
Eliminate the NaNs from the input array. |
static float[] |
eliminate(float[] data)
Eliminate the NaNs from the input array. |
static ArrayList<Integer> |
getNaNPositions(double[] data)
Returns an array list of indexes where data[i] is NaN. |
static ArrayList<Integer> |
getNaNPositions(float[] data)
Returns an array list of indexes where data[i] is NaN. |
static double[] |
replaceNewWith(double[] data,
double newNaN)
Returns a new array with NaN elements in the original data set replaced with the value specified by newNaN. |
static float[] |
replaceNewWith(float[] data,
float newNaN)
Returns a new array with NaN elements in the original data set replaced with the value specified by newNaN. |
static void |
replaceOriginalWith(double[] data,
double newNaN)
Modifies the original data array by replacing the NaN elements in the data set with the value specified by newNaN. |
static void |
replaceOriginalWith(float[] data,
float newNaN)
Modifies the original data array by replacing the NaN elements in the data set with the value specified by newNaN. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double[] eliminate(double[] data)
data
- the array containing NaNs
public static double[] replaceNewWith(double[] data, double newNaN)
data
- the array containing NaNsnewNaN
- the value to replace the NaNs with.
public static void replaceOriginalWith(double[] data, double newNaN)
data
- the array containing NaNsnewNaN
- the value to replace the NaNs with.public static boolean containsNaNs(double[] data)
data
- array to be searched for NaNs
public static ArrayList<Integer> getNaNPositions(double[] data)
data[i]
is NaN.
data
- array to search for NaNs
data[i] = NaN
public static float[] eliminate(float[] data)
data
- the array containing NaNs
public static float[] replaceNewWith(float[] data, float newNaN)
data
- the array containing NaNsnewNaN
- the value to replace the NaNs with.
public static void replaceOriginalWith(float[] data, float newNaN)
data
- the array containing NaNsnewNaN
- the value to replace the NaNs with.public static boolean containsNaNs(float[] data)
data
- array to be searched for NaNs
public static ArrayList<Integer> getNaNPositions(float[] data)
data[i]
is NaN.
data
- array to search for NaNs
data[i] = NaN
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |