public DoubleMatrix2D like(int rows, int columns) { return new SparseCCDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like(int rows, int columns) { return new SparseCCDoubleMatrix2D(rows, columns); }
/** * Returns a new matrix that is the transpose of this matrix. This method * creates a new object (not a view), so changes in the returned matrix are * NOT reflected in this matrix. * * @return the transpose of this matrix */ public SparseCCDoubleMatrix2D getTranspose() { Dcs dcst = Dcs_transpose.cs_transpose(dcs, true); SparseCCDoubleMatrix2D tr = new SparseCCDoubleMatrix2D(columns, rows); tr.dcs = dcst; return tr; }
/** * Returns a new matrix that is the transpose of this matrix. This method * creates a new object (not a view), so changes in the returned matrix are * NOT reflected in this matrix. * * @return the transpose of this matrix */ public SparseCCDoubleMatrix2D getTranspose() { Dcs dcst = Dcs_transpose.cs_transpose(dcs, true); SparseCCDoubleMatrix2D tr = new SparseCCDoubleMatrix2D(columns, rows); tr.dcs = dcst; return tr; }
public DoubleMatrix2D getU() { if (U == null) { U = new SparseCCDoubleMatrix2D(N.U); if (rcMatrix) { U = ((SparseCCDoubleMatrix2D) U).getRowCompressed(); } } return U.copy(); }
public DoubleMatrix2D getL() { if (L == null) { L = new SparseCCDoubleMatrix2D(N.L); if (rcMatrix) { L = ((SparseCCDoubleMatrix2D) L).getRowCompressed(); } } return L.copy(); }
public DoubleMatrix2D getL() { if (L == null) { L = new SparseCCDoubleMatrix2D(N.L); if (rcMatrix) { L = ((SparseCCDoubleMatrix2D) L).getRowCompressed(); } } return L.copy(); }
public DoubleMatrix2D getU() { if (U == null) { U = new SparseCCDoubleMatrix2D(N.U); if (rcMatrix) { U = ((SparseCCDoubleMatrix2D) U).getRowCompressed(); } } return U.copy(); }
/** * Returns whether the matrix <tt>A</tt> has full rank. * * @return true if <tt>R</tt>, and hence <tt>A</tt>, has full rank. */ public boolean hasFullRank() { if (R == null) { R = new SparseCCDoubleMatrix2D(N.U); if (rcMatrix) { R = ((SparseCCDoubleMatrix2D) R).getRowCompressed(); } } int mn = Math.min(m, n); for (int j = 0; j < mn; j++) { if (R.getQuick(j, j) == 0) return false; } return true; }
/** * Returns a copy of the upper triangular factor, <tt>R</tt>. * * @return <tt>R</tt> */ public DoubleMatrix2D getR() { if (R == null) { R = new SparseCCDoubleMatrix2D(N.U); if (rcMatrix) { R = ((SparseCCDoubleMatrix2D) R).getRowCompressed(); } } return R.copy(); }
/** * Returns a copy of the Householder vectors v, from the Householder * reflections H = I - beta*v*v'. * * @return the Householder vectors. */ public DoubleMatrix2D getV() { if (V == null) { V = new SparseCCDoubleMatrix2D(N.L); if (rcMatrix) { V = ((SparseCCDoubleMatrix2D) V).getRowCompressed(); } } return V.copy(); }
/** * Returns the triangular factor, <tt>L</tt>. * * @return <tt>L</tt> */ public DoubleMatrix2D getL() { if (L == null) { L = new SparseCCDoubleMatrix2D(N.L); if (rcMatrix) { L = ((SparseCCDoubleMatrix2D) L).getRowCompressed(); } } return L.copy(); }
/** * Returns the triangular factor, <tt>L</tt>. * * @return <tt>L</tt> */ public DoubleMatrix2D getL() { if (L == null) { L = new SparseCCDoubleMatrix2D(N.L); if (rcMatrix) { L = ((SparseCCDoubleMatrix2D) L).getRowCompressed(); } } return L.copy(); }
/** * Returns a copy of the upper triangular factor, <tt>R</tt>. * * @return <tt>R</tt> */ public DoubleMatrix2D getR() { if (R == null) { R = new SparseCCDoubleMatrix2D(N.U); if (rcMatrix) { R = ((SparseCCDoubleMatrix2D) R).getRowCompressed(); } } return R.copy(); }
public DoubleMatrix2D getU() { if (U == null) { int[] Up = new int[N.unz + 1]; int[] Ui = new int[N.unz]; double[] Ux = new double[N.unz]; klu_extract(N, S, null, null, null, Up, Ui, Ux, null, null, null, null, null, null, null, Common); U = new SparseCCDoubleMatrix2D(n, n, Ui, Up, Ux); if (rcMatrix) { U = ((SparseCCDoubleMatrix2D) U).getRowCompressed(); } } return U.copy(); }
public DoubleMatrix2D getU() { if (U == null) { int[] Up = new int[N.unz + 1]; int[] Ui = new int[N.unz]; double[] Ux = new double[N.unz]; klu_extract(N, S, null, null, null, Up, Ui, Ux, null, null, null, null, null, null, null, Common); U = new SparseCCDoubleMatrix2D(n, n, Ui, Up, Ux); if (rcMatrix) { U = ((SparseCCDoubleMatrix2D) U).getRowCompressed(); } } return U.copy(); }
public DoubleMatrix2D getL() { if (L == null) { int[] Lp = new int[N.lnz + 1]; int[] Li = new int[N.lnz]; double[] Lx = new double[N.lnz]; klu_extract(N, S, Lp, Li, Lx, null, null, null, null, null, null, null, null, null, null, Common); L = new SparseCCDoubleMatrix2D(n, n, Li, Lp, Lx); if (rcMatrix) { L = ((SparseCCDoubleMatrix2D) L).getRowCompressed(); } } return L.copy(); }
public DoubleMatrix2D getL() { if (L == null) { int[] Lp = new int[N.lnz + 1]; int[] Li = new int[N.lnz]; double[] Lx = new double[N.lnz]; klu_extract(N, S, Lp, Li, Lx, null, null, null, null, null, null, null, null, null, null, Common); L = new SparseCCDoubleMatrix2D(n, n, Li, Lp, Lx); if (rcMatrix) { L = ((SparseCCDoubleMatrix2D) L).getRowCompressed(); } } return L.copy(); }
/** * Creates the interpolation (prolongation) matrix based on the * non-smoothed aggregates */ private SparseCCDoubleMatrix2D createInterpolationMatrix(int[] pt, int c) { SparseCCMDoubleMatrix2D If = new SparseCCMDoubleMatrix2D(pt.length, c); for (int i = 0; i < pt.length; ++i) if (pt[i] != -1) If.setQuick(i, pt[i], 1); return (SparseCCDoubleMatrix2D) (new SparseCCDoubleMatrix2D(If.rows(), If.columns()).assign(If)); }
/** * Creates the interpolation (prolongation) matrix based on the * non-smoothed aggregates */ private SparseCCDoubleMatrix2D createInterpolationMatrix(int[] pt, int c) { SparseCCMDoubleMatrix2D If = new SparseCCMDoubleMatrix2D(pt.length, c); for (int i = 0; i < pt.length; ++i) if (pt[i] != -1) If.setQuick(i, pt[i], 1); return (SparseCCDoubleMatrix2D) (new SparseCCDoubleMatrix2D(If.rows(), If.columns()).assign(If)); }