开发者

calculate Inverse Matrix to a float[,] Array

开发者 https://www.devze.com 2023-02-25 04:06 出处:网络
how can i calculate the inverse Matrix to a Matrix of the type float[,] in C# and in the most efficient way ?

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.

  1. http://www.mathdotnet.com/
  2. https://github.com/lutzroeder/mapack
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消