Debian Codegraph @

test/speed/sum.praat

raw
1 writeInfoLine: "sum..."
2
3 for i from 2 to 1000
4 assert sum (linear# (1, i, i, 0)) = sum (linear# (1, i - 1, i - 1, 0)) + i ; 'i'
5 endfor
6
7 for i from 1 to 10
8 appendInfoLine: sum (linear# (1, i, i, 0)), " ", mean (linear# (1, i, i, 0))
9 assert sum (linear# (1, i, i, 0)) = i * mean (linear# (1, i, i, 0)) ; 'i'
10 endfor
11
12 numberOfChecks = 100
13 durations# = zero# (numberOfChecks)
14 for n from 1 to numberOfChecks
15 result$ = Praat test: "TimeSum", string$ (10^8 / n), string$ (n), "", ""
16 durations# [n] = extractNumber (result$, newline$)
17 appendInfoLine (n, " ", durations# [n])
18 endfor
19
20 appendInfoLine: "mean ", mean (durations#), " Gflop/s"
21
22 ;for n to 1000
23 appendInfoLine: "OK"