Not Yet Answered # Inverse of a non square matrix

DeanMSands3 57 mike_2000_17 2,669 Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

0

Did a little Google-fu. I found the Armadillo library hosted on Sourceforge. It has a Psuedo-Inverse function (http://arma.sourceforge.net/docs.html#pinv)

Also found a codeforge sample: http://www.codeforge.com/article/41545 - Might be more useful if you've never linked libraries.

(Disclaimer: This is Google-fu only. I haven't tested either.)

0

If your matrix is 96x48, then you cannot invert it. You have to solve the linear least-square problem, which leads to computing the left Moore-Penrose pseudoinverse. This can be calculated in a number of different ways, the more generic of which is the QR-decomposition, or the Singular Value Decomposition which is a lot more expensive computationally but more robust if the matrix is rank-deficient (or nearly so), but in this case, it is usually better to use an RRQR decomposition. These are all basic numerical methods that you will find in just about any matrix library out there, including mine.

Normally, however, you rarely calculate an inverse or a pseudoinverse of a matrix, because most of the time what you really want to do is solve a system of linear equations (either determined, under-determined (min-norm problem), or over-determined (least-square problem)). And if you are solving a system of linear equations, you should solve the system of linear equations directly, not through the calculation of an inverse or pseudo-inverse. The systems of linear equations are solved with the same method as for finding the inverse (i.e., the inverse is just the result of solving a system of linear equations where the right-hand side is the identity matrix), but it is quicker to do it in one step. And for that reason, most matrix libraries will provide both functions (and several others related to them). One example is my QR decomposition code which has several related functions like QR, RQ, RRQR and StrongRRQR decompositions, as well as upper / lower triangular back / forward substitution functions, which can be used to construct just about any kind of inversion or linear solution to equation system, least-square or minimum-norm.

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

When I execute this progammatically, I get a table with row heights much larger than when I do this manually.

Note : Sel is the Word.Selection object and the Clipboard contains an Excel Table.

```
public void AddClipboard()
{
Sel.PasteExcelTable(false,false, false);
var t = Sel.Tables[Sel.Tables.Count];
t.AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent);
}
```

the function that I created to find the ...