 linalg(deprecated)/swaprow - Maple Help

Home : Support : Online Help : linalg(deprecated)/swaprow

linalg(deprecated)

 swaprow
 swap two rows in a matrix
 swapcol
 swap two columns in a matrix Calling Sequence swaprow(A, r1, r2) swapcol(A, c1, c2) Parameters

 A - matrix r1, r2, c1, c2 - positive integers Description

 • Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Modular][Swap], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • The swaprow(A, r1, r2) function creates a new matrix in which row r1 has been swapped with row r2.  Similarly, swapcol(A, c1, c2) creates a new matrix in which column c1 has been swapped with column c2.
 These functions are part of the linalg package, and so can be used in the form swaprow(..) only after performing the command with(linalg) or with(linalg, swaprow).  They can always be accessed in the long form linalg[swaprow](..). Examples

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

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $A≔\mathrm{array}\left(\left[\left[1,2,x\right],\left[3,4,y\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {x}\\ {3}& {4}& {y}\end{array}\right]$ (1)
 > $\mathrm{swaprow}\left(A,1,2\right)$
 $\left[\begin{array}{ccc}{3}& {4}& {y}\\ {1}& {2}& {x}\end{array}\right]$ (2)
 > $\mathrm{swapcol}\left(A,2,3\right)$
 $\left[\begin{array}{ccc}{1}& {x}& {2}\\ {3}& {y}& {4}\end{array}\right]$ (3)