Example usage for org.apache.commons.math3.linear ArrayRealVector isNaN

List of usage examples for org.apache.commons.math3.linear ArrayRealVector isNaN

Introduction

In this page you can find the example usage for org.apache.commons.math3.linear ArrayRealVector isNaN.

Prototype

@Override
public boolean isNaN() 

Source Link

Document

Check if any coordinate of this vector is NaN .

Usage

From source file:gamlss.algorithm.GlimFit.java

/** Check whether vector wv has some NaN values 
 * and if it does sets NaNs to zero./*from  www.ja v  a  2  s . c o m*/
 * @param v = (eta-os)+dldp/(dr*wt)
 * @return v = (eta-os)+dldp/(dr*wt) or zeros*/
private ArrayRealVector wvCheck(final ArrayRealVector v) {
    if (v.isNaN()) {
        double[] tempA = new double[v.getDimension()];
        for (int i = 0; i < tempA.length; i++) {
            Double vD = v.getEntry(i);
            if (vD.isNaN()) {
                tempA[i] = 0.0;
            } else {
                tempA[i] = vD;
            }
        }
        return new ArrayRealVector(tempA, false);
    }
    return v;
}