Module PDL::MatrixOps inv Signature: (a(m,m); sv opt ) $a1 = inv($a, {$opt}); Invert a square matrix. You feed in an NxN matrix in $a, and get back its inverse (if it exists). The code is inplace-aware, so you can get back the inverse in $a itself if you want -- though temporary storage is used either way. You can cache the LU decomposition in an output option variable. "inv" uses lu_decomp by default; that is a numerically stable (pivoting) LU decomposition method. If you ask it to thread then a numerically unstable (non-pivoting) method is used instead, so avoid threading over collections of large (say, more than 4x4) or near-singular matrices unless precision is not important. OPTIONS: * s Boolean value indicating whether to complain if the matrix is singular. If this is false, singular matrices cause inverse to barf. If it is true, then singular matrices cause inverse to return undef. In the threading case, no checking for singularity is performed, if any of the matrices in your threaded collection are singular, they receive NaN entries.