/usr/share/axiom-20170501/src/algebra/SYMFUNC.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 | )abbrev package SYMFUNC SymmetricFunctions
++ Author: Manuel Bronstein
++ Date Created: 13 Feb 1989
++ Date Last Updated: 28 Jun 1990
++ Description:
++ Computes all the symmetric functions in n variables.
SymmetricFunctions(R) : SIG == CODE where
R : Ring
UP ==> SparseUnivariatePolynomial R
SIG ==> with
symFunc : List R -> Vector R
++ symFunc([r1,...,rn]) returns the vector of the
++ elementary symmetric functions in the \spad{ri's}:
++ \spad{[r1 + ... + rn, r1 r2 + ... + r(n-1) rn, ..., r1 r2 ... rn]}.
symFunc : (R, PositiveInteger) -> Vector R
++ symFunc(r, n) returns the vector of the elementary
++ symmetric functions in \spad{[r,r,...,r]} \spad{n} times.
CODE ==> add
signFix: (UP, NonNegativeInteger) -> Vector R
symFunc(x, n) == signFix((monomial(1, 1)$UP - x::UP) ** n, 1 + n)
symFunc l ==
signFix(*/[monomial(1, 1)$UP - a::UP for a in l], 1 + #l)
signFix(p, n) ==
m := minIndex(v := vectorise(p, n)) + 1
for i in 0..((#v quo 2) - 1)::NonNegativeInteger repeat
qsetelt_!(v, 2*i + m, - qelt(v, 2*i + m))
reverse_! v
|