I am trying to follow the c program that makes use of
dgesvroutine,
http://software.intel.com/sites/products/documentation/hpc/mkl/lapack/mkl_lapack_examples/dgesv_ex.c.htm
After executing the code if I print the variable info, the value is 1, I initialize it to 1, so after the call I would expect its value to be changed, but seems this is not happening, also the variable ipiv holds only zeros....
Could you please tell if I am doing things correctly? maybe, Could you suggest other routine to solve linear systems...
I have the following code:
namespace mkl
{
[SuppressUnmanagedCodeSecurity]
internal sealed class MKLImports
{
private MKLImports()
{
}
[DllImport("D:\\\\LINEAR_EQUATIONS\\\\LIB\\\\mkl_rt.dll",
ExactSpelling = true, SetLastError = false,
CallingConvention = CallingConvention.Cdecl)]
internal static extern void LAPACKE_dgesv(
int n,
int nrhs,
[In, Out] double[] input_matrix,
int lda,
[In, Out] int[] ipiv,
[In, Out] double[] b,
int incx,
int info
);
}
}
int N = 3;
int NRHS =5;
int LDA =N;
int LDB =N;
int n = N, nrhs = NRHS,lda = LDA,ldb = LDB, info=1;
int [] ipiv = new int[N];
Double[] a = new Double[5*5]
{
6.80, -2.11, 5.66, 5.97, 8.23,
-6.05, -3.30, 5.36, -4.44, 1.08,
-0.45, 2.58, -2.70, 0.27, 9.04,
8.32, 2.71, 4.35, -7.17, 2.14,
-9.67, -5.14, -7.26, 6.08, -6.87
};
Double[] b = new Double[5*3]
{
4.02, 6.19, -8.22, -7.57, -3.03,
-1.56, 4.00, -8.67, 1.75, 2.86,
9.81, -4.09, -4.57, -8.61, 8.99
};
MKLImports.LAPACKE_dgesv(n, nrhs, a, lda, ipiv, b, ldb, info);
Linear equations in c#
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.



