linalg(deprecated)
swaprow
swap two rows in a matrix
swapcol
swap two columns in a matrix
Calling Sequence
Parameters
Description
Examples
swaprow(A, r1, r2)
swapcol(A, c1, c2)
A
-
matrix
r1, r2, c1, c2
positive integers
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](..).
with⁡linalg:
A≔array⁡1,2,x,3,4,y
A≔12x34y
swaprow⁡A,1,2
34y12x
swapcol⁡A,2,3
1x23y4
See Also
LinearAlgebra
Download Help Document