Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matrix Library for .NET [closed]

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 matrix operations. 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 algorithm for 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.

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.

A bit of searching turned up the following libraries for .NET, which I could potentially used:

  • 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.

like image 992
Noldorin Avatar asked May 08 '09 15:05

Noldorin


3 Answers

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.

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.

There are two very feature-rich packages, both of which support matrices very well. Extreme Numerics works great, and has some very nice features. I've also heard very good things about the IMSL Visual Numerics math libraries.

like image 183
Reed Copsey Avatar answered Nov 03 '22 09:11

Reed Copsey


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:

  • 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
like image 3
Haymo Kutschbach Avatar answered Nov 03 '22 11:11

Haymo Kutschbach


I have us Mapack in the past and found it to be very good.

Although, I don't think it has Sparse matrices but it does support all the basic linear algegra functions.

like image 2
JDunkerley Avatar answered Nov 03 '22 11:11

JDunkerley