/usr/share/axiom-20170501/src/algebra/SYMPOLY.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | )abbrev domain SYMPOLY SymmetricPolynomial
++ Author: Mark Botch
++ Description:
++ This domain implements symmetric polynomial
SymmetricPolynomial(R) == CODE where
R : Ring
CODE ==> PolynomialRing(R,Partition) add
Term:= Record(k:Partition,c:R)
Rep:= List Term
-- override PR implementation because coeff. arithmetic too expensive
if R has EntireRing then
(p1:%) * (p2:%) ==
null p1 => 0
null p2 => 0
zero?(p1.first.k) => p1.first.c * p2
(p2 = 1) => p1
+/[[[t1.k+t2.k,t1.c*t2.c]$Term for t2 in p2]
for t1 in reverse(p1)]
-- This 'reverse' is an efficiency improvement:
-- reduces both time and space [Abbott/Bradford/Davenport]
else
(p1:%) * (p2:%) ==
null p1 => 0
null p2 => 0
zero?(p1.first.k) => p1.first.c * p2
(p2 = 1) => p1
+/[[[t1.k+t2.k,r]$Term for t2 in p2 | (r:=t1.c*t2.c) ^= 0]
for t1 in reverse(p1)]
-- This 'reverse' is an efficiency improvement:
-- reduces both time and space [Abbott/Bradford/Davenport]
|