/** * Convert (in place) all values in the given array that are considered as "missing" to Float.NaN, * according to isMissingData(val). * * @param values input array * @return input array, with missing values converted to NaNs. */ public float[] setMissingToNaN(float[] values) { if (!vs.hasMissing()) return values; final int length = values.length; for (int i = 0; i < length; i++) { double value = values[i]; if (vs.isMissing(value)) values[i] = Float.NaN; } return values; }
/** if val is missing data, see VariableDS.isMissingData() */ public boolean isMissingData(double val) { return vs.isMissing(val); }