diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet index 68efdfc..2c410f0 100644 --- a/books/bookvol10.3.pamphlet +++ b/books/bookvol10.3.pamphlet @@ -64419,6 +64419,613 @@ MyUnivariatePolynomial(x:Symbol, R:Ring): %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Chapter N} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{domain NSDPS NeitherSparseOrDensePowerSeries} +<>= +)set break resume +)sys rm -f NeitherSparseOrDensePowerSeries.output +)spool NeitherSparseOrDensePowerSeries.output +)set message test on +)set message auto off +)clear all + +--S 1 of 1 +)show NeitherSparseOrDensePowerSeries +--R NeitherSparseOrDensePowerSeries K: Field is a domain constructor +--R Abbreviation for NeitherSparseOrDensePowerSeries is NSDPS +--R This constructor is exposed in this frame. +--R Issue )edit bookvol10.3.pamphlet to see algebra source code for NSDPS +--R +--R------------------------------- Operations -------------------------------- +--R ?*? : (%,K) -> % ?*? : (K,%) -> % +--R ?*? : (Fraction Integer,%) -> % ?*? : (%,Fraction Integer) -> % +--R ?*? : (%,%) -> % ?*? : (Integer,%) -> % +--R ?*? : (PositiveInteger,%) -> % ?**? : (%,Integer) -> % +--R ?**? : (%,PositiveInteger) -> % ?+? : (%,%) -> % +--R ?-? : (%,%) -> % -? : % -> % +--R ?/? : (%,%) -> % ?=? : (%,%) -> Boolean +--R 1 : () -> % 0 : () -> % +--R ?^? : (%,Integer) -> % ?^? : (%,PositiveInteger) -> % +--R associates? : (%,%) -> Boolean center : % -> K +--R children : % -> List % coefOfFirstNonZeroTerm : % -> K +--R coefficient : (%,Integer) -> K coerce : Fraction Integer -> % +--R coerce : % -> % coerce : Integer -> % +--R coerce : % -> OutputForm complete : % -> % +--R concat : (%,%) -> % concat : List % -> % +--R copy : % -> % cycleEntry : % -> % +--R cycleTail : % -> % cyclic? : % -> Boolean +--R degree : % -> Integer delay : (() -> %) -> % +--R delete : (%,Integer) -> % distance : (%,%) -> Integer +--R ?.rest : (%,rest) -> % ?.? : (%,Integer) -> K +--R empty : () -> % empty? : % -> Boolean +--R eq? : (%,%) -> Boolean explicitEntries? : % -> Boolean +--R explicitlyEmpty? : % -> Boolean explicitlyFinite? : % -> Boolean +--R extend : (%,Integer) -> % factor : % -> Factored % +--R filterUpTo : (%,Integer) -> % findCoef : (%,Integer) -> K +--R gcd : List % -> % gcd : (%,%) -> % +--R hash : % -> SingleInteger index? : (Integer,%) -> Boolean +--R indices : % -> List Integer insert : (%,%,Integer) -> % +--R inv : % -> % latex : % -> String +--R lazy? : % -> Boolean lazyEvaluate : % -> % +--R lcm : List % -> % lcm : (%,%) -> % +--R leadingCoefficient : % -> K leadingMonomial : % -> % +--R leaf? : % -> Boolean map : ((K -> K),%) -> % +--R monomial : (K,Integer) -> % monomial? : % -> Boolean +--R nodes : % -> List % one? : % -> Boolean +--R order : % -> Integer order : % -> Integer +--R order : (%,Integer) -> Integer pole? : % -> Boolean +--R posExpnPart : % -> % possiblyInfinite? : % -> Boolean +--R prime? : % -> Boolean printInfo : () -> Boolean +--R printInfo : Boolean -> Boolean ?quo? : (%,%) -> % +--R recip : % -> Union(%,"failed") reductum : % -> % +--R ?rem? : (%,%) -> % removeFirstZeroes : % -> % +--R removeZeroes : % -> % removeZeroes : (Integer,%) -> % +--R rest : % -> % rst : % -> % +--R sample : () -> % sbt : (%,%) -> % +--R series : (Integer,K,%) -> % shift : (%,Integer) -> % +--R sizeLess? : (%,%) -> Boolean squareFree : % -> Factored % +--R squareFreePart : % -> % tail : % -> % +--R truncate : (%,Integer) -> % unit? : % -> Boolean +--R unitCanonical : % -> % variable : % -> Symbol +--R zero? : % -> Boolean ?~=? : (%,%) -> Boolean +--R #? : % -> NonNegativeInteger if $ has finiteAggregate +--R ?*? : (NonNegativeInteger,%) -> % +--R ?**? : (%,NonNegativeInteger) -> % +--R ?/? : (%,K) -> % if K has FIELD +--R D : (%,List Symbol,List NonNegativeInteger) -> % if K has *: (Integer,K) -> K and K has PDRING SYMBOL +--R D : (%,Symbol,NonNegativeInteger) -> % if K has *: (Integer,K) -> K and K has PDRING SYMBOL +--R D : (%,List Symbol) -> % if K has *: (Integer,K) -> K and K has PDRING SYMBOL +--R D : (%,Symbol) -> % if K has *: (Integer,K) -> K and K has PDRING SYMBOL +--R D : (%,NonNegativeInteger) -> % if K has *: (Integer,K) -> K +--R D : % -> % if K has *: (Integer,K) -> K +--R ?^? : (%,NonNegativeInteger) -> % +--R any? : ((Record(k: Integer,c: K) -> Boolean),%) -> Boolean if $ has finiteAggregate +--R approximate : (%,Integer) -> K if K has **: (K,Integer) -> K and K has coerce: Symbol -> K +--R characteristic : () -> NonNegativeInteger +--R charthRoot : % -> Union(%,"failed") if K has CHARNZ +--R child? : (%,%) -> Boolean if Record(k: Integer,c: K) has SETCAT +--R coerce : % -> Stream Record(k: Integer,c: K) +--R coerce : Stream Record(k: Integer,c: K) -> % +--R coerce : K -> % if K has COMRING +--R concat : (Record(k: Integer,c: K),%) -> % +--R concat : (%,Record(k: Integer,c: K)) -> % +--R concat! : (%,%) -> % if $ has shallowlyMutable +--R concat! : (%,Record(k: Integer,c: K)) -> % if $ has shallowlyMutable +--R construct : List Record(k: Integer,c: K) -> % +--R convert : % -> InputForm if Record(k: Integer,c: K) has KONVERT INFORM +--R count : ((Record(k: Integer,c: K) -> Boolean),%) -> NonNegativeInteger if $ has finiteAggregate +--R count : (Record(k: Integer,c: K),%) -> NonNegativeInteger if $ has finiteAggregate and Record(k: Integer,c: K) has SETCAT +--R cycleLength : % -> NonNegativeInteger +--R cycleSplit! : % -> % if $ has shallowlyMutable +--R delete : (%,UniversalSegment Integer) -> % +--R differentiate : (%,List Symbol,List NonNegativeInteger) -> % if K has *: (Integer,K) -> K and K has PDRING SYMBOL +--R differentiate : (%,Symbol,NonNegativeInteger) -> % if K has *: (Integer,K) -> K and K has PDRING SYMBOL +--R differentiate : (%,List Symbol) -> % if K has *: (Integer,K) -> K and K has PDRING SYMBOL +--R differentiate : (%,Symbol) -> % if K has *: (Integer,K) -> K and K has PDRING SYMBOL +--R differentiate : (%,NonNegativeInteger) -> % if K has *: (Integer,K) -> K +--R differentiate : % -> % if K has *: (Integer,K) -> K +--R divide : (%,%) -> Record(quotient: %,remainder: %) +--R ?.value : (%,value) -> Record(k: Integer,c: K) +--R ?.first : (%,first) -> Record(k: Integer,c: K) +--R ?.last : (%,last) -> Record(k: Integer,c: K) +--R ?.? : (%,UniversalSegment Integer) -> % +--R ?.? : (%,Integer) -> Record(k: Integer,c: K) +--R elt : (%,Integer,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) +--R ?.? : (%,%) -> % if Integer has SGROUP +--R entries : % -> List Record(k: Integer,c: K) +--R entry? : (Record(k: Integer,c: K),%) -> Boolean if $ has finiteAggregate and Record(k: Integer,c: K) has SETCAT +--R euclideanSize : % -> NonNegativeInteger +--R eval : (%,List Equation Record(k: Integer,c: K)) -> % if Record(k: Integer,c: K) has EVALAB Record(k: Integer,c: K) and Record(k: Integer,c: K) has SETCAT +--R eval : (%,Equation Record(k: Integer,c: K)) -> % if Record(k: Integer,c: K) has EVALAB Record(k: Integer,c: K) and Record(k: Integer,c: K) has SETCAT +--R eval : (%,Record(k: Integer,c: K),Record(k: Integer,c: K)) -> % if Record(k: Integer,c: K) has EVALAB Record(k: Integer,c: K) and Record(k: Integer,c: K) has SETCAT +--R eval : (%,List Record(k: Integer,c: K),List Record(k: Integer,c: K)) -> % if Record(k: Integer,c: K) has EVALAB Record(k: Integer,c: K) and Record(k: Integer,c: K) has SETCAT +--R eval : (%,K) -> Stream K if K has **: (K,Integer) -> K +--R every? : ((Record(k: Integer,c: K) -> Boolean),%) -> Boolean if $ has finiteAggregate +--R expressIdealMember : (List %,%) -> Union(List %,"failed") +--R exquo : (%,%) -> Union(%,"failed") +--R extendedEuclidean : (%,%,%) -> Union(Record(coef1: %,coef2: %),"failed") +--R extendedEuclidean : (%,%) -> Record(coef1: %,coef2: %,generator: %) +--R fill! : (%,Record(k: Integer,c: K)) -> % if $ has shallowlyMutable +--R find : ((Record(k: Integer,c: K) -> Boolean),%) -> Union(Record(k: Integer,c: K),"failed") +--R findTerm : (%,Integer) -> Record(k: Integer,c: K) +--R first : % -> Record(k: Integer,c: K) +--R first : (%,NonNegativeInteger) -> % +--R frst : % -> Record(k: Integer,c: K) +--R gcdPolynomial : (SparseUnivariatePolynomial %,SparseUnivariatePolynomial %) -> SparseUnivariatePolynomial % +--R insert : (Record(k: Integer,c: K),%,Integer) -> % +--R last : % -> Record(k: Integer,c: K) +--R last : (%,NonNegativeInteger) -> % +--R leaves : % -> List Record(k: Integer,c: K) +--R less? : (%,NonNegativeInteger) -> Boolean +--R map : ((Record(k: Integer,c: K) -> Record(k: Integer,c: K)),%) -> % +--R map : (((Record(k: Integer,c: K),Record(k: Integer,c: K)) -> Record(k: Integer,c: K)),%,%) -> % +--R map! : ((Record(k: Integer,c: K) -> Record(k: Integer,c: K)),%) -> % if $ has shallowlyMutable +--R maxIndex : % -> Integer if Integer has ORDSET +--R member? : (Record(k: Integer,c: K),%) -> Boolean if $ has finiteAggregate and Record(k: Integer,c: K) has SETCAT +--R members : % -> List Record(k: Integer,c: K) if $ has finiteAggregate +--R minIndex : % -> Integer if Integer has ORDSET +--R monomial : (%,SingletonAsOrderedSet,Integer) -> % +--R monomial : (%,List SingletonAsOrderedSet,List Integer) -> % +--R monomial2series : (List %,List NonNegativeInteger,Integer) -> % +--R more? : (%,NonNegativeInteger) -> Boolean +--R multiEuclidean : (List %,%) -> Union(List %,"failed") +--R multiplyExponents : (%,PositiveInteger) -> % +--R new : (NonNegativeInteger,Record(k: Integer,c: K)) -> % +--R node? : (%,%) -> Boolean if Record(k: Integer,c: K) has SETCAT +--R numberOfComputedEntries : % -> NonNegativeInteger +--R orderIfNegative : % -> Union(Integer,"failed") +--R parts : % -> List Record(k: Integer,c: K) if $ has finiteAggregate +--R principalIdeal : List % -> Record(coef: List %,generator: %) +--R qelt : (%,Integer) -> Record(k: Integer,c: K) +--R qsetelt! : (%,Integer,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R reduce : (((Record(k: Integer,c: K),Record(k: Integer,c: K)) -> Record(k: Integer,c: K)),%) -> Record(k: Integer,c: K) if $ has finiteAggregate +--R reduce : (((Record(k: Integer,c: K),Record(k: Integer,c: K)) -> Record(k: Integer,c: K)),%,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has finiteAggregate +--R reduce : (((Record(k: Integer,c: K),Record(k: Integer,c: K)) -> Record(k: Integer,c: K)),%,Record(k: Integer,c: K),Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has finiteAggregate and Record(k: Integer,c: K) has SETCAT +--R remove : (Record(k: Integer,c: K),%) -> % if $ has finiteAggregate and Record(k: Integer,c: K) has SETCAT +--R remove : ((Record(k: Integer,c: K) -> Boolean),%) -> % +--R removeDuplicates : % -> % if $ has finiteAggregate and Record(k: Integer,c: K) has SETCAT +--R rest : (%,NonNegativeInteger) -> % +--R second : % -> Record(k: Integer,c: K) +--R select : ((Record(k: Integer,c: K) -> Boolean),%) -> % +--R setchildren! : (%,List %) -> % if $ has shallowlyMutable +--R setelt : (%,value,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R setelt : (%,first,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R setelt : (%,rest,%) -> % if $ has shallowlyMutable +--R setelt : (%,last,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R setelt : (%,UniversalSegment Integer,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R setelt : (%,Integer,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R setfirst! : (%,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R setlast! : (%,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R setrest! : (%,%) -> % if $ has shallowlyMutable +--R setvalue! : (%,Record(k: Integer,c: K)) -> Record(k: Integer,c: K) if $ has shallowlyMutable +--R size? : (%,NonNegativeInteger) -> Boolean +--R split! : (%,Integer) -> % if $ has shallowlyMutable +--R subtractIfCan : (%,%) -> Union(%,"failed") +--R swap! : (%,Integer,Integer) -> Void if $ has shallowlyMutable +--R terms : % -> Stream Record(k: Integer,c: K) +--R third : % -> Record(k: Integer,c: K) +--R truncate : (%,Integer,Integer) -> % +--R unitNormal : % -> Record(unit: %,canonical: %,associate: %) +--R value : % -> Record(k: Integer,c: K) +--R variables : % -> List SingletonAsOrderedSet +--R +--E 1 + +)spool +)lisp (bye) + +@ +<>= +==================================================================== +NeitherSparseOrDensePowerSeries examples +==================================================================== + +See Also: +o )show NeitherSparseOrDensePowerSeries + +@ +\pagehead{NeitherSparseOrDensePowerSeries}{NSDPS} +\pagepic{ps/v103neithersparseordensepowerseries.ps}{NSDPS}{1.00} + +{\bf Exports:}\\ +\begin{tabular}{lll} +\cross{NSDPS}{0} & +\cross{NSDPS}{1} & +\cross{NSDPS}{#?} \\ +\cross{NSDPS}{-?} & +\cross{NSDPS}{?**?} & +\cross{NSDPS}{?*?} \\ +\cross{NSDPS}{?+?} & +\cross{NSDPS}{?-?} & +\cross{NSDPS}{?.?} \\ +\cross{NSDPS}{?.first} & +\cross{NSDPS}{?.last} & +\cross{NSDPS}{?.rest} \\ +\cross{NSDPS}{?.value} & +\cross{NSDPS}{?/?} & +\cross{NSDPS}{?=?} \\ +\cross{NSDPS}{?\^{}?} & +\cross{NSDPS}{?\~{}=?} & +\cross{NSDPS}{?quo?} \\ +\cross{NSDPS}{?rem?} & +\cross{NSDPS}{D} & +\cross{NSDPS}{any?} \\ +\cross{NSDPS}{approximate} & +\cross{NSDPS}{associates?} & +\cross{NSDPS}{center} \\ +\cross{NSDPS}{characteristic} & +\cross{NSDPS}{charthRoot} & +\cross{NSDPS}{child?} \\ +\cross{NSDPS}{children} & +\cross{NSDPS}{coefOfFirstNonZeroTerm} & +\cross{NSDPS}{coefficient} \\ +\cross{NSDPS}{coerce} & +\cross{NSDPS}{complete} & +\cross{NSDPS}{concat} \\ +\cross{NSDPS}{concat!} & +\cross{NSDPS}{construct} & +\cross{NSDPS}{convert} \\ +\cross{NSDPS}{copy} & +\cross{NSDPS}{count} & +\cross{NSDPS}{cycleEntry} \\ +\cross{NSDPS}{cycleLength} & +\cross{NSDPS}{cycleSplit!} & +\cross{NSDPS}{cycleTail} \\ +\cross{NSDPS}{cyclic?} & +\cross{NSDPS}{degree} & +\cross{NSDPS}{delay} \\ +\cross{NSDPS}{delete} & +\cross{NSDPS}{differentiate} & +\cross{NSDPS}{distance} \\ +\cross{NSDPS}{divide} & +\cross{NSDPS}{elt} & +\cross{NSDPS}{empty} \\ +\cross{NSDPS}{empty?} & +\cross{NSDPS}{entries} & +\cross{NSDPS}{entry?} \\ +\cross{NSDPS}{eq?} & +\cross{NSDPS}{euclideanSize} & +\cross{NSDPS}{eval} \\ +\cross{NSDPS}{every?} & +\cross{NSDPS}{explicitEntries?} & +\cross{NSDPS}{explicitlyEmpty?} \\ +\cross{NSDPS}{explicitlyFinite?} & +\cross{NSDPS}{expressIdealMember} & +\cross{NSDPS}{exquo} \\ +\cross{NSDPS}{extend} & +\cross{NSDPS}{extendedEuclidean} & +\cross{NSDPS}{factor} \\ +\cross{NSDPS}{fill!} & +\cross{NSDPS}{filterUpTo} & +\cross{NSDPS}{find} \\ +\cross{NSDPS}{findCoef} & +\cross{NSDPS}{findTerm} & +\cross{NSDPS}{first} \\ +\cross{NSDPS}{frst} & +\cross{NSDPS}{gcd} & +\cross{NSDPS}{gcdPolynomial} \\ +\cross{NSDPS}{hash} & +\cross{NSDPS}{index?} & +\cross{NSDPS}{indices} \\ +\cross{NSDPS}{insert} & +\cross{NSDPS}{inv} & +\cross{NSDPS}{last} \\ +\cross{NSDPS}{latex} & +\cross{NSDPS}{lazy?} & +\cross{NSDPS}{lazyEvaluate} \\ +\cross{NSDPS}{lcm} & +\cross{NSDPS}{leadingCoefficient} & +\cross{NSDPS}{leadingMonomial} \\ +\cross{NSDPS}{leaf?} & +\cross{NSDPS}{leaves} & +\cross{NSDPS}{less?} \\ +\cross{NSDPS}{map} & +\cross{NSDPS}{map!} & +\cross{NSDPS}{maxIndex} \\ +\cross{NSDPS}{member?} & +\cross{NSDPS}{members} & +\cross{NSDPS}{minIndex} \\ +\cross{NSDPS}{monomial} & +\cross{NSDPS}{monomial2series} & +\cross{NSDPS}{monomial?} \\ +\cross{NSDPS}{more?} & +\cross{NSDPS}{multiEuclidean} & +\cross{NSDPS}{multiplyExponents} \\ +\cross{NSDPS}{new} & +\cross{NSDPS}{node?} & +\cross{NSDPS}{nodes} \\ +\cross{NSDPS}{numberOfComputedEntries} & +\cross{NSDPS}{one?} & +\cross{NSDPS}{order} \\ +\cross{NSDPS}{orderIfNegative} & +\cross{NSDPS}{parts} & +\cross{NSDPS}{pole?} \\ +\cross{NSDPS}{posExpnPart} & +\cross{NSDPS}{possiblyInfinite?} & +\cross{NSDPS}{prime?} \\ +\cross{NSDPS}{principalIdeal} & +\cross{NSDPS}{printInfo} & +\cross{NSDPS}{qelt} \\ +\cross{NSDPS}{qsetelt!} & +\cross{NSDPS}{recip} & +\cross{NSDPS}{reduce} \\ +\cross{NSDPS}{reductum} & +\cross{NSDPS}{remove} & +\cross{NSDPS}{removeDuplicates} \\ +\cross{NSDPS}{removeFirstZeroes} & +\cross{NSDPS}{removeZeroes} & +\cross{NSDPS}{rest} \\ +\cross{NSDPS}{rst} & +\cross{NSDPS}{sample} & +\cross{NSDPS}{sbt} \\ +\cross{NSDPS}{second} & +\cross{NSDPS}{select} & +\cross{NSDPS}{series} \\ +\cross{NSDPS}{setchildren!} & +\cross{NSDPS}{setelt} & +\cross{NSDPS}{setfirst!} \\ +\cross{NSDPS}{setlast!} & +\cross{NSDPS}{setrest!} & +\cross{NSDPS}{setvalue!} \\ +\cross{NSDPS}{shift} & +\cross{NSDPS}{size?} & +\cross{NSDPS}{sizeLess?} \\ +\cross{NSDPS}{split!} & +\cross{NSDPS}{squareFree} & +\cross{NSDPS}{squareFreePart} \\ +\cross{NSDPS}{subtractIfCan} & +\cross{NSDPS}{swap!} & +\cross{NSDPS}{tail} \\ +\cross{NSDPS}{terms} & +\cross{NSDPS}{third} & +\cross{NSDPS}{truncate} \\ +\cross{NSDPS}{unit?} & +\cross{NSDPS}{unitCanonical} & +\cross{NSDPS}{unitNormal} \\ +\cross{NSDPS}{value} & +\cross{NSDPS}{variable} & +\cross{NSDPS}{variables} \\ +\cross{NSDPS}{zero?} && +\end{tabular} + +<>= +)abbrev domain NSDPS NeitherSparseOrDensePowerSeries +++ Authors: Gaetan Hache +++ Date Created: june 1996 +++ Date Last Updated: May 2010 by Tim Daly +++ Description: +++ This domain is part of the PAFF package +NeitherSparseOrDensePowerSeries(K):Exports == Implementation where + K:Field + + SI ==> SingleInteger + INT ==> Integer + TERM ==> Record(k:INT,c:K) + SER ==> Stream(TERM) + NNI ==> NonNegativeInteger + + Exports ==> Join(LocalPowerSeriesCategory(K),LazyStreamAggregate(TERM)) with + + findTerm: (%,Integer) -> TERM + + Implementation ==> SER add + + Rep:=SER + + var : Symbol := 't + + multC: (K,INT,%) -> % + + orderIfNegative(s:%)== + zero?(s) => "failed" + f:=frst(s) + f.k >= 0 => "failed" + zero?(f.c) => orderIfNegative(rest(s)) + f.k + + posExpnPart(s)== + zero?(s) => 0 + o:=order s + (o >= 0) => s + posExpnPart(rst s) + + findTerm(s,n)== + empty?(s) => [n,0]$TERM + f:=frst(s) + f.k > n => [n,0]$TERM + f.k = n => f + findTerm(rst(s),n) + + findCoef(s,i)==findTerm(s,i).c + + coerce(s:%):SER == s::Rep + + coerce(s:SER):%==s + + localVarForPrintInfo:Boolean:=false() + + printInfo==localVarForPrintInfo + + printInfo(flag)==localVarForPrintInfo:=flag + + outTerm: TERM -> OutputForm + + removeZeroes(s)== delay + zero?(s) => 0 + f:=frst(s) + zero?(f.c) => removeZeroes(rst(s)) + concat(f,removeZeroes(rst(s))) + + inv(ra)== + a:=removeFirstZeroes ra + o:=-order(a) + aa:=shift(a,o) + aai:=recip aa + aai case "failed" => _ + error "Big problem in inv function from CreateSeries" + shift(aai,o) + + iDiv: (%,%,K) -> % + iDiv(x,y,ry0) == delay + empty? x => 0$% + sx:TERM:=frst x + c0:K:=ry0 * sx.c + nT:TERM:=[sx.k, c0] + tc0:%:=series(sx.k,c0,0$%) + concat(nT,iDiv(rst x - tc0 * rst y,y,ry0)) + + recip x == + empty? x => "failed" + rh1:TERM:=frst x + ^zero?(rh1.k) => "failed" + ic:K:= inv(rh1.c) + delay + concat([0,ic]$TERM,iDiv(- ic * rst x,x,ic)) + + removeFirstZeroes(s)== + zero?(s) => 0 + f:=frst(s) + zero?(f.c) => removeFirstZeroes(rst(s)) + s + + sbt(sa,sbb)== delay + sb:=removeFirstZeroes(sbb) + o:=order sb + ^(o > 0) => _ + error "Cannot substitute by a series of order less than 1 !!!!!" + empty?(sa) or empty?(sb) => 0 + fa:TERM:=frst(sa) + fb:TERM:=frst(sb) + firstElem:TERM:=[fa.k*fb.k, fa.c*(fb.c**fa.k)] + zero?(fa.c) => sbt(rst(sa),sb) + concat(firstElem, rest((fa.c) * sb ** (fa.k)) + sbt(rst(sa),sb) ) + + coerce(s:%):OutputForm== + zero?(s) => "0" :: OutputForm + count:SI:= _$streamCount$Lisp + lstTerm:List TERM:=empty() + rs:%:= s + for i in 1..count while ^empty?(rs) repeat + fs:=frst rs + rs:=rst rs + lstTerm:=concat(lstTerm,fs) + listOfOutTerm:List OutputForm:=_ + [outTerm(t) for t in lstTerm | ^zero?(t.c) ] + out:OutputForm:= + if empty?(listOfOutTerm) then + "0" :: OutputForm + else + reduce("+", listOfOutTerm) + empty?(rs) => out + out + ("..." :: OutputForm) + + outTerm(t)== + ee:=t.k + cc:=t.c + oe:OutputForm:=ee::OutputForm + oc:OutputForm:=cc::OutputForm + symb:OutputForm:= var :: OutputForm + one?(cc) and one?(ee) => symb + zero?(ee) => oc + one?(cc) => symb ** oe + one?(ee) => oc * symb + oc * symb ** oe + + removeZeroes(n,s)== delay + n < 0 => s + zero?(s) => 0 + f:=frst(s) + zero?(f.c) => removeZeroes(n-1, rst(s)) + concat(f,removeZeroes(n-1, rst(s))) + + order(s:%)== + zero?(s) => error _ + "From order (PlaneCurveLocalPowerSeries): cannot compute the order of 0" + f:=frst(s) + zero?(f.c) => order(rest(s)) + f.k + + monomial2series(lpar,lexp,sh)== + shift(reduce("*",[s**e for s in lpar for e in lexp]),sh) + + coefOfFirstNonZeroTerm(s:%)== + zero?(s) => error _ + "From order (PlaneCurveLocalPowerSeries): cannot find the coefOfFirstNonZeroTerm" + f:=frst(s) + zero?(f.c) => coefOfFirstNonZeroTerm(rest(s)) + f.c + + degreeOfTermLower?: (TERM,INT) -> Boolean + degreeOfTermLower?(t,n)== t.k < n + + filterUpTo(s,n)==filterWhile(degreeOfTermLower?(#1,n),s) + + series(exp,coef,s)==cons([exp,coef]$TERM,s) + + a:% ** n:NNI == -- delay + zero?(n) => 1 + expt(a,n :: PositiveInteger)$RepeatedSquaring(%) + + 0 == empty() + + 1 == construct([[0,1]$TERM]) + + zero?(a)==empty?(a::Rep) + + shift(s,n)== delay + zero?(s) => 0 + fs:=frst(s) + es:=fs.k + concat([es+n,fs.c]$TERM,shift(rest(s),n)) + + a:% + b:% == delay + zero?(a) => b + zero?(b) => a + fa:=frst(a) + fb:=frst(b) + ea:=fa.k + eb:=fb.k + nc:K + ea = eb => concat([ea,fa.c+fb.c]$TERM,rest(a) + rest(b)) + ea > eb => concat([eb,fb.c]$TERM,a + rest(b)) + eb > ea => concat([ea,fa.c]$TERM,rest(a) + b) + + - a:% == --delay + multC( (-1) :: K , 0 , a) + + a:% - b:% == --delay + a+(-b) + + multC(coef,n,s)== delay + zero?(coef) => 0 + zero?(s) => 0 + f:=frst(s) + concat([f.k+n,coef*f.c]$TERM,multC(coef,n,rest(s))) + + coef:K * s:% == delay + zero?(coef) => 0 + zero?(s) => 0 + f:=frst(s) + concat([f.k,coef*f.c]$TERM, coef *$% rest(s)) + + s:% * coef:K == coef * s + + s1:% * s2:%== delay + zero?(s1) or zero?(s2) => 0 + f1:TERM:=frst(s1) + f2:TERM:=frst(s2) + e1:INT:=f1.k; e2:INT:=f2.k + c1:K:=f1.c; c2:K:=f2.c + concat([e1+e2,c1*c2]$TERM,_ + multC(c1,e1,rest(s2))+multC(c2,e2,rest(s1))+rest(s1)*rest(s2)) + +@ +<>= +"NSDPS" [color="#88FF44",href="bookvol10.3.pdf#nameddest=NSDPS"] +"ALIST" [color="#88FF44",href="bookvol10.3.pdf#nameddest=ALIST"] +"NSDPS" -> "ALIST" + +@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{domain NSMP NewSparseMultivariatePolynomial} Based on the {\bf PseudoRemainderSequence} package, the domain constructor {\bf NewSparseMulitvariatePolynomial} extends @@ -123816,6 +124423,7 @@ Note that this code is not included in the generated catdef.spad file. <> <> +<> <> <> <> diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index c79ee67..2cb7821 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -24028,6 +24028,7 @@ otherwise the new algebra won't be loaded by the interpreter when needed. (|MultFiniteFactorize| . MFINFACT) (|MyUnivariatePolynomial| . MYUP) (|MyExpression| . MYEXPR) + (|NeitherSparseOrDensePowerSeries| . NSDPS) (|NoneFunctions1| . NONE1) (|NonNegativeInteger| . NNI) (|NottinghamGroup| . NOTTING) diff --git a/books/ps/v103neithersparseordensepowerseries.ps b/books/ps/v103neithersparseordensepowerseries.ps new file mode 100644 index 0000000..76abed6 --- /dev/null +++ b/books/ps/v103neithersparseordensepowerseries.ps @@ -0,0 +1,268 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Graphviz version 2.20.2 (Mon Mar 30 10:09:11 UTC 2009) +%%For: (root) root +%%Title: pic +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 108 152 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 72 116 boxprim clip newpath +1 1 set_scale 0 rotate 40 40 translate +% NSDPS +gsave +[ /Rect [ 0 72 64 108 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=NSDPS) >> + /Subtype /Link +/ANN pdfmark +0.273 0.733 1.000 nodecolor +newpath 64 108 moveto +0 108 lineto +0 72 lineto +64 72 lineto +closepath fill +1 setlinewidth +filled +0.273 0.733 1.000 nodecolor +newpath 64 108 moveto +0 108 lineto +0 72 lineto +64 72 lineto +closepath stroke +0.000 0.000 0.000 nodecolor +14 /Times-Roman set_font +7.5 85.9 moveto 49 (NSDPS) alignedtext +grestore +% ALIST +gsave +[ /Rect [ 4 0 60 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (bookvol10.3.pdf#nameddest=ALIST) >> + /Subtype /Link +/ANN pdfmark +0.273 0.733 1.000 nodecolor +newpath 60 36 moveto +4 36 lineto +4 0 lineto +60 0 lineto +closepath fill +1 setlinewidth +filled +0.273 0.733 1.000 nodecolor +newpath 60 36 moveto +4 36 lineto +4 0 lineto +60 0 lineto +closepath stroke +0.000 0.000 0.000 nodecolor +14 /Times-Roman set_font +11.5 13.9 moveto 41 (ALIST) alignedtext +grestore +% NSDPS->ALIST +gsave +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 32 72 moveto +32 64 32 55 32 46 curveto +stroke +0.000 0.000 0.000 edgecolor +newpath 35.5 46 moveto +32 36 lineto +28.5 46 lineto +closepath fill +1 setlinewidth +solid +0.000 0.000 0.000 edgecolor +newpath 35.5 46 moveto +32 36 lineto +28.5 46 lineto +closepath stroke +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 108 152 +end +restore +%%EOF diff --git a/changelog b/changelog index 46f3ba8..a035034 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,8 @@ +20100512 tpd src/axiom-website/patches.html 20100512.01.tpd.patch +20100512 tpd src/algebra/Makefile help and test files for NSDPS +20100512 tpd books/bookvol5 expose NeitherSparseOrDensePowerSeries +20100512 tpd books/bookvol10.3 add NeitherSparseOrDensePowerSeries +20100512 tpd books/ps/v103neithersparseordensepowerseries.ps added 20100511 tpd src/axiom-website/patches.html 20100511.07.tpd.patch 20100511 tpd src/algebra/Makefile help and test files for LOCPOWC 20100511 tpd books/bookvol5 expose LocalPowerSeriesCategory diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index 12e67c6..3fa8ab5 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -9990,7 +9990,8 @@ LAYER16=\ ${OUT}/MSET.o ${OUT}/M3D.o ${OUT}/NAGC02.o ${OUT}/NAGC05.o \ ${OUT}/NAGC06.o ${OUT}/NAGD01.o ${OUT}/NAGD02.o ${OUT}/NAGD03.o \ ${OUT}/NAGE01.o ${OUT}/NAGE02.o ${OUT}/NAGE04.o ${OUT}/NAGF07.o \ - ${OUT}/NAGS.o ${OUT}/NAGSP.o ${OUT}/NREP.o ${OUT}/NUMFMT.o \ + ${OUT}/NAGS.o ${OUT}/NAGSP.o ${OUT}/NREP.o ${OUT}/NSDPS.o \ + ${OUT}/NUMFMT.o \ ${OUT}/OC.o ${OUT}/OC-.o ${OUT}/ODEPACK.o ${OUT}/ODERAT.o \ ${OUT}/OMERR.o ${OUT}/OMERRK.o ${OUT}/OPTPACK.o ${OUT}/OSI.o \ ${OUT}/OVAR.o ${OUT}/PACOFF.o ${OUT}/PACRAT.o \ @@ -11277,6 +11278,26 @@ LAYER16=\ /*"NREP" -> {"FPATMAB"; "TYPE"; "CHARNZ"; "PFECAT"; "UPOLYC"; "POLYCAT"}*/ /*"NREP" -> {"FAMR"; "AMR"; "FRETRCT"}*/ +"NSDPS" [color="#88FF44",href="bookvol10.3.pdf#nameddest=NSDPS"] +/*"NSDPS" -> {"LOCPOWC"; "FIELD"; "EUCDOM"; "PID"; "GCDDOM"; "INTDOM"}*/ +/*"NSDPS" -> {"COMRING"; "RING"; "RNG"; "ABELGRP"; "CABMON"; "ABELMON"}*/ +/*"NSDPS" -> {"ABELSG"; "SETCAT"; "BASTYPE"; "KOERCE"; "SGROUP"; "MONOID"}*/ +/*"NSDPS" -> {"LMODULE"; "BMODULE"; "RMODULE"; "ALGEBRA"; "MODULE"}*/ +/*"NSDPS" -> {"ENTIRER"; "UFD"; "DIVRING"; "UPSCAT"; "PSCAT"; "AMR"}*/ +/*"NSDPS" -> {"CHARZ"; "CHARNZ"; "ELTAB"; "DIFRING"; "PDRING"; "LZSTAGG"}*/ +/*"NSDPS" -> {"STAGG"; "URAGG"; "RCAGG"; "HOAGG"; "AGG"; "TYPE"; "EVALAB"}*/ +/*"NSDPS" -> {"IEVALAB"; "LNAGG"; "IXAGG"; "ELTAGG"; "CLAGG"; "KONVERT"}*/ +/*"NSDPS" -> {"INT"; "BOOLEAN"; "INS"; "OINTDOM"; "ORDRING"; "OAGROUP"}*/ +/*"NSDPS" -> {"OCAMON"; "OAMON"; "OASGP"; "ORDSET"; "RETRACT"; "LINEXP"}*/ +/*"NSDPS" -> {"PATMAB"; "CFCAT"; "REAL"; "STEP"; "LIST"; "ILIST"; "SINT"}*/ +/*"NSDPS" -> {"NNI"; "LSAGG-"; "STAGG-"; "ELAGG-"; "LSAGG"; "FLAGG"}*/ +/*"NSDPS" -> {"ELAGG"; "OM"; "SYMBOL"; "REF"}*/ +"NSDPS" -> "ALIST" +/*"NSDPS" -> {"STRING"; "CHAR"; "OUTFORM"; "PRIMARR"; "A1AGG-"; "ISTRING"}*/ +/*"NSDPS" -> {"SRAGG-"; "FLAGG-"; "LNAGG-"; "URAGG-"; "RCAGG-"; "IXAGG-"}*/ +/*"NSDPS" -> {"CLAGG-"; "HOAGG-"; "ORDSET-"; "AGG-"; "ELTAGG-"; "SETCAT-"}*/ +/*"NSDPS" -> {"BASTYPE-"}*/ + "NUMFMT" [color="#FF4488",href="bookvol10.4.pdf#nameddest=NUMFMT"] /*"NUMFMT" -> {"STRING"; "CHAR"; "SINT"; "OUTFORM"; "LIST"; "INT"}*/ /*"NUMFMT" -> {"PRIMARR"; "A1AGG-"; "ISTRING"; "SRAGG-"; "FLAGG-"; "LNAGG-"}*/ @@ -16134,6 +16155,21 @@ ${MID}/RFP.nrlib/code.o: ${MID}/RFP.spad | ${INTERPSYS} >${TMP}/trace ; \ fi ) @ +<>= + +NSDPSDEPS = LOCPOWC + +${MID}/NSDPS.nrlib/code.o: ${MID}/NSDPS.spad + @echo P3 making ${MID}/NSDPS.nrlib/code.o from ${MID}/NSDPS.spad + @ (cd ${MID} ; \ + if [ -z "${NOISE}" ] ; then \ + echo -e ")lib ${NSDPSDEPS} \n )co NSDPS.spad" \ + | ${INTERPSYS} ; \ + else \ + echo -e ")lib ${NSDPSDEPS} \n )co NSDPS.spad" \ + | ${INTERPSYS} >${TMP}/trace ; \ + fi ) +@ \section{Broken Files} These files are Aldor files @@ -16932,6 +16968,7 @@ SPADHELP=\ ${HELP}/NagRootFindingPackage.help \ ${HELP}/NagSeriesSummationPackage.help \ ${HELP}/NagSpecialFunctionsPackage.help \ + ${HELP}/NeitherSparseOrDensePowerSeries.help \ ${HELP}/None.help \ ${HELP}/NottinghamGroup.help \ ${HELP}/Octonion.help \ @@ -17088,7 +17125,9 @@ REGRESS= \ Matrix.regress \ MatrixCategory.regress \ Multiset.regress \ - MultivariatePolynomial.regress None.regress \ + MultivariatePolynomial.regress \ + NeitherSparseOrDensePowerSeries.regress \ + None.regress \ NottinghamGroup.regress \ Octonion.regress \ OneDimensionalArray.regress \ @@ -18161,6 +18200,18 @@ ${HELP}/NagSpecialFunctionsPackage.help: ${BOOKS}/bookvol10.4.pamphlet @cp ${HELP}/NagSpecialFunctionsPackage.help ${HELP}/NAGS.help @echo "NagSpecialFunctionsPackage (NAGS)" >>${HELPFILE} +${HELP}/NeitherSparseOrDensePowerSeries.help: ${BOOKS}/bookvol10.3.pamphlet + @echo 7805 create NeitherSparseOrDensePowerSeries.help from \ + ${BOOKS}/bookvol10.3.pamphlet + @${TANGLE} -R"NeitherSparseOrDensePowerSeries.help" \ + ${BOOKS}/bookvol10.3.pamphlet \ + >${HELP}/NeitherSparseOrDensePowerSeries.help + @cp ${HELP}/NeitherSparseOrDensePowerSeries.help ${HELP}/NSDPS.help + @${TANGLE} -R"NeitherSparseOrDensePowerSeries.input" \ + ${BOOKS}/bookvol10.3.pamphlet \ + >${INPUT}/NeitherSparseOrDensePowerSeries.input + @echo "NeitherSparseOrDensePowerSeries (NSDPS)" >>${HELPFILE} + ${HELP}/None.help: ${BOOKS}/bookvol10.3.pamphlet @echo 7810 create None.help from ${BOOKS}/bookvol10.3.pamphlet @${TANGLE} -R"None.help" ${BOOKS}/bookvol10.3.pamphlet \ diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index c0f6928..dafd1e6 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2697,5 +2697,7 @@ src/input/curry.input add regression test
src/input/Makefile remove duplicate curl.input invocation
20100511.07.tpd.patch books/bookvol10.2 add LocalPowerSeriesCategory
+20100512.01.tpd.patch +books/bookvol10.3 add NeitherSparseOrDensePowerSeries