DotNumerics, AlgLib, dnAnalytics, Math.net, F# for Numerics, Mtxvec?

前端 未结 3 1918
别跟我提以往
别跟我提以往 2020-12-28 16:38

I’ve been searching Google and Stack Overflow like crazy for days and have yet to find any recent, completely relevant information to answer the following question:

相关标签:
3条回答
  • 2020-12-28 17:10

    One common pitfall of choosing math library is that we hope there exists a math library for everything.

    Before finding a library, you should first ask "what kind of math library do I want?". Then you will have a list of criteria, such as open source or not, high performance or not, portable or not, easy to use or not.

    Following are my comments on the libraries in your list (I haven't used the last two):

    1) DotNumerics

    (http://www.dotnumerics.com/)

    They use a fortran2C# translator that translates the Lapack procedures code into C# classes. User friendly C# wrappers are written for the raw Lapack classes.

    2) Alglib (http://www.alglib.net/)

    This library is available in several languages, like delphi, c++ and c#. I believe it has longer history than any other libraries you listed.

    Most of the functions are translated from Lapack. And its interface is not so user friendly. (But you have the flexibility of Lapack style interface.) Using lapack style interface means that you need to know more about the matrix and its operations.

    3) dnAnalytics (http://dnanalytics.codeplex.com/)

    This library is merging into Math.Net now. It seems that the merging is not done yet. A few functions in dnA is still not available in Math.Net.

    4) Math.NET (http://www.mathdotnet.com/) Its implementation is from scratch, i.e., it is not a direct translation from Lapack. They aim to provide a purely managed library for .Net platform. That means easy usage and portability are two primary goals. One concern is that whether their own implementation is correct or not. One good thing is that this library is portable in the sense that you can use it on Mono, XNA, Windows Mobile Phone with little effort.

    The above libraries dont' focus on F#. However one of the team members in Math.Net works for MS Research Cambridge and is an F# expert. Like Cuda said, they will work out an F# interface for the library. Also they will provide native wrappers. But maybe you will wait a long time, longer than "several months" :)

    For the concern of high performance, the above libraries don't provide native wrappers (at least now). If you want native performance + .Net, you had better use a commercial library. There are some open source solutions:

    1. http://ilnumerics.net/ This is a numpy like solution for .Net. They PInvoke to Lapack dlls (e.g. the non-optimized lapack at netlib, the optimized versions from AMD and Intel.)

    2. math provider in F#. read my answer in this question. Since F# source code is now open sourced. I may revise the library and release my updates :)

    Usually you don't need a big math library. You just need some functionality, e.g., if you need a fast matrix multiplication procedure, using PInovke to a platform optimized BLAS dll is the easiest way. If you need do a education oriented math software for kids, then the quality of Math.net is enough. If you are in a company and developing reliable math components, then why don't use a commercial one backed by a high-quality team?

    Finding a perfect math library is hard. But finding a library solution to your problem is usually easy.

    0 讨论(0)
  • 2020-12-28 17:14

    F# for Numerics is a product of my company, written in 100% F#. Our emphasis is on general techniques (everything from FFTs to random number generation) and not specifically linear algebra although basic linear algebra routines are provided (Cholesky, LU, QR, SVD on various matrix/element types) and we are particularly interested in ease of use from F#.

    If you're after the full breadth of LAPACK then my recommendations are Alglib if you're on a budget or Extreme Optimization if you can afford it. Alglib is entirely managed code with an, umm, "quirky" API so it is relatively slow to run and cumbersome to use. Extreme Optimization is a nicer API wrapping the Intel MKL and some extra routines so it is easier to use and much faster to run.

    I should warn you that the general quality of .NET libraries (free, commercial and even the framework itself) is comparatively poor if you are coming from an open source background. I tried many of the other libraries that you mentioned and was not at all impressed with them.

    0 讨论(0)
  • 2020-12-28 17:25

    I also can suggest to view new one .net numerical library called FinMath, which I used in my development. It provides easy to use .net class wrappers for a lot of MKL (Intel Math Kernel Library on which it based) functionality, such as linear algebra (BLAS and LAPACK), statistics and FFT. Also, in addition it contains number of advanced methods such as linear and quadratic programming solver, cluster analysis and others. It also includes various .net to native c marshaling optimization which leads to high performance and easy to use single dll solution.

    But unfortunately it's not open source, not free and in contrast to LAPACK, most methods supports only double precision floating point reals. And for few rarely used LAPACK methods wrapper are not provided.

    0 讨论(0)
提交回复
热议问题