public static int nullity ( SingularValueDecomposition_F64 svd , double threshold ) { int ret = 0 ; double w [ ] = svd . getSingularValues ( ) ; int N = svd . numberOfSingularValues ( ) ; int numCol = svd . numCols ( ) ; for ( int j = 0 ; j < N ; j ++ ) { if ( w [ j ] <= threshold ) ret ++ ; } return ret + numCol - N ; }
Extracts the nullity of a matrix using a preexisting decomposition .