Function adas.xxminv
def xxminv(a, b, solve=True, return_inverted=False)
-
Matrix inversion with accompanying solution of linear equations if requested.
Parameters
a
:float, array
- n x n matrix to be inverted
b
:float, array
- rhs of Ax=b if solve is True.
return_inverted
:bool
- If True also return the inverted matrix. The default is False.
Returns
x
:float, array
- The solution vector
ainv
:float, array
- The inverted matrix a' of a. Only if return_inverted is set to True.
Notes
Calls a fortran based shared object file - not pure python.
Version History
- Martin O'Mullane, 16-12-2022
- First version
Example
>>> import adas as adas >>> import numpy as np >>> a = np.array([[1, 2], [3, 5]]) >>> b = np.array([1, 2]) >>> x = adas.xxminv(a, b)