This file is indexed.

/usr/share/axiom-20170501/src/algebra/GALPOLYU.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
)abbrev package GALPOLYU GaloisGroupPolynomialUtilities
++ Author: Frederic Lehobey
++ Date Created: 30 June 1994
++ Date Last Updated: 15 July 1994
++ Description: 
++ \spadtype{GaloisGroupPolynomialUtilities} provides useful
++ functions for univariate polynomials which should be added to 
++ \spadtype{UnivariatePolynomialCategory} or to \spadtype{Factored}

GaloisGroupPolynomialUtilities(R,UP) : SIG == CODE where
  R : Ring
  UP : UnivariatePolynomialCategory R

  N ==> NonNegativeInteger
  P ==> PositiveInteger

  SIG ==> with

    monic? : UP -> Boolean
      ++ monic?(p) tests if p is monic (leading coefficient equal to 1).

    unvectorise : Vector R -> UP
      ++ unvectorise(v) returns the polynomial which has for coefficients the
      ++ entries of v in the increasing order.

    reverse : UP -> UP
      ++ reverse(p) returns the reverse polynomial of p.

    scaleRoots : (UP,R) -> UP
      ++ scaleRoots(p,c) returns the polynomial which has c times the roots
      ++ of p.

    shiftRoots : (UP,R) -> UP
      ++ shiftRoots(p,c) returns the polynomial which has for roots c added 
      ++ to the roots of p.

    degreePartition : Factored UP -> Multiset N
      ++ degreePartition(f) returns the degree partition (the multiset
      ++ of the degrees of the irreducible factors) of
      ++ the polynomial f.

    factorOfDegree : (P, Factored UP) -> UP
      ++ factorOfDegree(d,f) returns a factor of degree d of the factored
      ++ polynomial f. Such a factor shall exist.

    factorsOfDegree : (P, Factored UP) -> List UP
      ++ factorsOfDegree(d,f) returns the factors of degree d of the factored
      ++ polynomial f.

  CODE ==> add

    import Factored UP

    factorsOfDegree(d:P,r:Factored UP):List UP ==
      lfact : List UP := empty()
      for fr in factors r | degree(fr.factor)=(d::N) repeat
        for i in 1..fr.exponent repeat
          lfact := cons(fr.factor,lfact)
      lfact

    factorOfDegree(d:P,r:Factored UP):UP ==
      factor : UP := 0
      for i in 1..numberOfFactors r repeat
        factor := nthFactor(r,i)
        if degree(factor)=(d::N) then return factor
      error "factorOfDegree: Bad arguments"

    degreePartition(r:Factored UP):Multiset N ==
      multiset([ degree(nthFactor(r,i)) for i in 1..numberOfFactors r ])

    monic?(p:UP):Boolean == (leadingCoefficient p) = 1

    unvectorise(v:Vector R):UP ==
      p : UP := 0
      for i in 1..#v repeat p := p + monomial(v(i),(i-1)::N)
      p

    reverse(p:UP):UP ==
      r : UP := 0
      n := degree(p)
      for i in 0..n repeat r := r + monomial(coefficient(p,(n-i)::N),i)
      r

    scaleRoots(p:UP,c:R):UP ==
      (c = 1) => p
      n := degree p
      zero? c => monomial(leadingCoefficient p,n)
      r : UP := 0
      mc : R := 1
      for i in n..0 by -1 repeat
        r := r + monomial(mc*coefficient(p,i),i)
        mc := mc*c
      r

    import UnivariatePolynomialCategoryFunctions2(R,UP,UP,
     SparseUnivariatePolynomial UP)

    shiftRoots(p:UP,c:R):UP == elt(map(coerce,p),monomial(1,1)$UP-c::UP)::UP