LAPACK.getInstance().dgeqrf(m, n, new double[0], Matrices.ld(m), new double[0], work, -1, info); LAPACK.getInstance().dorgqr(m, n, k, new double[0], Matrices.ld(m), new double[0], workGen, -1, info);
@Override public void dgetrf(int M, int N, double[] A, int lda, int[] IPIV, int INFO) { LAPACK.getInstance().dgetrf(M,N,A,lda,IPIV,new intW(INFO)); }
/** * Sets up an eigenvalue decomposition for symmetrical, tridiagonal * matrices. Uses a low default tolerance criteria * * @param n * Size of the matrix * @param vectors * True to compute the eigenvectors, false for just the * eigenvalues */ public SymmTridiagEVD(int n, boolean vectors) { this(n, vectors, LAPACK.getInstance().dlamch("Safe minimum")); }
@Override public void sgetri(int N, float[] A, int lda, int[] IPIV, float[] WORK, int lwork, int INFO) { LAPACK.getInstance().sgetri(N, A, lda, IPIV, WORK, lwork, new intW(INFO)); }
LAPACK.getInstance().dgesdd(JobSVD.Part.netlib(), m, n, new double[0], Matrices.ld(m), new double[0], new double[0], U.numRows, new double[0], Vt.numRows, worksize, -1, iwork, info);
int[] iworksize = new int[1]; intW info = new intW(0); LAPACK.getInstance().dsyevr(job.netlib(), range.netlib(), uplo.netlib(), n, new double[0], Matrices.ld(n), 0, 0, 0, 0, abstol, new intW(1), new double[0], new double[0],
com.github.fommil.netlib.LAPACK.getInstance().dgeqrf(m, n, A, 0, lda, tau, 0, work, 0, lwork, info); if (info.val != 0)
/** * 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; }
public static DoubleMatrix blasInvert(DoubleMatrix myPrecision) { double[] b = new double[myPrecision.columns]; int[] p = new int[myPrecision.columns]; intW info = new intW(0); int m = myPrecision.columns; double [] a = myPrecision.toArray(); //LAPACK.getInstance().dgetri(m, a, m, p, b, -1, info); //log.info(m + " supposedly has optimal work of " + b[0]); //b = new double[(int)b[0]]; LAPACK.getInstance().dgetrf(m, m, a, m, p, info); if (info.val != 0) throw new IllegalArgumentException(); LAPACK.getInstance().dgetri(m, a, m, p, b, b.length, info); if (info.val != 0) throw new IllegalArgumentException(); DoubleMatrix pInv = new DoubleMatrix(a); return pInv.reshape(myPrecision.rows, myPrecision.columns); }
float[] work = new float[1]; LAPACK.getInstance().sgeqrf( A.rows(), A.columns(), double[] work = new double[1]; LAPACK.getInstance().dgeqrf( A.rows(), A.columns(),
/** * Tests if Native LAPACK is loaded * @return * true if native LAPACK loaded, false if Java LAPACK is loaded */ public static boolean isNativeLAPACK() { return LAPACK.getInstance().getClass().getName().contains("Native"); }
public Matrix mult(Matrix B, DenseMatrix C) { if (pivots == null) return super.mult(B, C); checkMultAdd(B, C); C.set(B); LAPACK.getInstance().dlaswp(C.numColumns(), C.getData(), Matrices.ld(C.numRows()), 1, pivots.length, pivots, transposed ? -1 : 1); return C; }
@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); intW info = new intW(0); LAPACK.getInstance().dgtsv(numRows, X.numColumns(), offDiag.clone(), diag.clone(), offDiag.clone(), Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixSingularException(); else if (info.val < 0) throw new IllegalArgumentException(); return X; }
org.netlib.util.intW info = new intW(0); if (A.data().dataType() == DataBuffer.Type.FLOAT) LAPACK.getInstance().sposv( String.valueOf(uplo), n, LAPACK.getInstance().dposv( String.valueOf(uplo), n,
LAPACK.getInstance().sgesv( a.rows(), b.columns(), return b; } else { LAPACK.getInstance().dgesv( a.rows(), b.columns(),
float[] work = new float[1]; LAPACK.getInstance().ssysv( String.valueOf(uplo), a.rows(), double[] work = new double[1]; LAPACK.getInstance().dsysv( String.valueOf(uplo), a.rows(),
LAPACK.getInstance().sgeev( LAPACK.getInstance().dgeev(
Matrix LUsolve(Matrix B, Matrix X) { if (!(X instanceof DenseMatrix)) throw new UnsupportedOperationException("X must be a DenseMatrix"); double[] Xd = ((DenseMatrix) X).getData(); X.set(B); int[] piv = new int[numRows]; intW info = new intW(0); LAPACK.getInstance().dgesv(numRows, B.numColumns(), data.clone(), Matrices.ld(numRows), piv, Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixSingularException(); else if (info.val < 0) throw new IllegalArgumentException(); return X; }
Matrix SPDsolve(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); intW info = new intW(0); LAPACK.getInstance().dposv(uplo.netlib(), numRows, X.numColumns(), data.clone(), Matrices.ld(numRows), Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixNotSPDException(); else if (info.val < 0) throw new IllegalArgumentException(); return X; }
LAPACK.getInstance().dsysv(uplo.netlib(), numRows, X.numColumns(), newData, Matrices.ld(numRows), ipiv, Xd, Matrices.ld(numRows), work, -1, info); LAPACK.getInstance().dsysv(uplo.netlib(), numRows, X.numColumns(), newData, Matrices.ld(numRows), ipiv, Xd, Matrices.ld(numRows), work, lwork, info);