| 1 |
# test_TableOfReal_and_Permutation.praat |
| 2 |
# djmw 20210809 |
| 3 |
|
| 4 |
appendInfoLine: tab$, "test_TableOfReal_and_Permutation.praat" |
| 5 |
|
| 6 |
numberOfRows = 100 |
| 7 |
numberOfColumns = 10 |
| 8 |
|
| 9 |
p_rows = Create Permutation: "pr", numberOfRows, "no" |
| 10 |
p_rows# = List values |
| 11 |
p_cols = Create Permutation: "pc", numberOfColumns, "no" |
| 12 |
p_cols# = List values |
| 13 |
|
| 14 |
tor = Create TableOfReal: "t", numberOfRows, numberOfColumns |
| 15 |
Formula: "randomUniform (0,1)" |
| 16 |
|
| 17 |
selectObject: p_rows, tor |
| 18 |
tor_rows = Permute rows |
| 19 |
for irow to numberOfRows |
| 20 |
for icol to numberOfColumns |
| 21 |
assert object[tor_rows, irow, icol] = object [tor, p_rows# [irow] , icol] |
| 22 |
endfor |
| 23 |
endfor |
| 24 |
selectObject: p_cols, tor |
| 25 |
tor_cols = Permute columns |
| 26 |
for icol to numberOfColumns |
| 27 |
for irow to numberOfRows |
| 28 |
assert object[tor_cols, irow,icol] = object [tor, irow , p_cols#[icol]] |
| 29 |
endfor |
| 30 |
endfor |
| 31 |
removeObject: tor_cols, tor_rows, tor, p_cols, p_rows |
| 32 |
|
| 33 |
appendInfoLine: tab$, "test_TableOfReal_and_Permutation.praat OK" |
| 34 |
|