Debian Codegraph @

dwtest/test_SSCP.praat

raw
1 # test_SSCP.praat
2 # djmw 20181218
3
4 appendInfoLine: tab$, "test_SSCP.praat "
5
6 @test_TableOfReal_to_SSCP_rowWeights
7
8 appendInfoLine: tab$, "test_SSCP.praat OK"
9
10 procedure test_TableOfReal_to_SSCP_rowWeights
11 .tor = Create TableOfReal: "table", 3 , 3
12 Formula: "(col -1) * nrow + row"
13 Formula: "if col = 3 then 1 else self endif"
14 .sscp = To SSCP (row weights): 1, 3, 1, 2, 3
15 for .i to 2
16 for .j to 2
17 assert object[.sscp, .i, .j] = 2; '.i', '.j'
18 endfor
19 endfor
20 selectObject: .tor
21 Formula: "if col=3 then row^2 else self fi"
22 .sscp2 = To SSCP (row weights): 1, 3, 1, 2, 3
23 for .i to 2
24 for .j to 2
25 assert object[.sscp2, .i, .j] = 10; '.i', '.j'
26 endfor
27 endfor
28 removeObject: .tor, .sscp, .sscp2
29 endproc