aboutsummaryrefslogtreecommitdiff
path: root/help/tabsort2-help.pd
blob: 4f4e29a518495e694523501f59d1be905f8a238c (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#N canvas 133 15 811 538 10;
#X floatatom 62 381 5 0 0 0 - - -;
#N canvas 0 0 450 300 graph29 0;
#X array source1 100 float 1;
#A 0 -0.0428565 -0.0571422 0.085715 0.228572 0.442858 0.657144 0.871429
1.08572 1.22857 1.51429 1.72857 1.94286 2.22857 2.37143 2.58571 2.72857
2.87143 2.94286 3.15714 3.3 3.3 3.44286 3.58571 3.65714 3.72857 3.8
3.94286 4.01429 4.08571 4.22857 4.3 4.13929 3.97857 3.81786 3.51429
3.22857 2.8 2.37143 2.3 2.3 2.3 2.37143 2.44286 2.51429 2.51429 2.58572
2.55 2.37143 2.22857 1.94286 1.72857 1.58572 1.44286 1.44286 1.37144
1.37144 1.37144 1.44286 1.44286 1.44286 1.44286 1.51429 1.51429 1.58572
1.65714 1.65714 1.70476 1.75238 1.8 1.87143 2.01429 2.15714 2.22857
4.58572 4.94286 5.22857 5.44286 5.58572 5.58572 5.39524 5.20477 5.01429
4.82381 4.63334 4.44286 4.25238 4.06191 3.8 3.72857 3.65715 3.65715
3.58572 3.58572 4.15715 4.51429 4.58572 4.72858 4.87143 5.08572 5.44286
;
#X coords 0 10 99 0 200 140 1;
#X restore 60 133 graph;
#N canvas 0 0 450 300 graph29 0;
#X array dest 100 float 0;
#X coords 0 100 99 0 200 140 1;
#X restore 547 129 graph;
#X obj 10 8 tabsort2;
#X text 75 9 2 dimensionnal sort.;
#X text 24 99 args: source_table1 source_table2 dest_table;
#X text 248 8 write to dest_table the indices of the first N source_table1's
elements sorted by decreasing order (biggest first) \, then sort the
"columns" of sqrt(N) indices decreasingly according to their values
in source_table2 (is it clear?).;
#N canvas 0 0 450 300 graph29 0;
#X array source2 100 float 1;
#A 0 7.71429 7.64286 7.64286 7.57143 7.5 7.35714 7.21428 6.92857 6.57143
6 5.71428 5.57143 5.21428 4.5 4.35714 4.28571 4.28571 4.28571 4.28571
4.28571 4.42857 4.57143 4.64285 4.78571 4.92857 5.14285 5.35714 5.71428
6 6.21428 6.42857 6.57143 6.64286 6.64286 6.64286 6.64286 6.57143 6.57143
6.42857 6.35714 6.28571 6.14286 5.92857 5.78571 5.64286 5.42857 7.85714
7.92857 8.42857 8.71428 8.92857 8.92857 8.92857 8.92857 8.85714 8.78571
8.78571 8.78571 8.5 8.28571 8.07143 7.5 7.28571 6.85714 6.57143 5.78571
5.5 5.21428 4.78571 4.64286 4.64286 4.78571 4.92857 5.07143 5.21428
5.42857 5.57143 5.71428 5.92857 6.28571 6.5 6.85714 7.14286 7.35714
7.64286 7.71429 7.78572 7.85714 7.85714 7.85714 7.71429 7.64286 7.5
7.35714 7.14286 7.07143 7 6.85714 4.5 -0.342857;
#X coords 0 10 99 0 200 140 1;
#X restore 311 131 graph;
#X msg 62 340 100;
#X obj 62 360 tabsort2 source1 source2 dest;
#X obj 500 416 tabread dest;
#X obj 452 362 * 10;
#X obj 500 391 +;
#X floatatom 451 346 5 0 9 0 - - -;
#X obj 528 361 t b f;
#X floatatom 528 344 5 0 9 0 - - -;
#X floatatom 407 485 0 0 0 0 - - -;
#X obj 407 465 tabread source1;
#X obj 557 467 tabread source2;
#X floatatom 557 487 0 0 0 0 - - -;
#X floatatom 527 393 5 0 0 0 - - -;
#X text 433 328 x(columns);
#X text 521 327 y(lines);
#X text 403 504 decrease with x;
#X text 555 505 decrease with y;
#X text 49 305 1) Sort it:;
#X text 381 304 2) Try it:;
#X text 8 520 (c) Antoine Rousseau 2002;
#X floatatom 603 441 5 0 0 0 - - -;
#X text 604 416 index of sources;
#X text 606 426 elements;
#X text 28 396 output=sqrt(N)=the width/height;
#X text 28 410 of the destination "square".;
#X text 61 326 sort the N first elements;
#X connect 8 0 9 0;
#X connect 9 0 0 0;
#X connect 10 0 17 0;
#X connect 10 0 18 0;
#X connect 10 0 28 0;
#X connect 11 0 12 0;
#X connect 12 0 10 0;
#X connect 12 0 20 0;
#X connect 13 0 11 0;
#X connect 14 0 12 0;
#X connect 14 1 12 1;
#X connect 15 0 14 0;
#X connect 17 0 16 0;
#X connect 18 0 19 0;