Software Archive
Read-only legacy content
17061 Discussions

C# LAPACKE inverse of matrix

darkcminor
Beginner
455 Views
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);
}
info = MKLImports.LAPACKE_dgetrf(N, N, AInverse, lda, ipiv, info);
for (i = 0; i < N * N; i++)
{
printf(AInverse);
}
printf(info);
info = MKLImports.LAPACKE_dgetri(N, AInverse, lda, ipiv, work1, info);
for (i = 0; i < N * N; i++) {
printf(AInverse);
}
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...
0 Kudos
0 Replies
Reply