inv (Matrix)
Tries to invert a square matrix. If the matrix is invertible, the function returns
I D _ TRUE
, where I
is the adjugate and D
is the determinant. If the inverse doesn't exist, the function returns _ 0 c FALSE
, where c * M^T = <0> (zero vector).
Arguments
The square
matrix
to invert.
Return values
Resulting
adjugateMatrix
, empty if it doesn't exist (see Matrix).determinant
of the matrix, as a real number.eigenvector
of the matrix, empty if it doesn't exist (see Vector).invertibleCondition
is TRUE if the matrix can be inverted, FALSE otherwise.
Complexity
O(size^3)
Example
Output:
det:-12.000000
-4.000000,4.000000,0.000000,
-2.000000,-4.000000,-3.000000,
-2.000000,-4.000000,3.000000,
v:
-0.111111,1.000000,-0.777778,