Module:No-1s limits: Difference between revisions
Dummy index (talk | contribs) mNo edit summary |
Dummy index (talk | contribs) No edit summary |
||
| Line 8: | Line 8: | ||
equave = equave or 2 | equave = equave or 2 | ||
local ratios = {} | local ratios = {} | ||
if rat.as_ratio(rat.modulo_mul(rat.new(q, 1), equave)) == '1/1' then return ratios end | |||
if previous then | if previous then | ||
for n = 2, q do | for n = 2, q do | ||
local a = rat.new(n, q) | if rat.as_ratio(rat.modulo_mul(rat.new(n, 1), equave)) ~= '1/1' then | ||
local a = rat.new(n, q) | |||
a = rat.modulo_mul(a, equave) | |||
local a_key = rat.as_ratio(a) | |||
local b = rat.new(q, n) | |||
b = rat.modulo_mul(b, equave) | |||
local b_key = rat.as_ratio(b) | |||
if previous[a_key] == nil then | |||
ratios[a_key] = a | |||
end | |||
if previous[b_key] == nil then | |||
ratios[b_key] = b | |||
end | |||
end | end | ||
end | end | ||
| Line 43: | Line 46: | ||
local check_norm = type(norm) == 'function' and type(max_norm) == 'number' | local check_norm = type(norm) == 'function' and type(max_norm) == 'number' | ||
local ratios = {} | local ratios = {} | ||
for n = | for n = 1, q do | ||
for m = | for m = 1, q do | ||
local a = rat.new(n, m) | local a = rat.new(n, m) | ||
if not check_norm or norm(a) <= max_norm then | if not check_norm or norm(a) <= max_norm then | ||
| Line 183: | Line 186: | ||
local val = {} | local val = {} | ||
for i = 1, lines do | for i = 1, lines do | ||
et = ET.parse('' .. i .. 'edo') | local et = ET.parse('' .. i .. 'edo') | ||
limit = p.consistency_limit(et, false, 43) | local limit = p.consistency_limit(et, false, 43) | ||
t_body[i] = string.format ("|-\n| %s\n| %s", i, limit) | t_body[i] = string.format ("|-\n| %s\n| %s", i, limit) | ||
end | end | ||