Inverse

Shipping
matrix_inverse

Dense matrix inverse A⁻¹ via MKL LAPACK; dimensionless result

Signature

Inputs

  • aSignal|ArrayrequiredA square 2-D matrix (or any rank-2 array).

Outputs

  • inverseMatrixThe matrix inverse $A^{-1}$.

Description

Inverse computes the dense matrix inverse of a square input, dispatching through the statically-linked Intel MKL LAPACK backend. The input is read as a 2-D matrix — a Matrix, or any rank-2 Vector/Tensor; a rank-1 vector is rejected with a clear message.

Results carry no unit (dimensionless), consistent with the rest of the rank-≥2 linear-algebra toolkit. Every fallible decomposition surfaces a Backend error instead of panicking, because a native library panic would abort the whole process — so a singular or non-square matrix produces a graceful error rather than a crash.

For solving a linear system you should almost always prefer the dedicated matrix_solve node, which is both faster and more numerically stable than forming explicitly and multiplying. Use Inverse when you genuinely need the inverse matrix itself.

Mathematics

Examples

2×2 inverse

For (with ), the inverse output is .

Applications

  • Analytically inverting small transformation or gain matrices in control and calibration.
  • Computing $A^{-1}B$ style expressions when the explicit inverse is required (though matrix_solve is preferred for systems).
  • Verifying conditioning by inspecting inverse magnitudes alongside matrix_cond.

Neat

The whole linalg family panic-firewalls MKL: a failed factorization returns a Backend error rather than aborting the cdylib process.

Inputs are read in logical C-order via `iter()`, so any internal storage layout is normalized to row-major before the LAPACK call.

Known issues

Singular or near-singular matrices produce a backend error or a numerically unreliable inverse; check matrix_cond first.

Forming $A^{-1}$ to solve $Ax=b$ is less accurate and slower than matrix_solve — prefer the latter for linear systems.

See also

inverselinear-algebralapackmklmatrixstateless