aboutsummaryrefslogtreecommitdiff
path: root/examples/mtx_transpose.pd
blob: dd042b224bfc30a80128ddd26e063d8c7052bfc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#N canvas 204 56 718 799 10;
#X obj 48 162 mtx_print;
#X obj 48 134 mtx_transpose;
#X obj 48 81 mtx_ones;
#X msg 48 59 3 5;
#X text 45 42 transpose a matrix;
#X text 158 13 tranpose/shift matrices;
#X obj 37 349 mtx_print;
#X msg 37 246 1 2 3 4 5;
#X text 33 229 shift rows of a matrix;
#X floatatom 104 301 4 0 0;
#X obj 37 321 mtx_scroll 1;
#X obj 37 268 mtx_diag;
#X obj 32 524 mtx_print;
#X msg 32 421 1 2 3 4 5;
#X floatatom 99 476 4 0 0;
#X obj 32 443 mtx_diag;
#X text 28 404 shift columns of a matrix;
#X obj 32 497 mtx_roll 1;
#X text 135 477 shift amount (0=no-shift \; 1=1-column-right \; -2=2-columns-left \; ...);
#X text 143 299 shift amount (0=no-shift \; 1=1-row-down \; -2=2-rows-up \; ...);
#X text 30 594 pivot-transform a matrix;
#X obj 34 669 mtx_pivot;
#N canvas 352 114 190 367 rand-matrix 0;
#X obj 74 163 inlet;
#X obj 74 270 outlet;
#X obj 74 195 mtx_rand;
#X obj 74 215 mtx_* 10;
#X obj 74 237 l2i;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 1 0;
#X restore 34 633 pd rand-matrix;
#X msg 34 611 4 3;
#X obj 83 690 mtx_print post;
#X obj 58 710 mtx_print pre;
#X obj 34 760 mtx_print pivot;
#X obj 485 95 matrix;
#X text 375 95 see also help for;
#X text 282 620 this will tranform the columns and rows \, so that the result will have all maximum values in the diagonale. the maximum of the matrix will be located at the upper-lft corner.;
#X text 281 669 the first outlet is the pivot-transformed matrix.;
#X text 280 695 the other outlets are the 1/0-matrices that have to be pre-multiplied (row-tranform) and post-multiplied (column-tranform) to the original matrix to get the pivot-tranformation. this is useful for de-pivoting.;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 2 0;
#X connect 7 0 11 0;
#X connect 9 0 10 1;
#X connect 10 0 6 0;
#X connect 11 0 10 0;
#X connect 13 0 15 0;
#X connect 14 0 17 1;
#X connect 15 0 17 0;
#X connect 17 0 12 0;
#X connect 21 0 26 0;
#X connect 21 1 25 0;
#X connect 21 2 24 0;
#X connect 22 0 21 0;
#X connect 23 0 22 0;