Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Calling djacobi from CSharp

2032
Beginner
114 Views
Hi,

I'm attempting to call djacobi() from csharp (for a nonlinear optimisation problem).

Can anybody advise on how to pass the objective function (fcn) parameter.

I'm importing the dll as follows:

[DllImport("mkl_rt", CallingConvention = CallingConvention.Cdecl,

ExactSpelling = true, SetLastError = false)]

internal static extern int djacobix(ref int fcn,

ref int n, ref int m, [Out] double[] fjac, [In] double[] x, ref double [] jac_eps,

ref MathLib.Optimiser.my_data m_data);

Obviously, this is not working, since the fcn parameter is not passed correctly. Do I need to use a delegate?

Thanks

Ernest

0 Kudos
1 Reply
Gennady_F_Intel
Moderator
114 Views
Ernest,

Please check with this Article "http://software.intel.com/en-us/articles/using-intel-mkl-in-your-c-program/", You can find there several examples how to do that. In the case if you will experience the further problem, then please give us the example of your*.cs file.

--Gennady

Reply