diff --git a/books/bookvol10.4.pamphlet b/books/bookvol10.4.pamphlet index a8a5382..941bd90 100644 --- a/books/bookvol10.4.pamphlet +++ b/books/bookvol10.4.pamphlet @@ -137597,6 +137597,174 @@ RetractSolvePackage(Q, R): Exports == Implementation where @ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{package RFP RootsFindingPackage} +<>= +)set break resume +)sys rm -f RootsFindingPackage.output +)spool RootsFindingPackage.output +)set message test on +)set message auto off +)clear all + +--S 1 of 1 +)show RootsFindingPackage +--R RootsFindingPackage K: Field is a package constructor +--R Abbreviation for RootsFindingPackage is RFP +--R This constructor is exposed in this frame. +--R Issue )edit bookvol10.4.pamphlet to see algebra source code for RFP +--R +--R------------------------------- Operations -------------------------------- +--R foundZeroes : () -> List K setFoundZeroes : List K -> List K +--R distinguishedCommonRootsOf : (List SparseUnivariatePolynomial K,K) -> Record(zeros: List K,extDegree: Integer) +--R distinguishedRootsOf : (SparseUnivariatePolynomial K,K) -> Record(zeros: List K,extDegree: Integer) +--R +--E 1 + +)spool +)lisp (bye) +@ +<>= +==================================================================== +RootsFindingPackage examples +==================================================================== + +See Also: +o )show RootsFindingPackage + +@ +\pagehead{RootsFindingPackage}{RFP} +\pagepic{ps/v104rootsfindingpackage.ps}{RFP}{1.00} + +{\bf Exports:}\\ +\cross{RFP}{distinguishedCommonRootsOf} +\cross{RFP}{distinguishedRootsOf} +\cross{RFP}{foundZeroes} +\cross{RFP}{setFoundZeroes} + +<>= +)abbrev package RFP RootsFindingPackage +++ Authors: G. Hache +++ Date Created: 6 0ct 1994 +++ Date Last Updated: May 2010 by Tim Daly +++ Description: +++ This pacackage finds all the roots of a polynomial. If the constant field is +++ not large enough then it returns the list of found zeros and the degree +++ of the extension need to find the other roots missing. If the return +++ degree is 1 then all the roots have been found. If 0 is return +++ for the extension degree then there are an infinite number of zeros, +++ that is you ask for the zeroes of 0. In the case of infinite field +++ a list of all found zeros is kept and for each other call of a function +++ that finds zeroes, a check is made on that list; this is to keep +++ a kind of "canonical" representation of the elements. +RootsFindingPackage(K):P==T where + K:Field + + LIST ==> List + INT ==> Integer + NNI ==> NonNegativeInteger + MFINFACT ==> MultFiniteFactorize + FFFACTSE ==> FiniteFieldFactorizationWithSizeParseBySideEffect + SUP ==> SparseUnivariatePolynomial + REC ==> Record(zeros:List(K),extDegree:INT) + + P== with + + distinguishedRootsOf: (SUP(K),K) -> REC + ++ distinguishedRootsOf returns a record consisting of a list of zeros + ++ of the input polynomial followed by the smallest extension degree + ++ needed to find all the zeros. If K has + ++ \spad{PseudoAlgebraicClosureOfFiniteFieldCategory} or + ++ \spad{PseudoAlgebraicClosureOfRationalNumberCategory} then + ++ a root is created for each irreducible factor, and only these + ++ roots are returns and not their conjugate. + + distinguishedCommonRootsOf: (List SUP(K),K) -> REC + ++ distinguishedCommonRootsOf returns the common zeros of a list of + ++ polynomial. It returns a record as in distinguishedRootsOf. If 0 + ++ is returned as extension degree then there are an infinite number + ++ of common zeros (in this case, the polynomial 0 was given in the + ++ list of input polynomials). + + foundZeroes: () -> List K + ++ foundZeroes returns the list of already + ++ found zeros by the functions + ++ distinguishedRootsOf and + ++ distinguishedCommonRootsOf. + + setFoundZeroes: List K -> List K + ++ setFoundZeroes sets the list of foundZeroes to the given one. + + T== add + -- signature of local function + zeroOfLinearPoly: SUP(K) -> K + -- local variable + listOfAllZeros:List(K):=empty() + + foundZeroes==listOfAllZeros + + if K has PseudoAlgebraicClosureOfPerfectFieldCategory then + distinguishedRootsOf(polyZero, theExtension) == + --PRECONDITION: setExtension! is called in K to set the extension to + --the extension of factorization + zero?(polyZero) => + [empty(),0] + listOfZeros:List(K):=distinguishedRootsOf(polyZero,theExtension)$K + [listOfZeros,1] + + if K has FiniteFieldCategory and _ + ^(K has PseudoAlgebraicClosureOfFiniteFieldCategory) then + distinguishedRootsOf(polyZero,dummy)== + zero?(polyZero) => [empty(),0] + factorpolyZero:=factor(polyZero)$FFFACTSE(K,SUP(K)) + listOfFactor:=factorList(factorpolyZero) + listFact:= [pol.fctr for pol in listOfFactor] + degExt:INT:= + lcm(([degree(poly) for poly in listFact]) pretend LIST(INT)) + listOfZeros:List(K):=removeDuplicates_ + [zeroOfLinearPoly(poly) for poly in listFact | one?(degree(poly))] + [listOfZeros,degExt] + + if K has QuotientFieldCategory( Integer ) and _ + ^(K has PseudoAlgebraicClosureOfRationalNumberCategory) then + distinguishedRootsOf(polyZero,dummy)== + zero?(polyZero) => [empty(),0] + factorpolyZero:=factor(polyZero)$RationalFactorize( SUP(K) ) + listOfFactor:=factorList(factorpolyZero) + listFact:= [pol.fctr for pol in listOfFactor] + degExt:INT:= + lcm(([degree(poly) for poly in listFact]) pretend LIST(INT)) + listOfZeros:List(K):=removeDuplicates_ + [zeroOfLinearPoly(poly) for poly in listFact | one?(degree(poly))] + [listOfZeros,degExt] + + distinguishedCommonRootsOf(listOfPoly1,theExtension)== + listOfPoly:List(SUP(K)):=[pol for pol in listOfPoly1 | ^zero?(pol)] + empty?(listOfPoly) ==> [empty(),0] + reco:= distinguishedRootsOf(gcd(listOfPoly),theExtension) + listOfZeros:= reco.zeros + degExt:INT:= reco.extDegree + [listOfZeros,degExt] + + zeroOfLinearPoly(pol)== + ^one?(degree(pol)) => error "the polynomial is not linear" + listCoef:List(K):=coefficients(pol) + one?(#listCoef) => 0 + - last(listCoef) / first(listCoef) + + setFoundZeroes(setlist)== + oldListOfAllZeroes:= copy listOfAllZeros + listOfAllZeros:=setlist + oldListOfAllZeroes + + +@ +<>= +"RFP" [color="#FF4488",href="bookvol10.4.pdf#nameddest=RFP"] +"PACRATC" [color="#4488FF",href="bookvol10.2.pdf#nameddest=PACRATC"] +"RFP" -> "PACRATC" + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter S} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{package SAERFFC SAERationalFunctionAlgFactor} @@ -155234,6 +155402,7 @@ ZeroDimensionalSolvePackage(R,ls,ls2): Exports == Implementation where <> <> <> +<> <> <> diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 342f9f2..d8f951b 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -24131,6 +24131,7 @@ otherwise the new algebra won't be loaded by the interpreter when needed. (|RewriteRule| . RULE) (|RightOpenIntervalRootCharacterization| . ROIRC) (|RomanNumeral| . ROMAN) + (|RootsFindingPackage| . RFP) (|Ruleset| . RULESET) (|ScriptFormulaFormat| . FORMULA) (|ScriptFormulaFormat1| . FORMULA1) diff --git a/books/ps/v104rootsfindingpackage.ps b/books/ps/v104rootsfindingpackage.ps new file mode 100644 index 0000000..cca9c2d --- /dev/null +++ b/books/ps/v104rootsfindingpackage.ps @@ -0,0 +1,18 @@ +.if !dPS .ds PS +.if !dPE .ds PE +.lf 1 - +digraph pic { + fontsize=10; + bgcolor=yellow + node [shape=box, color=lightblue, style=filled]; + +"RFP" [color="#FF4488",href="bookvol10.4.pdf#nameddest=RFP"] +"PACRATC" [color="#4488FF",href="bookvol10.2.pdf#nameddest=PACRATC"] +"RFP" -> "PACRATC" + +} + + + + + diff --git a/changelog b/changelog index 7a9140c..5449dce 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,8 @@ +20100511 tpd src/axiom-website/patches.html 20100511.03.tpd.patch +20100511 tpd books/ps/v104rootsfindingpackage.ps added +20100511 tpd src/algebra/Makefile help and test files for RootsFindingPackage +20100511 tpd books/bookvol5 expose RootsFindingPackage +20100511 tpd books/bookvol10.4 add RootsFindingPackage 20100511 tpd src/axiom-website/patches.html 20100511.02.tpd.patch 20100511 tpd books/bookvolbib add Assia Mahboubi [Mah05] 20100511 tpd src/axiom-website/patches.html 20100511.01.tpd.patch diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index ee5a247..80f7d2f 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -8754,7 +8754,8 @@ LAYER12=\ ${OUT}/DIAGG.o ${OUT}/DIAGG-.o ${OUT}/DSMP.o ${OUT}/EXPUPXS.o \ ${OUT}/FACTRN.o ${OUT}/FFFACTSE.o \ ${OUT}/FRAMALG.o ${OUT}/FRAMALG-.o ${OUT}/MDAGG.o ${OUT}/ODPOL.o \ - ${OUT}/PLOT.o ${OUT}/RMCAT2.o ${OUT}/ROIRC.o ${OUT}/SDPOL.o \ + ${OUT}/PLOT.o ${OUT}/RFP.o \ + ${OUT}/RMCAT2.o ${OUT}/ROIRC.o ${OUT}/SDPOL.o \ ${OUT}/SMATCAT.o ${OUT}/SMATCAT-.o ${OUT}/TUBETOOL.o ${OUT}/UPXSCCA.o \ ${OUT}/UPXSCCA-.o \ layer12done @@ -8937,6 +8938,24 @@ LAYER12=\ /*"PLOT" -> {"ELEMFUN"; "SPFCAT"}*/ "PLOT" -> "FRAC" +"RFP" [color="#FF4488",href="bookvol10.4.pdf#nameddest=RFP"] +/*"RFP" -> {"FIELD"; "EUCDOM"; "PID"; "GCDDOM"; "INTDOM"; "COMRING"; "RING"}*/ +/*"RFP" -> {"RNG"; "ABELGRP"; "CABMON"; "ABELMON"; "ABELSG"; "SETCAT"}*/ +/*"RFP" -> {"BASTYPE"; "KOERCE"; "SGROUP"; "MONOID"; "LMODULE"; "BMODULE"}*/ +/*"RFP" -> {"RMODULE"; "ALGEBRA"; "MODULE"; "ENTIRER"; "UFD"; "DIVRING"}*/ +/*"RFP" -> {"INT"; "LIST"; "ILIST"; "PACPERC"; "FFIELDC"; "FPC"; "CHARNZ"}*/ +/*"RFP" -> {"FINITE"; "STEP"; "DIFRING"; "PACFFC"; "UPOLYC"; "POLYCAT"}*/ +/*"RFP" -> {"PDRING"; "FAMR"; "AMR"; "CHARZ"; "FRETRCT"; "RETRACT"; "EVALAB"}*/ +/*"RFP" -> {"IEVALAB"; "FLINEXP"; "LINEXP"; "ORDSET"; "KONVERT"; "PATMAB"}*/ +/*"RFP" -> {"PFECAT"; "ELTAB"; "DIFEXT"; "INS-"; "EUCDOM-"; "UFD-"}*/ +/*"RFP" -> {"GCDDOM-"; "LSAGG"; "STAGG"; "URAGG"; "RCAGG"; "HOAGG"; "AGG"}*/ +/*"RFP" -> {"TYPE"; "LNAGG"; "IXAGG"; "ELTAGG"; "CLAGG"; "FLAGG"; "ELAGG"}*/ +/*"RFP" -> {"OM"; "LSAGG-"; "STAGG-"; "ELAGG-"; "QFCAT"; "FEVALAB"; "PATAB"}*/ +/*"RFP" -> {"FPATMAB"; "OINTDOM"; "ORDRING"; "OAGROUP"; "OCAMON"; "OAMON"}*/ +/*"RFP" -> {"OASGP"; "REAL"; "INS"; "CFCAT"}*/ +"RFP" -> "PACRATC" +/*"RFP" -> {"XF"; "VSPACE"; "BOOLEAN"; "NNI"; "FLAGG-"; "URAGG-"}*/ + "RMCAT2" [color="#FF4488",href="bookvol10.4.pdf#nameddest=RMCAT2"] /*"RMCAT2" -> {"RING"; "RNG"; "ABELGRP"; "CABMON"; "ABELMON"; "ABELSG"}*/ /*"RMCAT2" -> {"SETCAT"; "BASTYPE"; "KOERCE"; "SGROUP"; "MONOID"; "LMODULE"}*/ @@ -16086,6 +16105,21 @@ ${MID}/LOP.nrlib/code.o: ${MID}/LOP.spad | ${INTERPSYS} >${TMP}/trace ; \ fi ) @ +<>= + +RFPDEPS = PACPERC PACFFC PACRATC FFFACTSE + +${MID}/RFP.nrlib/code.o: ${MID}/RFP.spad + @echo P3 making ${MID}/RFP.nrlib/code.o from ${MID}/RFP.spad + @ (cd ${MID} ; \ + if [ -z "${NOISE}" ] ; then \ + echo -e ")lib ${RFPDEPS} \n )co RFP.spad" \ + | ${INTERPSYS} ; \ + else \ + echo -e ")lib ${RFPDEPS} \n )co RFP.spad" \ + | ${INTERPSYS} >${TMP}/trace ; \ + fi ) +@ \section{Broken Files} These files are Aldor files @@ -16915,6 +16949,7 @@ SPADHELP=\ ${HELP}/RealSolvePackage.help \ ${HELP}/RegularTriangularSet.help \ ${HELP}/RomanNumeral.help \ + ${HELP}/RootsFindingPackage.help \ ${HELP}/Segment.help \ ${HELP}/SegmentBinding.help \ ${HELP}/Set.help \ @@ -17069,6 +17104,7 @@ REGRESS= \ RealSolvePackage.regress \ RegularTriangularSet.regress \ RomanNumeral.regress \ + RootsFindingPackage.regress \ Segment.regress \ Set.regress \ SingleInteger.regress \ @@ -18457,6 +18493,17 @@ ${HELP}/RomanNumeral.help: ${BOOKS}/bookvol10.3.pamphlet >${INPUT}/RomanNumeral.input @echo "RomanNumeral (ROMAN)" >>${HELPFILE} +${HELP}/RootsFindingPackage.help: ${BOOKS}/bookvol10.4.pamphlet + @echo 8005 create RootsFindingPackage.help from \ + ${BOOKS}/bookvol10.4.pamphlet + @${TANGLE} -R"RootsFindingPackage.help" ${BOOKS}/bookvol10.4.pamphlet \ + >${HELP}/RootsFindingPackage.help + @cp ${HELP}/RootsFindingPackage.help ${HELP}/RFP.help + @${TANGLE} -R"RootsFindingPackage.input" \ + ${BOOKS}/bookvol10.4.pamphlet \ + >${INPUT}/RootsFindingPackage.input + @echo "RootsFindingPackage (RFP)" >>${HELPFILE} + ${HELP}/Segment.help: ${BOOKS}/bookvol10.3.pamphlet @echo 8010 create Segment.help from ${BOOKS}/bookvol10.3.pamphlet @${TANGLE} -R"Segment.help" ${BOOKS}/bookvol10.3.pamphlet \ diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index da6b828..0cbdd3f 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2687,5 +2687,7 @@ books/bookvol10.4 add FactorisationOverPseudoAlgebraicClosureOfAlgExtOfRationalN books/bookvol10.4 add LinesOpPack
20100511.02.tpd.patch books/bookvolbib add Assia Mahboubi [Mah05]
+20100511.03.tpd.patch +books/bookvol10.4 add RootsFindingPackage