Hi,
I'm using Intel MKL from C#. In General it works. I want to use the Nonlinear Optimization Problem Solvers and I've translated the example, see http://software.intel.com/en-us/node/471540. But the dtrnlsp_solve gives me sometimes a memory exception (attempt to read write protected memory). I've attached all the dllimports, see below.
[DllImport("mkl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, SetLastError = false)]
internal static extern int dtrnlsp_init(
ref IntPtr handle, ref int n, ref int m, IntPtr x, [In] double[] eps, ref int iter1, ref int iter2, ref double rs);
[DllImport("mkl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, SetLastError = false)]
internal static extern int dtrnlsp_check(
ref IntPtr handle, ref int n, ref int m, IntPtr fjac, IntPtr fvec, [In] double[] eps, [In, Out] int[] info);
[DllImport("mkl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, SetLastError = false)]
internal static extern int dtrnlsp_solve(
ref IntPtr handle, [In, Out] IntPtr fvec, [In] IntPtr fjac, ref int RCI_Request);
[DllImport("mkl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, SetLastError = false)]
internal static extern int dtrnlsp_get(
ref IntPtr handle, ref int iter, ref int st_cr, ref double r1, ref double r2);
[DllImport("mkl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, SetLastError = false)]
internal static extern int dtrnlsp_delete(
ref IntPtr handle);
Regards Michael