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 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 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 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 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(); }
/** * 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 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 infinity norm of matrix <tt>A</tt>, which is the maximum * absolute row sum. */ public double normInfinity(DoubleMatrix2D A) { DoubleProperty.DEFAULT.checkSparse(A); double norm; if (A instanceof SparseRCDoubleMatrix2D) { norm = normInfinityRC((SparseRCDoubleMatrix2D) A); } else { norm = normInfinityRC(((SparseCCDoubleMatrix2D) A).getRowCompressed()); } return norm; }
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(); }
/** * Returns the infinity norm of matrix <tt>A</tt>, which is the maximum * absolute row sum. */ public double normInfinity(DoubleMatrix2D A) { DoubleProperty.DEFAULT.checkSparse(A); double norm; if (A instanceof SparseRCDoubleMatrix2D) { norm = normInfinityRC((SparseRCDoubleMatrix2D) A); } else { norm = normInfinityRC(((SparseCCDoubleMatrix2D) A).getRowCompressed()); } return norm; }
/** * * Returns the triangular factor, <tt>L'</tt>. * * @return <tt>L'</tt> */ public DoubleMatrix2D getLtranspose() { if (L == null) { L = new SparseCCDoubleMatrix2D(N.L); if (rcMatrix) { L = ((SparseCCDoubleMatrix2D) L).getRowCompressed(); } } if (rcMatrix) { return ((SparseRCDoubleMatrix2D) L).getTranspose(); } else { return ((SparseCCDoubleMatrix2D) L).getTranspose(); } }
public double det() { if (!isNonsingular()) return 0; // avoid rounding errors int pivsign = 1; for (int i = 0; i < n; i++) { if (N.pinv[i] != i) { pivsign = -pivsign; } } if (U == null) { U = new SparseCCDoubleMatrix2D(N.U); if (rcMatrix) { U = ((SparseCCDoubleMatrix2D) U).getRowCompressed(); } } double det = pivsign; for (int j = 0; j < n; j++) { det *= U.getQuick(j, j); } return det; }
/** * * Returns the triangular factor, <tt>L'</tt>. * * @return <tt>L'</tt> */ public DoubleMatrix2D getLtranspose() { if (L == null) { L = new SparseCCDoubleMatrix2D(N.L); if (rcMatrix) { L = ((SparseCCDoubleMatrix2D) L).getRowCompressed(); } } if (rcMatrix) { return ((SparseRCDoubleMatrix2D) L).getTranspose(); } else { return ((SparseCCDoubleMatrix2D) L).getTranspose(); } }