Like you would in any other language that don't have built-in methods to do so. There are many algorithms for this purpose, each with different properties (efficiency, stability, amplification of round-off errors, etc.) and for different kinds of matrices (general, normal, well-conditioned / ill-conditioned, symmetric, positive-/negative-definite, indefinite, rank-deficient (pseudo-inverse methods), etc.). By and large, however, inverting a matrix is rarely needed, so most methods are essentially methods to solve a system of linear equations (Ax = b), and by making the right-hand side equal to the identity matrix, you find the inverse (if that is really what you need). So, what you need to look for are methods to solve systems of linear equations. These include, but not limited to, Gaussian elimination (or its more sophisticated versions, the LU-decomposition or Cholesky decomposition (symmetric positive-definite)), QR decomposition (and variations like QL, RQ, and RRQR), Singular-value decomposition, etc... and the list goes on. There are entire books written on the subject, for example Golub and van Loan (this is pretty much the bible of matrix numerical methods).

There are also libraries that can do that for you, like Eigen, or my own, or the older classic (C) libraries like LAPACK or GSL.

What, exactly, are you looking for? An explanation of an algorithm for doing the inversion?

Help writing code for an algorithm you have?

Or perhaps you don't need the program (source code) itself, you just need a tool that does the inversion? In this case, most scientific calculators have that function built-in.

Otherwise, Mike has listed several pretty good resources to get you started reading about the process.

Dear Friends,
I developed Desktop application in C# .Net for client. client purchased software and installed it one than more system without my permission. How to restict him to not ...