最新最好的调用从C#QuantLib方法 [英] Whats the best to call QuantLib methods from C#

查看:194
本文介绍了最新最好的调用从C#QuantLib方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#应用程序要去使用QuantLib( http://quantlib.org/docs.shtml ),但我不相信他们的.NET转换项目(太不成熟)。

I am gonna use QuantLib in C# app (http://quantlib.org/docs.shtml) but I don't trust their .NET conversion project (too immature).

我只需要期权估值的一部分。

I need only options valuation part.

有人用它在管理应用程序?最新最好的方法呢?

anyone used it in managed app? whats the best approach?

推荐答案

我在类似情况下所做的是执行一个C ++本地的dll的C#之间的适配器和C ++项目。
从C#你可以用的DllImport访问您的DLL接口。
在DLL可以达到完整的C ++接口,但它是值得的,简化的管理网站上您的具体需求。

What I have done in a similar situation is implementing a C++ native dll as an adapter between the C# and C++ projects. From C# you can access your dll interface with DllImport. In the dll you can reach the full C++ interface, but it is worth simplifying it to your exact needs on the managed site.

例如:

// in the C++ dll:
extern "C" MY_API void SetInput(double* Values, int Count);

// in C#:
[DllImport("MyStuff.dll")]
public extern static void SetInput(double[] Values, int Count);

这篇关于最新最好的调用从C#QuantLib方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆