# Function: refpkg[ref] - compute the row echelon form of a matrix # Calling Sequence: # refpkg[ref](A) # refpkg[ref](A, m) # Parameters: # A - a matrix # m - a non-negative integer # Description: # The call ref(A) returns the row echelon form of the matrix A, where # elimination stops after the last row/column, whichever comes first # The call ref(A,m) returns the row echelon form of the matrix A, where # elimination stops in column m, unless it reaches the bottom row first # if infolevel[refpkg] > 2 a trace of the Gaussian elimination process # is printed # Examples: > read("/afs/eos.ncsu.edu/users/k/kaltofen/www/courses/LinAlgebra/Maple/ > initlib.mpl"); libname := /afs/eos.ncsu.edu/users/k/kaltofen/www/courses/LinAlg\ ebra/Maple, "/afs/bp.ncsu.edu/dist/maple551/update", "/afs/bp.ncsu.edu/dist/maple551/lib" > with(refpkg, ref); [ref] > eval(refpkg); table([ E_III = readlib(refpkg/E_III) E_II = readlib(refpkg/E_II) mydet = readlib(refpkg/mydet) ref = readlib(refpkg/ref) E_I = readlib(refpkg/E_I) myinverse = readlib(refpkg/myinverse) mysolve = readlib(refpkg/mysolve) xref = readlib(refpkg/xref) ]) > infolevel['refpkg']:=3: > B := matrix([ [1, 1, 1, 1, 1, 1], [-1, -1, 0, 0, 1, -1], > [-2, -2, 0, 0, 3, 1], [0,0,1,1,3,-1], [1, 1, 2, 2,4,1] ]); [ 1 1 1 1 1 1] [ ] [-1 -1 0 0 1 -1] [ ] B := [-2 -2 0 0 3 1] [ ] [ 0 0 1 1 3 -1] [ ] [ 1 1 2 2 4 1] > ref(B); Searching column 1 Added row 1 times , 1, to row 2 [ 1 1 1 1 1 1] [ ] [ 0 0 1 1 2 0] [ ] [-2 -2 0 0 3 1] [ ] [ 0 0 1 1 3 -1] [ ] [ 1 1 2 2 4 1] Added row 1 times , 2, to row 3 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 2 2 5 3] [ ] [0 0 1 1 3 -1] [ ] [1 1 2 2 4 1] Added row 1 times , 0, to row 4 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 2 2 5 3] [ ] [0 0 1 1 3 -1] [ ] [1 1 2 2 4 1] Added row 1 times , -1, to row 5 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 2 2 5 3] [ ] [0 0 1 1 3 -1] [ ] [0 0 1 1 3 0] Searching column 2 Searching column 3 Added row 2 times , -2, to row 3 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 0 0 1 3] [ ] [0 0 1 1 3 -1] [ ] [0 0 1 1 3 0] Added row 2 times , -1, to row 4 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 0 0 1 3] [ ] [0 0 0 0 1 -1] [ ] [0 0 1 1 3 0] Added row 2 times , -1, to row 5 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 0 0 1 3] [ ] [0 0 0 0 1 -1] [ ] [0 0 0 0 1 0] Searching column 4 Searching column 5 Added row 3 times , -1, to row 4 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 0 0 1 3] [ ] [0 0 0 0 0 -4] [ ] [0 0 0 0 1 0] Added row 3 times , -1, to row 5 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 0 0 1 3] [ ] [0 0 0 0 0 -4] [ ] [0 0 0 0 0 -3] Searching column 6 Added row 4 times , -3/4, to row 5 [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 0 0 1 3] [ ] [0 0 0 0 0 -4] [ ] [0 0 0 0 0 0] [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 0 0 1 3] [ ] [0 0 0 0 0 -4] [ ] [0 0 0 0 0 0] > with(linalg); Warning, new definition for norm Warning, new definition for trace [BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp, QRdecomp, Wronskian, addcol, addrow, adj, adjoint, angle, augment, backsub, band, basis, bezout, blockmatrix, charmat, charpoly, cholesky, col, coldim, colspace, colspan, companion, concat, cond, copyinto, crossprod, curl, definite, delcols, delrows, det, diag, diverge, dotprod, eigenvals, eigenvalues, eigenvectors, eigenvects, entermatrix, equal, exponential, extend, ffgausselim, fibonacci, forwardsub, frobenius, gausselim, gaussjord, geneqns, genmatrix, grad, hadamard, hermite, hessian, hilbert, htranspose, ihermite, indexfunc, innerprod, intbasis, inverse, ismith, issimilar, iszero, jacobian, jordan, kernel, laplacian, leastsqrs, linsolve, matadd, matrix, minor, minpoly, mulcol, mulrow, multiply, norm, normalize, nullspace, orthog, permanent, pivot, potential, randmatrix, randvector, rank, ratform, row, rowdim, rowspace, rowspan, rref, scalarmul, singularvals, smith, stackmatrix, submatrix, subvector, sumbasis, swapcol, swaprow, sylvester, toeplitz, trace, transpose, vandermonde, vecpotent, vectdim, vector, wronskian] > rref(B); [1 1 0 0 0 0] [ ] [0 0 1 1 0 0] [ ] [0 0 0 0 1 0] [ ] [0 0 0 0 0 1] [ ] [0 0 0 0 0 0] > infolevel['refpkg']:=1: ref(B,2); [1 1 1 1 1 1] [ ] [0 0 1 1 2 0] [ ] [0 0 2 2 5 3] [ ] [0 0 1 1 3 -1] [ ] [0 0 1 1 3 0] # See Also: refpkg[xref], refpkg[mysolve]