|
MATRIX RENUMBERName:
<SUBSET/EXCEPT/FOR qualification> where <m> is the original matrix; <rows> is a variable containing the desired row order; <cols> is a variable containing the desired column order; <mout> is the matrix after the rows and columns have been reordered; and where the <SUBSET/EXCEPT/FOR qualification> is optional (and rarely used in this context).
. Following example from page 157 of Nijenhuis and Wilf
DIMENSION 100 COLUMNS
READ MATRIX M
23 24 25 26 27 28 29 21 22
33 34 35 36 37 38 39 31 32
93 94 95 96 97 98 99 91 92
63 64 65 66 67 68 69 61 62
73 74 75 76 77 78 79 71 72
83 84 85 86 87 88 89 81 82
53 54 55 56 57 58 59 51 52
43 44 45 46 47 48 49 41 42
13 14 15 16 17 18 19 11 12
END OF DATA
.
LET ROWIND = DATA 2 3 9 6 7 8 5 4 1
LET COLIND = DATA 3 4 5 6 7 8 9 1 2
.
LET MOUT = MATRIX RENUMBER M ROWIND COLIND
SET WRITE DECIMALS 0
PRINT MOUT
The following output is generated
MATRIX MOUT -- 9 ROWS
-- 9 COLUMNS
VARIABLES--MOUT1 MOUT2 MOUT3 MOUT4 MOUT5 MOUT6 MOUT7 MOUT8 MOUT9
11 12 13 14 15 16 17 18 19
21 22 23 24 25 26 27 28 29
31 32 33 34 35 36 37 38 39
41 42 43 44 45 46 47 48 49
51 52 53 54 55 56 57 58 59
61 62 63 64 65 66 67 68 69
71 72 73 74 75 76 77 78 79
81 82 83 84 85 86 87 88 89
91 92 93 94 95 96 97 98 99
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 01/31/2015 | ||||||||||||||||