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().dppsv(uplo.netlib(), numRows, X.numColumns(), data.clone(), Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixNotSPDException(); 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().dppsv(uplo.netlib(), numRows, X.numColumns(), data.clone(), Xd, Matrices.ld(numRows), info); if (info.val > 0) throw new MatrixNotSPDException(); else if (info.val < 0) throw new IllegalArgumentException(); return X; }
NETLIB_LAPACK.dppsv("U", numFeatures, 1, upperTriangularLeftMatrix, rightSideVector, numFeatures, info); if (info.val != 0) { throw new RuntimeException("returned info value : " + info.val);