diff options
Diffstat (limited to 'src/algebra/galfact.spad.pamphlet')
-rw-r--r-- | src/algebra/galfact.spad.pamphlet | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/algebra/galfact.spad.pamphlet b/src/algebra/galfact.spad.pamphlet index 0e06b615..92ad2d65 100644 --- a/src/algebra/galfact.spad.pamphlet +++ b/src/algebra/galfact.spad.pamphlet @@ -260,8 +260,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where tc := leadingCoefficient rf rf := reductum rf for p in factors(factor c)$Factored(Z) repeat --- if (one? p.exponent) and (not zero? (lc rem p.factor)) and - if (p.exponent = 1) and (not zero? (lc rem p.factor)) and + if (one? p.exponent) and (not zero? (lc rem p.factor)) and (not zero? (tc rem ((p.factor)**2))) then return true false @@ -298,8 +297,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where fullSet(n:N):Set N == set [ i for i in 0..n ] modularFactor(p:UP):MFact == --- not one? abs(content(p)) => - not (abs(content(p)) = 1) => + not one? abs(content(p)) => error "modularFactor: the polynomial is not primitive." zero? (n := degree p) => [0,[p]] @@ -462,8 +460,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where degf := degree f d := select(#1<=degf,d) if degf<=1 then -- lf exhausted --- if one? degf then - if (degf = 1) then + if one? degf then ltrue := cons(f,ltrue) return ltrue -- 1st exit, all factors found else -- can we go on with the same pk? @@ -576,8 +573,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where b := b+(r::Z) a := 2*a d := gcd(a,b) --- if not one? d then - if not (d = 1) then + if not one? d then a := a quo d b := b quo d f: UP := monomial(a,1)+monomial(b,0) @@ -616,8 +612,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where zero? d => [c,factorlist]$FinalFact -- is f linear? --- one? d => [c,cons([f,1]$ParFact,factorlist)]$FinalFact - (d = 1) => [c,cons([f,1]$ParFact,factorlist)]$FinalFact + one? d => [c,cons([f,1]$ParFact,factorlist)]$FinalFact lcPol: UP := leadingCoefficient(f) :: UP @@ -654,8 +649,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where mult := sqfr.exponent sqff := sqfr.factor d := degree sqff --- one? d => factorlist := cons([sqff,mult]$ParFact,factorlist) - (d = 1) => factorlist := cons([sqff,mult]$ParFact,factorlist) + one? d => factorlist := cons([sqff,mult]$ParFact,factorlist) d=2 => factorlist := append([[pf,mult]$ParFact for pf in quadratic(sqff)], factorlist) @@ -689,8 +683,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where zero? d => [c,factorlist]$FinalFact -- is f linear? --- one? d => [c,cons([f,1]$ParFact,factorlist)]$FinalFact - (d = 1) => [c,cons([f,1]$ParFact,factorlist)]$FinalFact + one? d => [c,cons([f,1]$ParFact,factorlist)]$FinalFact lcPol: UP := leadingCoefficient(f) :: UP @@ -723,8 +716,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where -- f is not square-free : sqfflist := factors squareFree(f) --- if one?(#(sqfflist)) then -- indeed f was a power of a square-free - if ((#(sqfflist)) = 1) then -- indeed f was a power of a square-free + if one?(#(sqfflist)) then -- indeed f was a power of a square-free r := max(r quo ((first sqfflist).exponent),2)::N else r := 2 @@ -732,8 +724,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where mult := sqfr.exponent sqff := sqfr.factor d := degree sqff --- one? d => - (d = 1) => + one? d => factorlist := cons([sqff,mult]$ParFact,factorlist) maxd := (max(fd)-mult)::N fd := select(#1<=maxd,fd) @@ -798,8 +789,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where factorOfDegree(d:P,p:UP,ld:List N,r:N,sqf:Boolean):Union(UP,"failed") == dp := degree p errorsum?(dp,ld) => error "factorOfDegree: Bad arguments" --- (one? (d::N)) and noLinearFactor?(p) => "failed" - ((d::N) = 1) and noLinearFactor?(p) => "failed" + (one? (d::N)) and noLinearFactor?(p) => "failed" lf := btwFact(p,sqf,makeSet(ld),r).factors for f in lf repeat degree(f.irr)=d => return f.irr |