Module:Uniform map: Difference between revisions
m Fix error message |
m Fixing more bugs... |
||
| Line 73: | Line 73: | ||
-- Generate table of p-limit uniform maps between min and max, for use with print_table | -- Generate table of p-limit uniform maps between min and max, for use with print_table | ||
function make_table(p, min, max) | function make_table(p, min, max) | ||
maptable = {} -- Reset table | |||
for i=1, u.index_of(primes, p) do | |||
map[i] = 0 -- Reset to p-limit null map | |||
lower[i] = 0 | |||
upper[i] = 0 | |||
end | |||
map = simple_map(min, p) -- Set p-limit map for minimum size | |||
lb = lowerbound(map) -- Update minimum size for new map | |||
ub = upperbound(map) -- Update maximum size for new map | |||
row = {'Min. size', 'Max. size', '[[Wart notation]]'} | |||
for i=1, #map do | |||
table.insert(row, primes[i]) | |||
end | |||
table.insert(maptable, row) | |||
while lb < max do | |||
row = {string.format("%.4f", lb), string.format("%.4f", ub), wart(map)} | |||
for j=1, #map do | |||
table.insert(row, map[j]) | |||
end | end | ||
table.insert(maptable, row) | table.insert(maptable, row) | ||
map[pbi] = map[pbi] + 1 | |||
lb = lowerbound(map) | |||
ub = upperbound(map) | |||
end | end | ||
return maptable | |||
end | end | ||
| Line 112: | Line 108: | ||
function p._print_table(p, min, max) | function p._print_table(p, min, max) | ||
if u.index_of(primes, u.eval_num_arg(p, 5)) == nil then | if u.index_of(primes, u.eval_num_arg(p, 5)) == nil then | ||
p = 5 -- Default to 5-limit | |||
end | end | ||
luatable = make_table(p, u.eval_num_arg(min, 11.5), u.eval_num_arg(max, 12.5)) | luatable = make_table(p, u.eval_num_arg(min, 11.5), u.eval_num_arg(max, 12.5)) | ||