private SymmPackEVD factor(Matrix A, double[] data) throws NotConvergedException { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dspevd(job.netlib(), uplo.netlib(), n, data, w, job == JobEig.All ? Z.getData() : new double[0], Matrices.ld(n), work, work.length, iwork, iwork.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
private SymmPackEVD factor(Matrix A, double[] data) throws NotConvergedException { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dspevd(job.netlib(), uplo.netlib(), n, data, w, job == JobEig.All ? Z.getData() : new double[0], Matrices.ld(n), work, work.length, iwork, iwork.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
private SymmBandEVD factor(Matrix A, double[] data, int kd) throws NotConvergedException { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dsbevd(job.netlib(), uplo.netlib(), n, kd, data, Matrices.ld(kd + 1), w, job == JobEig.All ? Z.getData() : new double[0], Matrices.ld(n), work, work.length, iwork, iwork.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
private SymmBandEVD factor(Matrix A, double[] data, int kd) throws NotConvergedException { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dsbevd(job.netlib(), uplo.netlib(), n, kd, data, Matrices.ld(kd + 1), w, job == JobEig.All ? Z.getData() : new double[0], Matrices.ld(n), work, work.length, iwork, iwork.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
/** * Computes an SVD * * @param A * Matrix to decompose. Size must conform, and it will be * overwritten on return. Pass a copy to avoid this * @return The current decomposition * @throws NotConvergedException */ public EconomySVD factor(DenseMatrix A) throws NotConvergedException { if (A.numRows() != m) throw new IllegalArgumentException("A.numRows() != m"); else if (A.numColumns() != n) throw new IllegalArgumentException("A.numColumns() != n"); final intW info = new intW(0); LAPACK.getInstance().dgesdd(JobSVD.Part.netlib(), m, n, A.getData(), A.numRows, S, U.getData(), U.numRows, Vt.getData(), Vt.numRows, work, work.length, iwork, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
private SymmDenseEVD factor(Matrix A, double[] data) throws NotConvergedException { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dsyevr(job.netlib(), range.netlib(), uplo.netlib(), n, data, Matrices.ld(n), 0, 0, 0, 0, abstol, new intW(1), w, job == JobEig.All ? Z.getData() : new double[0], Matrices.ld(n), isuppz, work, work.length, iwork, iwork.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
private SymmDenseEVD factor(Matrix A, double[] data) throws NotConvergedException { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dsyevr(job.netlib(), range.netlib(), uplo.netlib(), n, data, Matrices.ld(n), 0, 0, 0, 0, abstol, new intW(1), w, job == JobEig.All ? Z.getData() : new double[0], Matrices.ld(n), isuppz, work, work.length, iwork, iwork.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
/** * Computes an SVD * * @param A * Matrix to decompose. Size must conform, and it will be * overwritten on return. Pass a copy to avoid this * @return The current decomposition * @throws NotConvergedException */ public SVD factor(DenseMatrix A) throws NotConvergedException { if (A.numRows() != m) throw new IllegalArgumentException("A.numRows() != m"); else if (A.numColumns() != n) throw new IllegalArgumentException("A.numColumns() != n"); intW info = new intW(0); LAPACK.getInstance().dgesdd(job.netlib(), m, n, A.getData(), Matrices.ld(m), S, vectors ? U.getData() : new double[0], Matrices.ld(m), vectors ? Vt.getData() : new double[0], Matrices.ld(n), work, work.length, iwork, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
/** * Computes an SVD * * @param A * Matrix to decompose. Size must conform, and it will be * overwritten on return. Pass a copy to avoid this * @return The current decomposition * @throws NotConvergedException */ public SVD factor(DenseMatrix A) throws NotConvergedException { if (A.numRows() != m) throw new IllegalArgumentException("A.numRows() != m"); else if (A.numColumns() != n) throw new IllegalArgumentException("A.numColumns() != n"); intW info = new intW(0); LAPACK.getInstance().dgesdd(job.netlib(), m, n, A.getData(), Matrices.ld(m), S, vectors ? U.getData() : new double[0], Matrices.ld(m), vectors ? Vt.getData() : new double[0], Matrices.ld(n), work, work.length, iwork, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
/** * Computes the eigenvalue decomposition of the given matrix * * @param A * Matrix to factorize. Overwritten on return * @return The current decomposition * @throws NotConvergedException */ public EVD factor(DenseMatrix A) throws NotConvergedException { if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); else if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dgeev(jobLeft.netlib(), jobRight.netlib(), n, A.getData(), Matrices.ld(n), Wr, Wi, jobLeft == JobEig.All ? Vl.getData() : new double[0], Matrices.ld(n), jobRight == JobEig.All ? Vr.getData() : new double[0], Matrices.ld(n), work, work.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
/** * Computes the eigenvalue decomposition of the given matrix * * @param A * Matrix to factorize. Overwritten on return * @return The current eigenvalue decomposition * @throws NotConvergedException */ public SymmTridiagEVD factor(SymmTridiagMatrix A) throws NotConvergedException { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dstevr(job.netlib(), range.netlib(), n, A.getDiagonal(), A.getOffDiagonal(), 0, 0, 0, 0, abstol, new intW(1), w, job == JobEig.All ? Z.getData() : new double[0], Matrices.ld(n), isuppz, work, work.length, iwork, iwork.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
/** * Computes the eigenvalue decomposition of the given matrix * * @param A * Matrix to factorize. Overwritten on return * @return The current decomposition * @throws NotConvergedException */ public EVD factor(DenseMatrix A) throws NotConvergedException { if (!A.isSquare()) throw new IllegalArgumentException("!A.isSquare()"); else if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dgeev(jobLeft.netlib(), jobRight.netlib(), n, A.getData(), Matrices.ld(n), Wr, Wi, jobLeft == JobEig.All ? Vl.getData() : new double[0], Matrices.ld(n), jobRight == JobEig.All ? Vr.getData() : new double[0], Matrices.ld(n), work, work.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }
/** * Computes the eigenvalue decomposition of the given matrix * * @param A * Matrix to factorize. Overwritten on return * @return The current eigenvalue decomposition * @throws NotConvergedException */ public SymmTridiagEVD factor(SymmTridiagMatrix A) throws NotConvergedException { if (A.numRows() != n) throw new IllegalArgumentException("A.numRows() != n"); intW info = new intW(0); LAPACK.getInstance().dstevr(job.netlib(), range.netlib(), n, A.getDiagonal(), A.getOffDiagonal(), 0, 0, 0, 0, abstol, new intW(1), w, job == JobEig.All ? Z.getData() : new double[0], Matrices.ld(n), isuppz, work, work.length, iwork, iwork.length, info); if (info.val > 0) throw new NotConvergedException( NotConvergedException.Reason.Iterations); else if (info.val < 0) throw new IllegalArgumentException(); return this; }