![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need help-matrix inverse (awk) | vesyyr | UNIX for Dummies Questions & Answers | 0 | 12-14-2007 02:44 PM |
| PERL: How do I get both sizes of a matrix? | foo.bar | Shell Programming and Scripting | 2 | 09-26-2007 06:25 PM |
| processing matrix column wise | Abhishek Ghose | Shell Programming and Scripting | 5 | 08-21-2007 01:55 PM |
| Regarding Dot Matrix Printing | aman_mlt | Linux | 0 | 02-23-2006 01:45 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
I need to inverse a matrix given in a file.
The problem is I'm stuck with writing determinant finding algoritm into code. I found this algoritm about finding determinant of nxn matrix. This is what i need: Matrices and Determinants and here: a11 a12 a13 a21 a22 a23 a31 a32 a33 = a11(a22a33 − a23a32) − a12(a21a33 − a23a31) + a13(a21a32 − a22a31) Note the pattern of + and − signs. The general formula is compact, but tedious to compute. Here it is for an n by n matrix A: detA = ai1Ci1 + ai2Ci2 + · · · + ainCin where Cij are referred to as the cofactors and are computed from Cij = (−1)i+j detMij The term Mij is known as the ”minor matrix” and is the matrix you get if you eliminate row i and column j from matrix A. So to find the determinant of e.g. a 4×4 matrix, you end up calculating a bunch of 3 × 3 matrix determinants (much easier). Obviously you can apply this technique recursively (probably using a computer). *************** Can some1 please write it into my code or if he has time even complete the full inverse. I read the matrix from a file into an array "row": ---------------- #!/usr/bin/awk -f BEGIN{} { m=1 while (m <= NF){ row[NR,m] = $m m++ } } END{} -------------- thank you. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|