Ada:与 Matlab 交互
由于 Ada 没有任何好的科学计算库,我想知道是否有人能够在 Ada 中使用 Matlab 数学函数,例如 eig(用于计算特征值和特征向量)。
我看到 simulink 和 Ada 存在一些接口。但我不是 Simulink 的用户。我希望能够通过 Ada 函数和过程使用 Matlab 数学函数。
PS:在早期的 Ada 文档中,有很多讨论并承诺创建类似于 NAG 或 NUMAL 的良好数值库。我确实想知道为什么这从未成功具体化,也没有任何优秀且强大的科学计算库可供使用。当然,在我看来,Ada 语言并不比任何其他科学计算语言黯然失色。
多谢...
since Ada doesn't possess any good libraries for scientific computing, I was wondering if anyone has been able to use Matlab mathematical functions such as eig (for calculations of eigenvalues and eigenvectors) within Ada.
I see that some interfaces exist for simulink and Ada. But I'm not a user of Simulink. I would like just to be able to use Matlab mathematical functions through perhaps Ada functions and procedures.
PS: In earlier Ada documents there were lots of talks and promises to create good numerical libraries similar to NAG or NUMAL. I do wonder why this has never been concretized successfully, and any good and robust scientific computing library made available. For sure the Ada language doesn't pale before any other scientific computing language in my opinion.
Thanks a lot...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我找不到任何相关信息,这确实有点令人惊讶。
如果它有 C 接口,则可以编写您自己的绑定到您需要的例程。只需使用接口编译指示即可。包中定义的类型 Ada.Interfaces.C 也会有帮助。不过,在自定义绑定上进行链接和测试可能是一个小小的挑战。
另外,Gnat 的最新版本似乎带有 绑定生成器 可以从 C 头文件中为您创建 Ada 绑定。还有另外六个此类工具此处提供,包括适用于 Windows COM DLL< /a> 我听说过一些好消息。
I can't find anything about it, which is indeed a bit surprising.
If it has a C interface, it is possible to write your own bindings to the routines you need. Just use the interfacing pragmas. The types defined in the package Ada.Interfaces.C would also be of help. Getting things linking and tested on a custom binding can be a wee bit of a challenge though.
Also, it looks like recent versions of Gnat come with a binding generator that can create Ada bindings for you out of C header files. There are six more such tools available here, including one that works on Windows COM DLLs that I've heard good things about.
使用 Ada 的
lapack
非常简单。您不需要为此调用Matlab
。Lapcak
与Matlab
使用的库相同。It is very easy to use
lapack
from Ada. You do not need to callMatlab
for that.Lapcak
is the same library whichMatlab
uses as well.Ada.Numerics 下有几个执行矩阵和向量运算的包
There are few packages under Ada.Numerics which perform the matrix and vector operations
作为 Ada.Numerics.Generic_Real_Arrays 的补充,开源库 Mathpaqs 中提供了 Generic_Real_Linear_Equations,特别是 Cholesky 和 LU 分解://sourceforge.net/projects/mathpaqs/" rel="nofollow noreferrer">此处 或 此处。
As a complement to Ada.Numerics.Generic_Real_Arrays, there is Generic_Real_Linear_Equations with, notably, Cholesky and LU decomposition, available in the open-source library Mathpaqs here or here.