I'm implementing a LinearTransformation
class, which inherits from numpy.matrix
and uses numpy.matrix.I
to calculate the inverse of the transformation matrix.
Does anyone know whether numpy checks for orthogonality of the matrix before trying to calculate the inverse? I ask because most of my matrices (but not all) will be orthogonal and I wondered whether to implement some quick orthogonality check before trying to invert.
It does not!
numpy.linalg.inv(A)
actually calls numpy.linalg.solve(A,I)
, where I
is the identity, and solve uses lapack's LU factorization.
That is, eventually, it does Gaussian elimination where orthogonality isn't detected by default.
And I don't think there is a shot into the dark to check something like A * A.T = I
as matrix times matrix is costly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With