/** * Removes entries from a matrix with absolute value <= tol. * * @param A * column-compressed matrix * @param tol * drop tolerance * @return nz, new number of entries in A, -1 on error */ public static int cs_droptol(Dcs A, double tol) { return (Dcs_fkeep.cs_fkeep(A, new Cs_tol(), tol)); /* keep all large entries */ } }
/** * Removes numerically zero entries from a matrix. * * @param A * column-compressed matrix * @return nz, new number of entries in A, -1 on error */ public static int cs_dropzeros(Dcs A) { return (Dcs_fkeep.cs_fkeep(A, new Cs_nonzero(), null)); /* keep all nonzero entries */ }
if (C == null) return (null); Dcs_fkeep.cs_fkeep(C, new Cs_diag(), null); /* drop diagonal entries */ Cp = C.p; cnz = Cp[n];
if (rr[2] - rr[1] < m) /* delete rows R0, R1, and R3 from C */ Dcs_fkeep.cs_fkeep(C, new Cs_rprune(), rr); cnz = Cp[nc]; Ci = C.i;