how can i calculate the inverse Matrix to a Matrix of the type float[,] in C# and in the most efficient way ? i've found that开发者_如何学C a Matrix type in C# can be Inversed i don't know if this help ! thank you :)
These are general math libraries (.NET or not) that tell you, or have functions to invert matrices. If the form is for double
you might need to convert back and forth. I have used (3) below to write a LU decomposition for a general matrix that works very well. In general, for dense (not many zeros) matrix, the most efficient way is Gauss-Seidel
or LU
.
- http://www.mathdotnet.com/
- https://github.com/lutzroeder/mapack
- http://apps.nrbook.com/c/index.html
General linear algebra algorithms (arbitrary size matrices/vectors) are not found anywhere in the .NET framework. But there are surely countless 3rd party frameworks that provide this.
Do you really need to invert a matrix? Often you might think you need the inverse, for example when solving a linear system Ax=b, but in fact you do not need to explicitly calculate the inverse of A, but rather do a decomposition of A to solve the linear system more efficiently.
精彩评论