C#
If the columns of a matrix A are linearly independent, so AT· A is invertible and we obtain with the following formula the pseudo inverse:
A+ = (AT · A)-1 · AT Here A+ is a left inverse of A , what means: A+· A = E .
However, if the rows of the matrix are linearly independent, we obtain the pseudo inverse with the formula:
A+ = AT· (A · A T) -1 This is a right inverse of A , what means: A · A+ = E .
If both the columns and the rows of the matrix are linearly independent, then the matrix is invertible and the pseudo inverse is equal to the inverse of the matrix.