C# LAPACKE inverse of matrix

C# LAPACKE inverse of matrix

I am doing the inverse of a matrix using
LAPACKE_dgetrfand thenLAPACKE_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 contribution / 0 nouveau(x)
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.