For professional software such as engineering and graphics, a large amount of mathematical computation is required, and linear algebra is the most used.
So, on top of. NET, especially on. NET 4.0 and VS2010, how can we complete Related Linear Algebra computing? I want to use the following methods:
I. self-built and versatile: according to the needs of your software, you can develop some function libraries incrementally. The biggest problem with this method is re-build the wheel, so most of them are not suitable for this method.
2. Use open-source (or free) components: the advantage of this method is that there are many excellent open-source (or free) tools to choose from. The disadvantage is that it requires a high learning cost.
3. Using commercial components: the advantage of this method over the second is that it guarantees support and services. The disadvantage is self-evident that the cost is high.
Next, I will focus on what open-source (free) components are available on the. NET platform.
1. Use F # for development
F # as a hybrid language (functional language + object-oriented language), it has the advantage of mathematical computing from the very beginning. Not only is it more natural to write computing code, but the F # function library also provides good support for mathematical computing.
In powerpack of F #, The namespace containing Microsoft. FSharp. Math is specifically used for mathematical computation. The matrix type is provided, which is a very common and important type in linear algebra calculation.
For more information about the matrix type, see the help here. You can also refer to this blog: http://fdatamining.blogspot.com/2010/03/matrix-and-linear-algebra-in-f-part-i-f.html
However, for efficient linear algebra calculation, F # also needs to use external function libraries. However, F # has provided corresponding interfaces to facilitate the integration of external function libraries, that is, FSharp. powerPack. math. providers. dll (this assembly is available only in the FSharp-1.9.7.8 ).
For example, F # can integrate LAPACK (LAPACK, Its name isLInearALgebraPACKAge refers to a function set used for data calculation in the language of the Fortran program. LAPACK provides a rich tool function, examples are applicable to Least Square solutions such as solutions for multivariate regression equations, Least Square solutions for typical linear equations, calculation feature vectors, Householder Regression Algorithms for computing moment regression QR decomposition, and odd-sum value decomposition and other issues. In NetLib, the API-based Fortran 95 version LAPACK95 is also provided. LAPACK is exported using the BSD permission method .)
Specific integration methods can refer to: http://fdatamining.blogspot.com/2010/03/matrix-and-linear-algebra-in-f-part-ii.html,http://fdatamining.blogspot.com/2010/03/compiling-lapack-for-net-usage.html
Here is an example of how to perform algebraic operations in F #: http://fdatamining.blogspot.com/2010/04/matrix-and-linear-algebra-in-f-part-iii.html
Actually, the blog address I mentioned above: http://fdatamining.blogspot.com/is worth reading.
2. Use IronPython for development
Although Python is not a functional language, its dynamic language features and code style are also used by many people for engineering development. On top of Python, there is a well-known mathematical computing library, NumPy and SciPy, which has also been transplanted to. NET (the porting process is with the help of Microsoft ).
To use these two libraries, use Python Tools for Visual Studio-an integrated Python Development Environment implemented in VS2010.
The specific use of the wizard can access: http://pytools.codeplex.com/wikipage? Title = NumPy % 20and % 20 SciPy % 20for % w.net
3. Use C # for development
In. NET 4.0, The System. Numerics namespace is added to provide a certain foundation for mathematical computing. However,. NET still does not have a built-in linear algebra computing function library. However, to use C # development, LAPACK and SciPy mentioned above can be used.
For LAPACK, there are also. NET versions, namely: DotNumerics
Of course, there are many third-party open-source, free, and commercial components available.
Let's take a look at the components below:
- Aspx "> Extreme Optimization Numerical Libraries for. NET (commercial)
- . NET Matrix Library (commercial)
- NMath. NET (commercial)
- NAG Library for. NET (commercial)
- SCINET (commercial)
- Math. Net (Open Source)
- Dambach Linear Algebra Framework (Open Source)
- ILNumerics. Net (Open Source)
- Mapack (open-source, our LCA software is used. In fact, I have made a Provider that can be switched to any other function library. I will introduce it later)
- Meta. Numerics (free)
In addition, for the language used for scientific computing development, you can refer to some discussions in this blog: C #-F #-Ironpython and scientific computing, of course, I personally think that F # And IronPython are suitable for scientific computing.