diff options
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/cycles.spad.pamphlet | 22 | ||||
-rw-r--r-- | src/algebra/partperm.spad.pamphlet | 23 |
2 files changed, 11 insertions, 34 deletions
diff --git a/src/algebra/cycles.spad.pamphlet b/src/algebra/cycles.spad.pamphlet index c2941dd3..b8dea37f 100644 --- a/src/algebra/cycles.spad.pamphlet +++ b/src/algebra/cycles.spad.pamphlet @@ -94,29 +94,29 @@ CycleIndicators: Exports == Implementation where ++ expressed in terms of power sum symmetric functions. Implementation ==> add - import PartitionsAndPermutations import IntegerNumberTheoryFunctions + import Partition trm: PTN -> SPOL RN trm pt == monomial(inv(pdct(pt) :: RN),pt) - list: Stream L PI -> L L PI + list: Stream PTN -> L PTN list st == entries complete st complete i == i=0 => 1 - +/[trm partition pt for pt in list partitions i] + +/[trm pt for pt in list partitions i] - even?: L PI -> B - even? li == even?( #([i for i in li | even? i])) + even?: PTN -> B + even? p == even?( #([i for i in parts p | even? i])) alternating i == - 2 * _+/[trm partition li for li in list partitions i | even? li] + 2 * _+/[trm p for p in list partitions i | even? p] elementary i == i=0 => 1 - +/[(spol := trm partition pt; even? pt => spol; -spol) + +/[(spol := trm pt; even? pt => spol; -spol) for pt in list partitions i] divisors: I -> L I @@ -142,10 +142,10 @@ CycleIndicators: Exports == Implementation where odd? n => (1/2) * cyclic n + (1/2) * ss(2,k) * powerSum 1 (1/2) * cyclic n + (1/4) * ss(2,k) + (1/4) * ss(2,k-1) * ss(1,2) - trm2: L PI -> SPOL RN + trm2: PTN -> SPOL RN trm2 li == - lli := powers(partition li)$PTN - xx := 1/(pdct partition li) + lli := powers( li)$PTN + xx := 1/(pdct li) prod : SPOL RN := 1 for ll in lli repeat ll0 := first ll; ll1 := second ll @@ -161,7 +161,7 @@ CycleIndicators: Exports == Implementation where prod := c * prod2 * prod xx * prod - graphs n == +/[trm2 li for li in list(partitions n)] + graphs n == +/[trm2 p for p in list(partitions n)] cupp: (PTN,SPOL RN) -> SPOL RN cupp(pt,spol) == diff --git a/src/algebra/partperm.spad.pamphlet b/src/algebra/partperm.spad.pamphlet index d4b23b3a..215c6679 100644 --- a/src/algebra/partperm.spad.pamphlet +++ b/src/algebra/partperm.spad.pamphlet @@ -37,16 +37,6 @@ PartitionsAndPermutations: Exports == Implementation where Exports ==> with - partitions: (NNI,NNI,NNI) -> ST L PI - ++\spad{partitions(p,l,n)} is the stream of partitions - ++ of n whose number of parts is no greater than p - ++ and whose largest part is no greater than l. - partitions: NNI -> ST L PI - ++\spad{partitions(n)} is the stream of all partitions of n. - partitions: (NNI,NNI) -> ST L PI - ++\spad{partitions(p,l)} is the stream of all - ++ partitions whose number of - ++ parts and largest part are no greater than p and l. conjugate: L PI -> L PI ++\spad{conjugate(pt)} is the conjugate of the partition pt. conjugates: ST L PI -> ST L PI @@ -75,19 +65,6 @@ PartitionsAndPermutations: Exports == Implementation where Implementation ==> add - partitions(M,N,n) == - zero? n => concat(empty()$L(PI),empty()$(ST L PI)) - zero? M or zero? N or n < N => empty() - s := partitions(subtractIfCan(M,1)::NNI,N,subtractIfCan(n,N)::NNI) - c := map(concat(N::PI,#1),s) - concat(c,partitions(M,subtractIfCan(N,1)::NNI,n)) - - partitions n == partitions(n,n,n) - - partitions(M,N)== - aaa : L ST L PI := [partitions(M,N,i) for i in 0..M*N] - concat(aaa :: ST ST L PI)$ST1(L PI) - -- nogreq(n,l) is the number of elements of l that are greater or -- equal to n nogreq: (I,L PI) -> I |