Here you can find the source of sanitize(double[] outdata)
Parameter | Description |
---|---|
outdata | data to be processed |
public static void sanitize(double[] outdata)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . j av a2 s .c o m*/ * Sanitizes a double array, meaning - replace NaN by zero - replace * -infinity by zero - replace infinity by zero * * @param outdata * data to be processed */ public static void sanitize(double[] outdata) { for (int i = 0; i < outdata.length; i++) { outdata[i] = outdata[i] == Double.NaN ? 0.0 : outdata[i]; outdata[i] = outdata[i] == Double.NEGATIVE_INFINITY ? (0.0) : outdata[i]; outdata[i] = outdata[i] == Double.POSITIVE_INFINITY ? (0.0) : outdata[i]; } } }