throw new IllegalArgumentException("columnsPointers.length != columns + 1"); Dcs dcs = new Dcs(); dcs.m = rows; dcs.n = columns;
Dcs_common.Dcs dcs = new Dcs_common.Dcs(); dcs.m = m; dcs.n = n;
throw new IllegalArgumentException("columnsPointers.length != columns + 1"); Dcs dcs = new Dcs(); dcs.m = rows; dcs.n = columns;
/** * Allocate a sparse matrix (triplet form or compressed-column form). * * @param m * number of rows * @param n * number of columns * @param nzmax * maximum number of entries * @param values * allocate pattern only if false, values and pattern otherwise * @param triplet * compressed-column if false, triplet form otherwise * @return sparse matrix */ public static Dcs cs_spalloc(int m, int n, int nzmax, boolean values, boolean triplet) { Dcs A = new Dcs(); /* allocate the Dcs struct */ A.m = m; /* define dimensions and nzmax */ A.n = n; A.nzmax = nzmax = Math.max(nzmax, 1); A.nz = triplet ? 0 : -1; /* allocate triplet or comp.col */ A.p = triplet ? new int[nzmax] : new int[n + 1]; A.i = new int[nzmax]; A.x = values ? new double[nzmax] : null; return A; }