This file is indexed.

/usr/share/axiom-20170501/src/algebra/LSPP.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
)abbrev package LSPP LinearSystemPolynomialPackage
++ Author:  P.Gianni
++ Date Created: Summer 1985
++ Date Last Updated: Summer 1993
++ Description:
++ This package finds the solutions of linear systems presented as a
++ list of polynomials.

LinearSystemPolynomialPackage(R, E, OV, P) : SIG == CODE where
  R : IntegralDomain
  OV : OrderedSet
  E : OrderedAbelianMonoidSup
  P : PolynomialCategory(R,E,OV)

  F ==> Fraction P
  NNI ==> NonNegativeInteger
  V ==> Vector
  M ==> Matrix
  Soln ==> Record(particular: Union(V F, "failed"), basis: List V F)

  SIG ==> with

    linSolve : (List P, List OV) -> Soln
      ++ linSolve(lp,lvar) finds the solutions of the linear system
      ++ of polynomials lp = 0 with respect to the list of symbols lvar.

  CODE ==> add

                        ---- Local Functions ----

    poly2vect:    (P,     List OV)    -> Record(coefvec: V F, reductum: F)
    intoMatrix:   (List P,   List OV) -> Record(mat: M F, vec: V F)


    poly2vect(p : P, vs : List OV) : Record(coefvec: V F, reductum: F) ==
      coefs := new(#vs, 0)$(V F)
      for v in vs for i in 1.. while p ^= 0 repeat
        u := univariate(p, v)
        degree u = 0 => "next v"
        coefs.i := (c := leadingCoefficient u)::F
        p := p - monomial(c,v, 1)
      [coefs, p :: F]

    intoMatrix(ps : List P, vs : List OV ) : Record(mat: M F, vec: V F) ==
      m := zero(#ps, #vs)$M(F)
      v := new(#ps, 0)$V(F)
      for p in ps for i in 1.. repeat
        totalDegree(p,vs) > 1 => error "The system is not linear"
        r   := poly2vect(p,vs)
        m:=setRow_!(m,i,r.coefvec)
        v.i := - r.reductum
      [m, v]

    linSolve(ps, vs) ==
      r := intoMatrix(ps, vs)
      solve(r.mat, r.vec)$LinearSystemMatrixPackage(F,V F,V F,M F)