/usr/share/axiom-20170501/src/algebra/CINTSLPE.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | )abbrev package CINTSLPE ComplexIntegerSolveLinearPolynomialEquation
++ Author: James Davenport
++ Date Created: 1990
++ Description:
++ This package provides the generalized euclidean algorithm which is
++ needed as the basic step for factoring polynomials.
ComplexIntegerSolveLinearPolynomialEquation(R,CR) : SIG == CODE where
R : IntegerNumberSystem
CR : ComplexCategory(R)
CP ==> SparseUnivariatePolynomial CR
SIG ==> with
solveLinearPolynomialEquation : (List CP,CP) -> Union(List CP,"failed")
++ solveLinearPolynomialEquation([f1, ..., fn], g)
++ where (fi relatively prime to each other)
++ returns a list of ai such that
++ g = sum ai prod fj (j \= i) or
++ equivalently g/prod fj = sum (ai/fi)
++ or returns "failed" if no such list exists
CODE ==> add
oldlp:List CP := []
slpePrime:R:=(2::R)
oldtable:Vector List CP := empty()
solveLinearPolynomialEquation(lp,p) ==
if (oldlp ^= lp) then
-- we have to generate a new table
deg:= _+/[degree u for u in lp]
ans:Union(Vector List CP,"failed"):="failed"
slpePrime:=67108859::R -- 2**26 -5 : a prime
-- a good test case for this package is
-- (good question?)
while (ans case "failed") repeat
ans:=tablePow(deg,complex(slpePrime,0),lp)$GenExEuclid(CR,CP)
if (ans case "failed") then
slpePrime:= slpePrime-4::R
while not prime?(slpePrime)$IntegerPrimesPackage(R) repeat
slpePrime:= slpePrime-4::R
oldtable:=(ans:: Vector List CP)
answer:=solveid(p,complex(slpePrime,0),oldtable)
answer
|