Module:Scale tree: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
Scale tree automatically adds "(Generators smaller than this are proper)" to appropriate mosses
Line 5: Line 5:
local rat = require('Module:Rational')
local rat = require('Module:Rational')
local sb = require('Module:SB tree')
local sb = require('Module:SB tree')
local utils = require('Module:Utils')


-- Helper function that parses entries from a semicolon-delimited string and returns them in an array
-- Helper function that parses entries from a semicolon-delimited string and returns them in an array
Line 55: Line 56:
local L = mos.nL
local L = mos.nL
local s = mos.ns
local s = mos.ns
local n = utils._gcd(L, s)
local collapsed_et = ET.new(L, equave)
local collapsed_et = ET.new(L, equave)
local abstract_bright_gen = MOS.bright_gen(mos)
local abstract_bright_gen = MOS.bright_gen(mos)
Line 76: Line 78:
default_comments["4/1"] = "Superhard " .. MOS.as_string(mos)
default_comments["4/1"] = "Superhard " .. MOS.as_string(mos)
default_comments["1/0"] = "Collapsed " .. MOS.as_string(mos)
default_comments["1/0"] = "Collapsed " .. MOS.as_string(mos)
-- Default comment for L:s = 2:1 has an extra line: "(Generators smaller than this are proper)"
-- This comment should not be added to the following mosses:
-- - Mosses of the form xL 1s, as they are always proper
-- - Mosses of the form nxL ns, as mosses of the true form are always proper
if s ~= n then
default_comments["2/1"] = default_comments["2/1"] .. "<br>(Generators smaller than this are proper)"
end
-- Get comments
-- Get comments