public static int rank ( DMatrixRMaj A , double threshold ) { SingularValueDecomposition_F64 < DMatrixRMaj > svd = DecompositionFactory_DDRM . svd ( A . numRows , A . numCols , false , false , true ) ; if ( svd . inputModified ( ) ) A = A . copy ( ) ; if ( ! svd . decompose ( A ) ) throw new RuntimeException ( "Decomposition failed" ) ; return SingularOps_DDRM . rank ( svd , threshold ) ; }
Computes the rank of a matrix using the specified tolerance .