public void trimToSize() { Dcs_util.cs_sprealloc(dcs, 0); }
public void trimToSize() { Dcs_util.cs_sprealloc(dcs, 0); }
/** * Adds an entry to a triplet matrix. Memory-space and dimension of T are * increased if necessary. * * @param T * triplet matrix; new entry added on output * @param i * row index of new entry * @param j * column index of new entry * @param x * numerical value of new entry * @return true if successful, false otherwise */ public static boolean cs_entry(Dcs T, int i, int j, double x) { if (!Dcs_util.CS_TRIPLET(T) || i < 0 || j < 0) return (false); /* check inputs */ if (T.nz >= T.nzmax) { Dcs_util.cs_sprealloc(T, 2 * (T.nzmax)); } if (T.x != null) T.x[T.nz] = x; T.i[T.nz] = i; T.p[T.nz++] = j; T.m = Math.max(T.m, i + 1); T.n = Math.max(T.n, j + 1); return (true); } }
return Dcs_util.cs_sprealloc(A, 0); /* remove extra space from A */
Dcs_util.cs_sprealloc(L, 2 * L.nzmax + n); Dcs_util.cs_sprealloc(U, 2 * U.nzmax + n); Dcs_util.cs_sprealloc(L, 0); /* remove extra space from L and U */ Dcs_util.cs_sprealloc(U, 0); return N;
Dcs_util.cs_sprealloc(A, 0); /* remove extra space from A */ return (nz);
for (j = 0; j < n; j++) { if (nz + m > C.nzmax) { Dcs_util.cs_sprealloc(C, 2 * (C.nzmax) + m); Dcs_util.cs_sprealloc(C, 0); /* remove extra space from C */ return C;
Dcs_util.cs_sprealloc(C, 0); /* remove extra space from C */ return C; /* success; free workspace, return C */
W = new int[8 * (n + 1)]; /* get workspace */ t = cnz + cnz / 5 + 2 * n; /* add elbow room to C */ Dcs_util.cs_sprealloc(C, t); len = W; nv = W;