public void dgeevx(char balance, char jobvl, char jobvr, char sense, int n, double[] a, int lda, double[] wr, double[] wi, double[] vl, int ldvl, double[] vr, int ldvr, ref int ilo, ref int ihi, double[] scale, ref double abnrm, double[] rconde, double[] rcondv, ref int info) { unsafe { fixed(double *pa = a, pwr = wr, pwi = wi, pvl = vl, pvr = vr, pscale = scale, prconde = rconde, prcondv = rcondv, pabnrm = &abnrm) { /* -first have to determine size of and allocate memory for work- */ double *work = stackalloc double[1]; int * iwork = stackalloc int[2 * n - 2]; int lwork = -1; ManagedLapack.dgeevx(balance, jobvl, jobvr, sense, n, pa, lda, pwr, pwi, pvl, ldvl, pvr, ldvr, ref ilo, ref ihi, pscale, ref abnrm, prconde, prcondv, work, lwork, iwork, ref info); if (info != 0) { return; } lwork = (int)work[0]; double *tmp = stackalloc double[lwork]; work = tmp; /* --------------------------------------------------------------------- */ ManagedLapack.dgeevx(balance, jobvl, jobvr, sense, n, pa, lda, pwr, pwi, pvl, ldvl, pvr, ldvr, ref ilo, ref ihi, pscale, ref abnrm, prconde, prcondv, work, lwork, iwork, ref info); } } }
public void dgesdd(char jobz, int m, int n, double[] a, int lda, double[] s, double[] u, int ldu, double[] vt, int ldvt, ref int info) { unsafe { fixed(double *pa = a, ps = s, pu = u, pvt = vt) { fixed(int *pinfo = &info) { /* -first have to determine size of and allocate memory for work- */ double *work = stackalloc double[1]; int * iwork = stackalloc int[((m < n) ? m : n) * 8]; int lwork = -1; ManagedLapack.dgesdd(jobz, m, n, pa, lda, ps, pu, ldu, pvt, ldvt, work, lwork, iwork, ref info); lwork = (int)work[0]; if (lwork != 0) { double *dtmp = stackalloc double[lwork]; work = dtmp; /* --------------------------------------------------------------------- */ ManagedLapack.dgesdd(jobz, m, n, pa, lda, ps, pu, ldu, pvt, ldvt, work, lwork, iwork, ref info); } } } } }
public void dpotrf(char uplo, int n, double[] a, int lda, ref int info) { unsafe { fixed(double *pa = a) ManagedLapack.dpotrf(uplo, n, pa, lda, ref info); } }
public void dpotrs(char uplo, int n, int nrhs, double[] a, int lda, double[] b, int ldb, ref int info) { unsafe { fixed(double *pa = a, pb = b) ManagedLapack.dpotrs(uplo, n, nrhs, pa, lda, pb, ldb, ref info); } }
public void dgemm(char transa, char transb, int m, int n, int k, double alpha, IntPtr a, int lda, IntPtr b, int ldb, double beta, double[] c, int ldc) { unsafe { fixed(double *pc = c) ManagedLapack.dgemm(transa, transb, m, n, k, alpha, (double *)a.ToPointer(), lda, (double *)b.ToPointer(), ldb, beta, pc, ldc); } }
public void dgetrs(char trans, int n, int nrhs, double[] a, int lda, int[] ipiv, double[] b, int ldb, ref int info) { unsafe { fixed(double *pa = a, pb = b) fixed(int *pipiv = ipiv) ManagedLapack.dgetrs(trans, n, nrhs, pa, lda, pipiv, pb, ldb, ref info); } }
public void dgetrf(int m, int n, double[] a, int lda, int[] ipiv, ref int info) { unsafe { fixed(double *pa = a) fixed(int *pipiv = ipiv) ManagedLapack.dgetrf(m, n, pa, lda, pipiv, ref info); } }
public void dgelsy(int m, int n, int nrhs, double[] a, int lda, double[] b, int ldb, int[] jvpt0, double rcond, ref int rank, ref int info) { unsafe { fixed(double *pa = a, pb = b) fixed(int *pjvpt0 = jvpt0) { int lwork = -1; double *work = stackalloc double[1]; ManagedLapack.dgelsy(m, n, nrhs, pa, lda, pb, ldb, pjvpt0, rcond, ref rank, work, lwork, ref info); if (info != 0) { throw new ILArgumentException("?gelsy: unable to determine optimal block size. cancelling..."); } lwork = (int)work[0]; double *tmp = stackalloc double[lwork]; work = tmp; ManagedLapack.dgelsy(m, n, nrhs, pa, lda, pb, ldb, pjvpt0, rcond, ref rank, work, lwork, ref info); } } }