"Fossies" - the Fresh Open Source Software Archive 
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 PlacesOfDegreeOne := Function( F )
2 local T, w, q, k, i, pl;
3
4
5 T := AlffVarT( F );
6 k := AlffConstField( F );
7 q := FFSize( k );
8 q := q[1] ^ q[2];
9 w := FFPrimitiveElt( k );
10 pl := [ 1 / T, T ];
11 for i in [ 1 .. q - 1 ] do
12 Add( pl, T + w ^ i );
13 od;
14 Apply( pl, function ( p )
15 return AlffPlaceSplit( F, p );
16 end );
17 pl := Filtered( Flat( pl ), function ( p )
18 return AlffPlaceDeg( p ) = 1;
19 end );
20 return pl;
21 end
22
23 function ( F, m )
24 local l, s, o;
25 AlffIsGlobalAssert( F );
26 if m < 1 then
27 return Error( "wrong degree\n" );
28 fi;
29 if not IsBound( F.N ) then
30 F.N := [ ];
31 fi;
32 if not IsBound( F.N[m] ) then
33 o := AlffOrderEqFinite( F );
34 l := Filtered( AlffPlaceSplitType( F, 1 / AlffVarT( F ) ),
35 function ( a )
36 return m mod a[2] = 0;
37 end );
38 s := Sum( l, function ( a )
39 return a[2];
40 end );
41 l := Filtered( Factor( AlffOrderDisc( o ) ), function ( a )
42 return m mod PolyDeg( a[1] ) = 0;
43 end );
44 l := Concatenation( List( l, function ( a )
45 return AlffPlaceSplit( F, a[1] );
46 end ) );
47 l := Filtered( l, function ( a )
48 return m mod AlffPlaceDeg( a ) = 0;
49 end );
50 s := s + Sum( l, function ( a )
51 return AlffPlaceDeg( a );
52 end );
53 s := s + AlffPlacesDegOneNonSingFiniteNum( F, m );
54 F.N[m] := s;
55 fi;
56 return F.N[m];
57 end