C# LAPACKE inverse of matrix

C# LAPACKE inverse of matrix

Imagen de darkcminor

I am doing the inverse of a matrix using LAPACKE_dgetrf and then LAPACKE_dgetri but not getting any results.... I am doing:

Double[] AInverse = new Double[4] { 4, 3, 3, 2 }; N = 2; lda = N; for (i = 0; i < N * N; i++) { printf(AInverse[i]); } info = MKLImports.LAPACKE_dgetrf(N, N, AInverse, lda, ipiv, info); for (i = 0; i < N * N; i++) { printf(AInverse[i]); } printf(info); info = MKLImports.LAPACKE_dgetri(N, AInverse, lda, ipiv, work1, info); for (i = 0; i < N * N; i++) { printf(AInverse[i]); } printf(info);
[DllImport("mkl_rt.dll", ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] internal static extern int LAPACKE_dgetrf( int m, int n, [In, Out] double[] A, int lda, [In, Out] int[] ipiv, int info ); [DllImport("mkl_rt.dll", ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] internal static extern int LAPACKE_dgetri( int n, [In, Out] double[] A, int lda, [In, Out] int[] ipiv, [In, Out] double[] lwork, int info );
I am getting info = -1 in both calls...
1 envío / 0 nuevos
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.