@Override public Matrix solve(Matrix B, Matrix X) { if (!(X instanceof DenseMatrix)) throw new UnsupportedOperationException("X must be a DenseMatrix"); checkSolve(B, X); double[] Xd = ((DenseMatrix) X).getData(); X.set(B); // Allocate factorization matrix. The factorization matrix will be // large enough to accomodate any pivots BandMatrix Af = new BandMatrix(this, kl, ku + kl); int[] ipiv = new int[numRows]; intW info = new intW(0); LAPACK.getInstance().dgbsv(numRows, kl, ku, X.numColumns(), Af.getData(), Matrices.ld(2 * kl + ku + 1), ipiv, Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixSingularException(); else if (info.val < 0) throw new IllegalArgumentException(); return X; }
@Override public Matrix solve(Matrix B, Matrix X) { if (!(X instanceof DenseMatrix)) throw new UnsupportedOperationException("X must be a DenseMatrix"); checkSolve(B, X); double[] Xd = ((DenseMatrix) X).getData(); X.set(B); // Allocate factorization matrix. The factorization matrix will be // large enough to accomodate any pivots BandMatrix Af = new BandMatrix(this, kd, kd + kd); int[] ipiv = new int[numRows]; intW info = new intW(0); LAPACK.getInstance().dgbsv(numRows, kd, kd, X.numColumns(), Af.getData(), Matrices.ld(2 * kd + kd + 1), ipiv, Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixSingularException(); else if (info.val < 0) throw new IllegalArgumentException(); return X; }
@Override public Matrix solve(Matrix B, Matrix X) { if (!(X instanceof DenseMatrix)) throw new UnsupportedOperationException("X must be a DenseMatrix"); checkSolve(B, X); double[] Xd = ((DenseMatrix) X).getData(); X.set(B); // Allocate factorization matrix. The factorization matrix will be // large enough to accomodate any pivots BandMatrix Af = new BandMatrix(this, kd, kd + kd); int[] ipiv = new int[numRows]; intW info = new intW(0); LAPACK.getInstance().dgbsv(numRows, kd, kd, X.numColumns(), Af.getData(), Matrices.ld(2 * kd + kd + 1), ipiv, Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixSingularException(); else if (info.val < 0) throw new IllegalArgumentException(); return X; }
@Override public Matrix solve(Matrix B, Matrix X) { if (!(X instanceof DenseMatrix)) throw new UnsupportedOperationException("X must be a DenseMatrix"); checkSolve(B, X); double[] Xd = ((DenseMatrix) X).getData(); X.set(B); // Allocate factorization matrix. The factorization matrix will be // large enough to accomodate any pivots BandMatrix Af = new BandMatrix(this, kl, ku + kl); int[] ipiv = new int[numRows]; intW info = new intW(0); LAPACK.getInstance().dgbsv(numRows, kl, ku, X.numColumns(), Af.getData(), Matrices.ld(2 * kl + ku + 1), ipiv, Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixSingularException(); else if (info.val < 0) throw new IllegalArgumentException(); return X; }