.NET 矩阵库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/840360/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Matrix Library for .NET
提问by Noldorin
I'm looking for a good (well-tested, fully-featured, and ideally with a nice interface) matrix library for .NET/C#. My main requirements here are only that it should be free (I don't particularly care whether it's open-source in this case) and preferably support sparse matrixoperations. The obligatory requirements are all the basic operations (e.g. multiplication, transposition, inversion) as well as finding eigenvalues & eigenvectors. Implementation of a numerical rather than/as well as analytical methods for discovery of eigenvalues, particularly the Lanczos algorithmfor sparse matrices, would be highly preferable since the matrices I'm going to be dealing with are very large (lengths of 10,000 upwards) as well as square, and also reasonably sparse. Saying that, I could be asking for a bit much there, so any suggestions for a reasonably complete matrix library would be great.
我正在为 .NET/C# 寻找一个好的(经过充分测试、功能齐全、理想情况下有一个漂亮的界面)矩阵库。我在这里的主要要求只是它应该是免费的(在这种情况下我并不特别关心它是否是开源的)并且最好支持稀疏矩阵运算。强制性要求是所有基本运算(例如乘法、转置、求逆)以及找到特征值和特征向量。实现用于发现特征值的数值方法而不是/以及分析方法,尤其是Lanczos 算法对于稀疏矩阵,这是非常可取的,因为我要处理的矩阵非常大(长度为 10,000 以上)以及正方形,而且相当稀疏。话虽如此,我可能会在那里要求更多,因此任何有关合理完整矩阵库的建议都会很棒。
Now I'm aware that Python has one or two useful libraries for such tasks (namely NumPy/SciPy), but .NET unfortunately seems to be lacking in the area.
现在我知道 Python 有一两个用于此类任务的有用库(即NumPy/ SciPy),但不幸的是,该领域似乎缺乏 .NET。
A bit of searching turned up the following libraries for .NET, which I could potentially used:
一些搜索为 .NET 找到了以下库,我可能会使用它们:
- Lutz Roeder's Mapack
- DotNetMatrix(CodeProject)
- C# Matrix Library(CodeProject)
However, since I have had no experience whatsoever using any of these libraries or others (and not exactly enough time to check each of them out properly in any case), I would very much appreciate if anyone here could discuss their recommendations regarding the various libraries, their pros/cons particularly with regards to suitability for my uses, and their general experiences with them.
但是,由于我没有任何使用这些库或其他库的经验(并且在任何情况下都没有足够的时间正确检查每个库),如果这里有人可以讨论他们对各种库的建议,我将不胜感激,他们的优缺点,特别是在适合我的用途方面,以及他们对他们的一般经验。
Resorting to MatLab is always an option, but not a preferred one, as it would be much more convenient if I could integrate the matrix math directly with my program.
诉诸 MatLab 始终是一种选择,但不是首选,因为如果我可以将矩阵数学直接与我的程序集成会方便得多。
采纳答案by Reed Copsey
Edit:
编辑:
It wasn't quite there last time I evaluated it, but there has been quite a bit of activity, so you should also consider the (free and open source) Math.NET Numerics.
我上次评估它时还没有完全到位,但是已经有相当多的活动,因此您还应该考虑(免费和开源)Math.NET Numerics。
In looking now, it seems they've finished their new version, and have added sparse matrix support, as well as other nice goodies.
现在看来,他们似乎已经完成了他们的新版本,并添加了稀疏矩阵支持,以及其他不错的东西。
If you want more robust support, you unfortunately really need to get into commercial packages for .NET atm.
如果你想要更强大的支持,不幸的是你真的需要进入 .NET atm 的商业包。
There are two very feature-rich packages, both of which support matrices very well. Extreme Numericsworks great, and has some very nice features. I've also heard very good things about the IMSL Visual Numericsmath libraries.
有两个功能非常丰富的软件包,它们都很好地支持矩阵。 Extreme Numerics效果很好,并且有一些非常好的功能。我也听说过关于IMSL Visual Numerics数学库的好消息。
回答by Haymo Kutschbach
Try ILNumerics: We have a rel. long history as open source project and recently changed to commercial licenses for better and reliable support. I am biased but here comes a short feature list:
试试ILNumerics:我们有一个相对的。作为开源项目的悠久历史,最近改为商业许可证以获得更好和可靠的支持。我有偏见,但这里有一个简短的功能列表:
- Better memory management, hence ...
- Much faster algorithms
- Uses MKL for linear algebra
- n-dim array classes, syntax similar to Matlab
- 3D plot controls
- Support for 32/64 bit
- Support for mono
- Full feature list
- 更好的内存管理,因此...
- 更快的算法
- 使用 MKL 进行线性代数
- n-dim 数组类,语法类似于 Matlab
- 3D 绘图控件
- 支持 32/64 位
- 支持单声道
- 完整功能列表
回答by tvanfosson
Another alternative: IMSL for .NET. CenterSpace has the NMathlibraries -- haven't used these.
另一种选择:用于 .NET 的 IMSL。CenterSpace 有NMath库——没有使用过这些。
回答by JDunkerley
I have us Mapack in the past and found it to be very good.
我过去有我们 Mapack,发现它非常好。
Although, I don't think it has Sparse matrices but it does support all the basic linear algegra functions.
虽然,我认为它没有稀疏矩阵,但它确实支持所有基本的线性代数函数。
回答by Ben Shepheard
I used Mapack (the .Net port not the COM version) in a neural network project at university. I can't exactly remember the fine details of the library, but it did everything I needed it to and wasn't particularly onerous to use.
我在大学的一个神经网络项目中使用了 Mapack(.Net 端口,而不是 COM 版本)。我不记得图书馆的细节,但它做了我需要的一切,而且使用起来并不是特别麻烦。
回答by Ben Shepheard
Meta.Numerics(hosted on codeplex) is a free package that will compute eigenvalues and eigenvectors of non-symmetric matrices, but it does not currently treat sparse matrices specially.
Meta.Numerics(托管在codeplex 上)是一个免费包,它将计算非对称矩阵的特征值和特征向量,但它目前没有专门处理稀疏矩阵。
回答by fab
回答by John D. Cook
回答by Joel Coehoorn
The now-defunct Managed DirectX library had some matrix support.
现已解散的托管 DirectX 库有一些矩阵支持。
That has since been wrapped into Microsoft XNA, which is probably not a good fit for you, but the MDX Wikipedia articlerecommends something called SlimDXthat might be okay.
此后已将其封装到 Microsoft XNA 中,这可能不适合您,但MDX 维基百科文章推荐了一种称为SlimDX 的东西,它可能没问题。

