QAuxiliaryTools

qetatool.spad line 160 [edit on github]

Miscellaneous tools to deal with polynomials.

clearDenominator: Polynomial Fraction Integer -> Polynomial Integer

clearDenominator(p) multiplies the polynomial p over rational numbers with the least common multiple of the denominator of all its coefficients and returns the result as a polynomial over the integers.

index: (String, String) -> List Integer

index(s,i) returns the list integers encoded in the string s (and separated by one underscore) when the initial string i is removed. The function returns the empty list if the string does not start with the initial or has not the right format. It can be considered as the inverse of indexedSymbol. For the special case that s=i, the function returns [-1].

indexedSymbol: (String, List Integer) -> Symbol

indexedSymbol(s, l) returns a symbol with a name that starts with the string s and is directly followed by the numbers of l separated by underscores (“__”).

indexedSymbols: (String, List Integer) -> List Symbol

indexedSymbols(s, l) returns indexedSymbols(s, [[n] for n in l]).

indexedSymbols: (String, List List Integer) -> List Symbol

indexedSymbols(s, ll) returns [indexedSymbol(s,l) for l in ll].

indexedSymbols: (String, NonNegativeInteger) -> List Symbol

indexedSymbols(s, n) returns indexedSymbols(s, [i for i in 1..n])

integerPrimitivePart: Polynomial Fraction Integer -> Polynomial Integer

integerPrimitivePart(p) returns primitivePart(clearDenominator(p)).

level: (List String, String) -> Integer

level(vs,i) checks whether each of the strings in vs is of the form id or id_g with d and g positive integers and 0<=g<=d and returns the lcm of all d. In case of error, the function returns -1.

level: (List Symbol, String) -> Integer

level(vars,i) returns level([string v for v in vars],i).