C# 中的犰狳功能
有没有办法在C#
项目中使用Armadillo的
“C++线性代数库”代码,其中有lapack?
您能否发布一个简单的示例...
我正在考虑获取一个 .dll
并将其导入到 C#
项目中,这是否可行,或者还有其他方法吗?
Is there a way to use Armadillo's
"C++ linear algebra library" code which has lapack in a C#
project?
Could you please post a simple example...
I was thinking to get a .dll
and import it to C#
project, is this feasible or is there another way to go?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用.NET 的 PInvoke 功能(平台调用)从托管代码调用本机 DLL 中的代码。
根据本机 DLL 中入口点的性质,您可能会考虑添加自己的包装层,该包装层使用更多 PInvoke 友好的数据类型。
You can use the PInvoke feature of .NET (platform invoke) to call code in native DLLs from your managed code.
Depending on the nature of the entry points in your native DLL you might consider adding your own wrapping layer which uses more PInvoke-friendly data types.
你有源码吗?如果可以的话,你能用托管 C++ 编译它吗?如果这只是数学函数,我不认为这是一项艰巨的工作。
一旦完成,它就像任何其他程序集一样是托管程序集 - 源语言无关紧要。
Do you have the source? If so can you compile it in managed C++? If it's just mathematical functions I can't see it being a huge job to do that.
Once you've done that it's a managed assembly like any other - the source language is irrelevant.
这可能会有所帮助, https://github.com/mrbm2007/DotNumerics
我使用了 DotNumerics 并添加了一些代码使用犰狳计算特征值,求解线性方程并......
This may help, https://github.com/mrbm2007/DotNumerics
I used DotNumerics and add some code to use armadillo for eigen value, solve linear equation and ...