 linalg(deprecated)/gaussjord - Help

linalg(deprecated)

 rref
 reduced row echelon form
 gaussjord
 a synonym for rref (Gauss-Jordan elimination)

 Calling Sequence gaussjord(A) gaussjord(A, 'r') gaussjord(A, 'r', 'd') gaussjord(A, rmar)

Parameters

 A - rectangular matrix 'r' - (optional) for returning the rank of A 'd' - (optional) for returning the determinant of A rmar - (optional) non-negative integer

Description

 • Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[GaussianElimination], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 - For details related to the GaussianElimination and ReducedRowEchelonForm commands, see the LinearAlgebra[GaussianElimination] help page.
 • Elementary row operations are performed on A, an n by m matrix over a field, to reduce it to row echelon (Gauss-Jordan) form. At present, if the matrix contains floating-point or decimal numbers, then Gaussian elimination with partial pivoting is used where all arithmetic is done in floating-point at Digits precision.  In this case, the matrix entries on input must all be numbers of type numeric or complex(numeric). Otherwise ordinary Gaussian elimination is used.  At present, the matrix entries must be rationals or complex rationals or in general rational functions with these coefficients.
 • The resulting matrix is upper triangular with leading nonzero entries 1 . If the matrix contains integers only, then in general rational numbers will appear in the result. Likewise if the matrix contains polynomials, in general rational functions will appear in the result.
 • If an optional second parameter is specified, and it is a name, it is assigned the rank of A. The rank of A is the number of nonzero rows in the resulting matrix.
 • If an optional third parameter is also specified, and the rank of A = n, then it is assigned the determinant of $\mathrm{submatrix}\left(A,1..n,1..n\right)$.
 • If an optional second parameter is specified, and it is an integer, the elimination is terminated at this column position.
 The global _GaussJordanPivotList will contain the pivots which are not provably nonzero with the current Normalizer. This may be used to facilitate changing the value of Normalizer so that the computation may be repeated without using pivots not previously known to be nonzero.

Examples

Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[GaussianElimination], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $A≔\mathrm{array}\left(\left[\left[4,-6,1,0\right],\left[-6,12,0,1\right],\left[-2,6,1,1\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{cccc}{4}& {-6}& {1}& {0}\\ {-6}& {12}& {0}& {1}\\ {-2}& {6}& {1}& {1}\end{array}\right]$ (1)
 > $\mathrm{gaussjord}\left(A,'r'\right)$
 $\left[\begin{array}{cccc}{1}& {0}& {1}& \frac{{1}}{{2}}\\ {0}& {1}& \frac{{1}}{{2}}& \frac{{1}}{{3}}\\ {0}& {0}& {0}& {0}\end{array}\right]$ (2)
 > $\mathrm{rank}\left(A\right)$
 ${2}$ (3)
 > $m≔\mathrm{matrix}\left(2,2,\left[\frac{1}{\mathrm{sqrt}\left(6\right)}+1-\frac{\mathrm{sqrt}\left(2\right)\mathrm{sqrt}\left(3\right)}{6},1,\frac{1}{\mathrm{sqrt}\left(6\right)}+2-\frac{\mathrm{sqrt}\left(2\right)\mathrm{sqrt}\left(3\right)}{6},2\right]\right)$
 ${m}{≔}\left[\begin{array}{cc}\frac{\sqrt{{6}}}{{6}}{+}{1}{-}\frac{\sqrt{{2}}{}\sqrt{{3}}}{{6}}& {1}\\ \frac{\sqrt{{6}}}{{6}}{+}{2}{-}\frac{\sqrt{{2}}{}\sqrt{{3}}}{{6}}& {2}\end{array}\right]$ (4)
 > $\mathrm{infolevel}\left[\mathrm{linalg}\right]≔1$
 ${{\mathrm{infolevel}}}_{{\mathrm{linalg}}}{≔}{1}$ (5)
 > $\mathrm{rref}\left(m\right)$
 $\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]$ (6)
 > $\mathrm{_GaussJordanPivotList}$
 $\left[\frac{\sqrt{{6}}}{{6}}{+}{1}{-}\frac{\sqrt{{2}}{}\sqrt{{3}}}{{6}}{,}\frac{{-}\sqrt{{2}}{}\sqrt{{3}}{+}\sqrt{{6}}}{{-}\sqrt{{2}}{}\sqrt{{3}}{+}\sqrt{{6}}{+}{6}}\right]$ (7)
 > $\mathrm{map}\left(\mathrm{radnormal},\mathrm{_GaussJordanPivotList}\right)$
 $\left[{1}{,}{0}\right]$ (8)
 > $\mathrm{linalg}\left[\mathrm{rref}\right]\left(m\right)$
 $\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]$ (9)