aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/polycat.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-03-10 18:14:47 +0000
committerdos-reis <gdr@axiomatics.org>2011-03-10 18:14:47 +0000
commit3018eca8731c1ebfc07487d6ba305c82090b4dca (patch)
tree2977f65419c43b201a65e63a8bcf55dfaa443639 /src/algebra/polycat.spad.pamphlet
parentd39e317cd51e0f251d485df1948e2a85a4007048 (diff)
downloadopen-axiom-3018eca8731c1ebfc07487d6ba305c82090b4dca.tar.gz
* algebra/catdef.spad.pamphlet (CharacteristicNonZero)
[charthRoot]: Now return Maybe %. (PolynomialFactorizationExplicit) [charthRoot]: Likewise. * algebra/ffcat.spad.pamphlet (FiniteAlgebraicExtensionField): Propagate change. * algebra/fraction.spad.pamphlet (Fraction) [charthRoot]: Likewise. * algebra/poly.spad.pamphlet (UnivariatePolynomialSquareFree): Likewise. * algebra/polycat.spad.pamphlet (PolynomialCategory): Likewise.
Diffstat (limited to 'src/algebra/polycat.spad.pamphlet')
-rw-r--r--src/algebra/polycat.spad.pamphlet18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/algebra/polycat.spad.pamphlet b/src/algebra/polycat.spad.pamphlet
index 499b3903..140fc069 100644
--- a/src/algebra/polycat.spad.pamphlet
+++ b/src/algebra/polycat.spad.pamphlet
@@ -520,36 +520,36 @@ PolynomialCategory(R:Ring, E:OrderedAbelianMonoidSup, VarSet:OrderedSet):
for mons in monslist]
if R has CharacteristicNonZero then
- charthRootlv: (%,List VarSet,NonNegativeInteger) -> Union(%,"failed")
+ charthRootlv: (%,List VarSet,NonNegativeInteger) -> Maybe %
charthRoot p ==
vars:= variables p
empty? vars =>
ans := charthRoot ground p
- ans case "failed" => "failed"
- ans::R::%
+ ans case nothing => nothing
+ just(ans::R::%)
ch:=characteristic$%
charthRootlv(p,vars,ch)
charthRootlv(p,vars,ch) ==
empty? vars =>
ans := charthRoot ground p
- ans case "failed" => "failed"
- ans::R::%
+ ans case nothing => nothing
+ just(ans::R::%)
v:=first vars
vars:=rest vars
d:=degree(p,v)
ans:% := 0
while (d>0) repeat
(dd:=(d::Integer exquo ch::Integer)) case "failed" =>
- return "failed"
+ return nothing
cp:=coefficient(p,v,d)
p:=p-monomial(cp,v,d)
ansx:=charthRootlv(cp,vars,ch)
- ansx case "failed" => return "failed"
+ ansx case nothing => return nothing
d:=degree(p,v)
ans:=ans+monomial(ansx,v,dd::Integer::NonNegativeInteger)
ansx:=charthRootlv(p,vars,ch)
- ansx case "failed" => return "failed"
- return ans+ansx
+ ansx case nothing => return nothing
+ return just(ans+ansx)
monicDivide(p1,p2,mvar) ==
result:=monicDivide(univariate(p1,mvar),univariate(p2,mvar))