gaussj

sofia_redux.toolkit.fitting.polynomial.gaussj(alpha, beta, invert=False, preserve=True)[source]

Linear equation solution by Gauss-Jordan elimination and matrix inversion

Parameters:
alphaarray_like of float (N, N)

Coefficient array where N is the number of unknown variables to be solved, and therefore is the number of linear equations.

betaarray_like of float (N, M)

Constant array containing the M right-hand side vectors

invertbool, optional

If True, return A^-1 in addition to x.

preservebool, optional

If True, creates copies the input alpha and beta arrays. Otherwise, alpha and beta will be modified inplace if they are already arrays of type numpy.float64.

Returns:
x [, inv_A)]numpy.ndarray [, numpy.ndarray]

The solution (x) to Ax=b (N, M). If invert is True, then inv_A (N, N) will also be returned.

Notes

Created by:

Liyun Wang, GSFC/ARC, November 10, 1994

Created Python version:

Dan Perera, USRA, April, 2019