diff options
Diffstat (limited to 'src/algebra/crfp.spad.pamphlet')
-rw-r--r-- | src/algebra/crfp.spad.pamphlet | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/algebra/crfp.spad.pamphlet b/src/algebra/crfp.spad.pamphlet index b2291289..3d26fbbd 100644 --- a/src/algebra/crfp.spad.pamphlet +++ b/src/algebra/crfp.spad.pamphlet @@ -240,8 +240,7 @@ ComplexRootFindingPackage(R, UP): public == private where p := p quo monomial(1,md)$UP sP : Record(start: UP, factors: FR UP) := startPolynomial p fp : FR UP := sP.factors --- if not one? fp then - if not (fp = 1) then + if not one? fp then qr: Record(quotient: UP, remainder: UP):= divide(p,makeMonic expand fp) p := qr.quotient st := sP.start @@ -275,16 +274,14 @@ ComplexRootFindingPackage(R, UP): public == private where for fac in split.factors repeat fp := --- one? degree fac => fp * nilFactor(fac,1)$(FR UP) - (degree fac = 1) => fp * nilFactor(fac,1)$(FR UP) + one? degree fac => fp * nilFactor(fac,1)$(FR UP) fp * irreducibleFactor(fac,1)$(FR UP) fp startPolynomial p == -- assume minimumDegree is 0 --print (p :: OF) fp : FR UP := 1 --- one? degree p => - (degree p = 1) => + one? degree p => p := makeMonic p [p,irreducibleFactor(p,1)] startPoly : UP := monomial(1,1)$UP @@ -458,8 +455,7 @@ ComplexRootFindingPackage(R, UP): public == private where --eps0 : R := eps / den -- for now only eps0 : R := eps / (ten*ten) --- one? d => irreducibleFactor(poly,1)$(FR UP) - (d = 1) => irreducibleFactor(poly,1)$(FR UP) + one? d => irreducibleFactor(poly,1)$(FR UP) listOfFactors : L Record(factor: UP,exponent: I) :=_ list [makeMonic poly,1] if info then @@ -475,8 +471,7 @@ ComplexRootFindingPackage(R, UP): public == private where lof : L OF := ["just now we try to split the polynomial:",p::OF] print vconcat lof split : FR UP := pleskenSplit(p, eps0, info) --- one? numberOfFactors split => - (numberOfFactors split = 1) => + one? numberOfFactors split => -- in a later version we will change error bound and -- accuracy here to deal this case as well lof : L OF := ["factor: couldn't split factor",_ @@ -489,8 +484,7 @@ ComplexRootFindingPackage(R, UP): public == private where for rec in factors(split)$(FR UP) repeat newFactor : UP := rec.factor expOfFactor := exponentOfp * rec.exponent --- one? degree newFactor => - (degree newFactor = 1) => + one? degree newFactor => result := result * nilFactor(newFactor,expOfFactor) listOfFactors:=cons([newFactor,expOfFactor],_ listOfFactors) |