|
| 1 | +using System; |
| 2 | +using System.Runtime.InteropServices; |
| 3 | +using NumSharp.Core.LAPACKProvider; |
| 4 | +using NumSharp.Core; |
| 5 | + |
| 6 | +namespace NumSharp.Core |
| 7 | +{ |
| 8 | + public static partial class LAPACK |
| 9 | + { |
| 10 | + public static void dgesv_(ref int n, ref int nrhs, double[] a, ref int lda, int[] ipiv, double[] b, ref int ldb, ref int info ) |
| 11 | + { |
| 12 | + switch (np.LAPACKProvider) |
| 13 | + { |
| 14 | + case LAPACKProvider.LAPACKProvider.NetLib : |
| 15 | + { |
| 16 | + LAPACKProvider.NetLib.dgesv_(ref n, ref nrhs, a, ref lda, ipiv, b, ref ldb, ref info); |
| 17 | + break; |
| 18 | + } |
| 19 | + } |
| 20 | + } |
| 21 | + public static void dgeqrf_(ref int m, ref int n, double[] a, ref int lda, double[] tau, double[] work, ref int lwork, ref int info) |
| 22 | + { |
| 23 | + switch (np.LAPACKProvider) |
| 24 | + { |
| 25 | + case LAPACKProvider.LAPACKProvider.NetLib : |
| 26 | + { |
| 27 | + LAPACKProvider.NetLib.dgeqrf_(ref m, ref n, a, ref lda, tau, work, ref lwork, ref info); |
| 28 | + break; |
| 29 | + } |
| 30 | + } |
| 31 | + } |
| 32 | + public static void dorgqr_(ref int m,ref int n, ref int k, double[] a, ref int lda, double[] tau, double[]work, ref int lwork,ref int info) |
| 33 | + { |
| 34 | + switch (np.LAPACKProvider) |
| 35 | + { |
| 36 | + case LAPACKProvider.LAPACKProvider.NetLib : |
| 37 | + { |
| 38 | + LAPACKProvider.NetLib.dorgqr_(ref m, ref n,ref k, a, ref lda, tau, work, ref lwork, ref info); |
| 39 | + break; |
| 40 | + } |
| 41 | + } |
| 42 | + } |
| 43 | + public static void dgelss_( ref int m, ref int n, ref int nrhs, double[] a,ref int lda, double[] b, ref int ldb, double[] s,ref double rcond, ref int rank, double[] work,ref int lwork, ref int info ) |
| 44 | + { |
| 45 | + switch (np.LAPACKProvider) |
| 46 | + { |
| 47 | + case LAPACKProvider.LAPACKProvider.NetLib : |
| 48 | + { |
| 49 | + LAPACKProvider.NetLib.dgelss_(ref m, ref n, ref nrhs, a, ref lda, b, ref ldb, s, ref rcond, ref rank, work, ref lwork, ref info); |
| 50 | + break; |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + public static void dgesvd_(char[] JOBU,char[] JOBVT, ref int M, ref int N, double[] A, ref int LDA, double[] S, double[] U, ref int LDU, double[] VT, ref int LDVT, double[] WORK, ref int LWORK, ref int INFO ) |
| 55 | + { |
| 56 | + switch (np.LAPACKProvider) |
| 57 | + { |
| 58 | + case LAPACKProvider.LAPACKProvider.NetLib : |
| 59 | + { |
| 60 | + LAPACKProvider.NetLib.dgesvd_(JOBU, JOBVT, ref M, ref N, A, ref LDA, S, U, ref LDU, VT, ref LDVT, WORK, ref LWORK, ref INFO); |
| 61 | + break; |
| 62 | + } |
| 63 | + } |
| 64 | + } |
| 65 | + } |
| 66 | +} |
0 commit comments