/** * Constructor for AbstractTriangDenseMatrix * * @param A * Matrix to copy from * @param k * Size of matrix to refer. * <code>k<min(numRows,numColumns)</code> * @param deep * If true, <code>A</code> is copied, else a shallow copy is made * and the matrices share underlying storage. For this, * <code>A</code> must be a dense matrix */ AbstractTriangDenseMatrix(Matrix A, int k, boolean deep, UpLo uplo, Diag diag) { super(A, deep); if (deep && !A.isSquare()) throw new IllegalArgumentException("deep && !A.isSquare()"); ld = A.numRows(); numRows = numColumns = k; this.uplo = uplo; this.diag = diag; }
/** * Constructor for AbstractTriangDenseMatrix * * @param A * Matrix to copy from * @param k * Size of matrix to refer. * <code>k<min(numRows,numColumns)</code> * @param deep * If true, <code>A</code> is copied, else a shallow copy is made * and the matrices share underlying storage. For this, * <code>A</code> must be a dense matrix */ AbstractTriangDenseMatrix(Matrix A, int k, boolean deep, UpLo uplo, Diag diag) { super(A, deep); if (deep && !A.isSquare()) throw new IllegalArgumentException("deep && !A.isSquare()"); ld = A.numRows(); numRows = numColumns = k; this.uplo = uplo; this.diag = diag; }
/** * Checks sizes of input data for {@link #solve(Matrix, Vector, Vector)}. * Throws an exception if the sizes does not match. */ protected void checkSizes(Matrix A, Vector b, Vector x) { if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); if (b.size() != A.numRows()) throw new IllegalArgumentException("b.size() != A.numRows()"); if (b.size() != x.size()) throw new IllegalArgumentException("b.size() != x.size()"); }
/** * Checks sizes of input data for {@link #solve(Matrix, Vector, Vector)}. * Throws an exception if the sizes does not match. */ protected void checkSizes(Matrix A, Vector b, Vector x) { if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); if (b.size() != A.numRows()) throw new IllegalArgumentException("b.size() != A.numRows()"); if (b.size() != x.size()) throw new IllegalArgumentException("b.size() != x.size()"); }
public ArpackSym(Matrix matrix) { if (!matrix.isSquare()) throw new IllegalArgumentException("matrix must be square"); if (EXPENSIVE_CHECKS) for (MatrixEntry entry : matrix) { if (entry.get() != matrix.get(entry.column(), entry.row())) throw new IllegalArgumentException( "matrix must be symmetric"); } this.matrix = matrix; }
public ArpackSym(Matrix matrix) { if (!matrix.isSquare()) throw new IllegalArgumentException("matrix must be square"); if (EXPENSIVE_CHECKS) for (MatrixEntry entry : matrix) { if (entry.get() != matrix.get(entry.column(), entry.row())) throw new IllegalArgumentException( "matrix must be symmetric"); } this.matrix = matrix; }
if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()");
if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()");
/** * Computes the reciprocal condition number * * @param A * The matrix this is a decomposition of * @return The reciprocal condition number. Values close to unity indicate a * well-conditioned system, while numbers close to zero do not. */ public double rcond(Matrix A) { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); double anorm = A.norm(Norm.One); double[] work = new double[3 * n]; int[] iwork = new int[n]; intW info = new intW(0); doubleW rcond = new doubleW(0); if (upper) LAPACK.getInstance().dppcon(UpLo.Upper.netlib(), n, Cu.getData(), anorm, rcond, work, iwork, info); else LAPACK.getInstance().dppcon(UpLo.Lower.netlib(), n, Cl.getData(), anorm, rcond, work, iwork, info); if (info.val < 0) throw new IllegalArgumentException(); return rcond.val; }
/** * Computes the reciprocal condition number * * @param A * The matrix this is a decomposition of * @return The reciprocal condition number. Values close to unity indicate a * well-conditioned system, while numbers close to zero do not. */ public double rcond(Matrix A) { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); double anorm = A.norm(Norm.One); double[] work = new double[3 * n]; int[] iwork = new int[n]; intW info = new intW(0); doubleW rcond = new doubleW(0); if (upper) LAPACK.getInstance().dppcon(UpLo.Upper.netlib(), n, Cu.getData(), anorm, rcond, work, iwork, info); else LAPACK.getInstance().dppcon(UpLo.Lower.netlib(), n, Cl.getData(), anorm, rcond, work, iwork, info); if (info.val < 0) throw new IllegalArgumentException(); return rcond.val; }
/** * Computes the reciprocal condition number * * @param A * The matrix this is a decomposition of * @return The reciprocal condition number. Values close to unity indicate a * well-conditioned system, while numbers close to zero do not. */ public double rcond(Matrix A) { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); double anorm = A.norm(Norm.One); double[] work = new double[3 * n]; int[] lwork = new int[n]; intW info = new intW(0); doubleW rcond = new doubleW(0); if (upper) LAPACK.getInstance().dpbcon(UpLo.Upper.netlib(), n, kd, Cu.getData(), Matrices.ld(kd + 1), anorm, rcond, work, lwork, info); else LAPACK.getInstance().dpbcon(UpLo.Lower.netlib(), n, kd, Cl.getData(), Matrices.ld(kd + 1), anorm, rcond, work, lwork, info); if (info.val < 0) throw new IllegalArgumentException(); return rcond.val; }
/** * Computes the reciprocal condition number * * @param A * The matrix this is a decomposition of * @return The reciprocal condition number. Values close to unity indicate a * well-conditioned system, while numbers close to zero do not. */ public double rcond(Matrix A) { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); double anorm = A.norm(Norm.One); double[] work = new double[3 * n]; int[] lwork = new int[n]; intW info = new intW(0); doubleW rcond = new doubleW(0); if (upper) LAPACK.getInstance().dpbcon(UpLo.Upper.netlib(), n, kd, Cu.getData(), Matrices.ld(kd + 1), anorm, rcond, work, lwork, info); else LAPACK.getInstance().dpbcon(UpLo.Lower.netlib(), n, kd, Cl.getData(), Matrices.ld(kd + 1), anorm, rcond, work, lwork, info); if (info.val < 0) throw new IllegalArgumentException(); return rcond.val; }
/** * Computes the reciprocal condition number * * @param A * The matrix this is a decomposition of * @return The reciprocal condition number. Values close to unity indicate a * well-conditioned system, while numbers close to zero do not. */ public double rcond(Matrix A) { if (n != A.numRows()) throw new IllegalArgumentException("n != A.numRows()"); if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); double anorm = A.norm(Norm.One); double[] work = new double[3 * n]; int[] iwork = new int[n]; intW info = new intW(0); doubleW rcond = new doubleW(0); if (upper) LAPACK.getInstance().dpocon(UpLo.Upper.netlib(), n, Cu.getData(), Matrices.ld(n), anorm, rcond, work, iwork, info); else LAPACK.getInstance().dpocon(UpLo.Lower.netlib(), n, Cl.getData(), Matrices.ld(n), anorm, rcond, work, iwork, info); if (info.val < 0) throw new IllegalArgumentException(); return rcond.val; }
/** * Computes the reciprocal condition number * * @param A * The matrix this is a decomposition of * @return The reciprocal condition number. Values close to unity indicate a * well-conditioned system, while numbers close to zero do not. */ public double rcond(Matrix A) { if (n != A.numRows()) throw new IllegalArgumentException("n != A.numRows()"); if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); double anorm = A.norm(Norm.One); double[] work = new double[3 * n]; int[] iwork = new int[n]; intW info = new intW(0); doubleW rcond = new doubleW(0); if (upper) LAPACK.getInstance().dpocon(UpLo.Upper.netlib(), n, Cu.getData(), Matrices.ld(n), anorm, rcond, work, iwork, info); else LAPACK.getInstance().dpocon(UpLo.Lower.netlib(), n, Cl.getData(), Matrices.ld(n), anorm, rcond, work, iwork, info); if (info.val < 0) throw new IllegalArgumentException(); return rcond.val; }