Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Calling djacobi from CSharp

2032
Beginner
457 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
457 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

0 Kudos
Reply