/** * Constructs a matrix with a given number of rows and columns. All entries * are initially <tt>0</tt>. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @param nzmax * maximum number of nonzero elements * @throws IllegalArgumentException * if <tt>rows<0 || columns<0</tt> . */ public SparseCCDoubleMatrix2D(int rows, int columns, int nzmax) { super(null); try { setUp(rows, columns); } catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells ! if (!"matrix too large".equals(exc.getMessage())) throw exc; } dcs = Dcs_util.cs_spalloc(rows, columns, nzmax, true, false); }
/** * Constructs a matrix with a given number of rows and columns. All entries * are initially <tt>0</tt>. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @param nzmax * maximum number of nonzero elements * @throws IllegalArgumentException * if <tt>rows<0 || columns<0</tt> . */ public SparseCCDoubleMatrix2D(int rows, int columns, int nzmax) { super(null); try { setUp(rows, columns); } catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells ! if (!"matrix too large".equals(exc.getMessage())) throw exc; } dcs = Dcs_util.cs_spalloc(rows, columns, nzmax, true, false); }
BufferedReader br = new BufferedReader(r); T = Dcs_util.cs_spalloc(0, 0, 1, true, true); /* allocate result */ String line; try {
Ai = A.i; Ax = A.x; C = Dcs_util.cs_spalloc(m, n, Ap[n], values && Ax != null, false); /* alloc result */ Cp = C.p; Ci = C.i;
Ai = A.i; Ax = A.x; C = Dcs_util.cs_spalloc(n, n, Ap[n], values && (Ax != null), false); /* alloc result*/ w = new int[n]; /* get workspace */ Cp = C.p;
Ai = A.i; Ax = A.x; C = Dcs_util.cs_spalloc(n, m, Ap[n], values && (Ax != null), false); /* allocate result */ w = new int[m]; /* get workspace */ Cp = C.p;
Tx = T.x; nz = T.nz; C = Dcs_util.cs_spalloc(m, n, nz, Tx != null, false); /* allocate result */ w = new int[n]; /* get workspace */ Cp = C.p;
dcs = Dcs_util.cs_spalloc(rows, columns, nz, true, false); int[] w = new int[columns]; int[] Cp = dcs.p;
dcs = Dcs_util.cs_spalloc(rows, columns, nz, true, false); int[] w = new int[columns]; int[] Cp = dcs.p;
dcs = Dcs_util.cs_spalloc(rows, columns, nz, true, false); int[] w = new int[columns]; int[] Cp = dcs.p;
dcs = Dcs_util.cs_spalloc(rows, columns, nz, true, false); int[] w = new int[columns]; int[] Cp = dcs.p;
for (k = 0; k < m2; k++) x[k] = 0; /* clear workspace x */ N.L = V = Dcs_util.cs_spalloc(m2, n, vnz, true, false); /* allocate result V */ N.U = R = Dcs_util.cs_spalloc(m2, n, rnz, true, false); /* allocate result R */ N.B = Beta = new double[n]; /* allocate result Beta */ Rp = R.p;
xi = new int[2 * n]; /* get int workspace */ N = new Dcsn(); /* allocate result */ N.L = L = Dcs_util.cs_spalloc(n, n, lnz, true, false); /* allocate result L */ N.U = U = Dcs_util.cs_spalloc(n, n, unz, true, false); /* allocate result U */ N.pinv = pinv = new int[n]; /* allocate result pinv */ Lp = L.p;
Ci = C.i; Cx = C.x; N.L = L = Dcs_util.cs_spalloc(n, n, cp[n], true, false); /* allocate result */ Lp = L.p; Li = L.i;
values = (A.x != null) && (Bx != null); x = values ? new double[m] : null; /* get workspace */ C = Dcs_util.cs_spalloc(m, n, anz + bnz, values, false); /* allocate result*/ Cp = C.p; Ci = C.i;
values = (A.x != null) && (Bx != null); x = values ? new double[m] : null; /* get workspace */ C = Dcs_util.cs_spalloc(m, n, anz + bnz, values, false); /* allocate result */ Cp = C.p; for (j = 0; j < n; j++) {