removed useless file
[qmc.git] / len.lua
blob10bb09dd1721cd268eaf3e1125f63c3dff6f7812
1 #!/usr/bin/lua
3 local f, s, e, d, c = ...
5 if f=='-h' or f=='--help' then
6 io.stderr:write([[
7 usage: ]]..arg[0]..[[ <f> <s> <e> <d> <c>
8 <f> file on which to compute
9 <s> (default 10) starting value of alpha
10 <e> (default 500) final value of alpha
11 <d> (default 10) stepping value of alpha
12 <c> (default 3.7) correction value
13 ]])
14 return
15 end
17 s = (s or 10)
18 e = (e or 500)
19 d = (d or 10)
20 c = (c or 3.0)
22 local digits = #tostring(s)
23 if digits < #tostring(e) then
24 digits = #tostring(e)
25 end
27 s, e, d, c = tonumber(s), tonumber(e), tonumber(d), tonumber(c)
29 for l = s, e, d do
30 l = string.format('%.'..tostring(digits)..'i', l)
31 print('==== length = '..l..' ====')
32 os.execute('time ./compute_weights '..f..' -l '..l..' -c '..c)
33 print()
34 end