/usr/share/axiom-20170501/src/algebra/COMPFACT.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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | )abbrev package COMPFACT ComplexFactorization
++ Description:
++ This package has no description
ComplexFactorization(RR,PR) : SIG == CODE where
RR : EuclideanDomain -- R is Z or Q
PR : UnivariatePolynomialCategory Complex RR
R ==> Complex RR
I ==> Integer
RN ==> Fraction I
GI ==> Complex I
GRN ==> Complex RN
SIG ==> with
factor : PR -> Factored PR
++ factor(p) factorizes the polynomial p with complex coefficients.
CODE ==> add
SUP ==> SparseUnivariatePolynomial
fUnion ==> Union("nil", "sqfr", "irred", "prime")
FF ==> Record(flg:fUnion, fctr:PR, xpnt:Integer)
SAEF := SimpleAlgebraicExtensionAlgFactor(SUP RN,GRN,SUP GRN)
UPCF2 := UnivariatePolynomialCategoryFunctions2(R,PR,GRN,SUP GRN)
UPCFB := UnivariatePolynomialCategoryFunctions2(GRN,SUP GRN,R,PR)
myMap(r:R) : GRN ==
R is GI =>
cr :GI := r pretend GI
complex((real cr)::RN,(imag cr)::RN)
R is GRN => r pretend GRN
compND(cc:GRN):Record(cnum:GI,cden:Integer) ==
ccr:=real cc
cci:=imag cc
dccr:=denom ccr
dcci:=denom cci
ccd:=lcm(dccr,dcci)
[complex(((ccd exquo dccr)::Integer)*numer ccr,
((ccd exquo dcci)::Integer)*numer cci),ccd]
conv(f:SUP GRN) :Record(convP:SUP GI, convD:RN) ==
pris:SUP GI :=0
dris:Integer:=1
dris1:Integer:=1
pdris:Integer:=1
for i in 0..(degree f) repeat
(cf:= coefficient(f,i)) = 0 => "next i"
cdf:=compND cf
dris:=lcm(cdf.cden,dris1)
pris:=((dris exquo dris1)::Integer)*pris +
((dris exquo cdf.cden)::Integer)*
monomial(cdf.cnum,i)$(SUP GI)
dris1:=dris
[pris,dris::RN]
backConv(ffr:Factored SUP GRN) : Factored PR ==
R is GRN =>
makeFR((unit ffr) pretend PR,[[f.flg,(f.fctr) pretend PR,f.xpnt]
for f in factorList ffr])
R is GI =>
const:=unit ffr
ris: List FF :=[]
for ff in factorList ffr repeat
fact:=primitivePart(conv(ff.fctr).convP)
expf:=ff.xpnt
ris:=cons([ff.flg,fact pretend PR,expf],ris)
lc:GRN := myMap leadingCoefficient(fact pretend PR)
const:= const*(leadingCoefficient(ff.fctr)/lc)**expf
uconst:GI:= compND(coefficient(const,0)).cnum
makeFR((uconst pretend R)::PR,ris)
factor(pol : PR) : Factored PR ==
ratPol:SUP GRN := 0
ratPol:=map(myMap,pol)$UPCF2
ffr:=factor ratPol
backConv ffr
|