File: coldt.gi

package info (click to toggle)
gap-polycyclic 2.17-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 2,796 kB
  • sloc: xml: 3,018; javascript: 155; makefile: 124
file content (64 lines) | stat: -rw-r--r-- 1,435 bytes parent folder | download | duplicates (5)
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

##
#F  AddHallPolynomials
##
BindGlobal( "AddHallPolynomials", function( coll )

    if not IsWeightedCollector( coll ) then

        Error( "Hall polynomials can be computed ",
               "for weighted collectors only" );
    fi;

    if not IsBound( coll![PC_DEEP_THOUGHT_POLS] ) or
       coll![PC_DEEP_THOUGHT_POLS] = [] then

        # Compute the deep thought polynomials
        coll![PC_DEEP_THOUGHT_POLS] := Calcreps2(coll![PC_CONJUGATES], 8, 1);

        # Compute the orders of the genrators of dtrws
        CompleteOrdersOfRws(coll);

        # reduce the coefficients of the deep thought polynomials
        ReduceCoefficientsOfRws(coll);

        SetIsPolynomialCollector( coll, true );
    fi;

end );


##
##  Methods for  CollectWordOrFail.
##
InstallMethod(CollectWordOrFail,

    "FTL collector with Hall polynomials, exponent vector, gen-exp-pairs",

    [ IsFromTheLeftCollectorRep
      and IsPolynomialCollector
      and IsUpToDatePolycyclicCollector,
      IsList,
      IsList],

function( coll, l, genexp )
    local   res,  i,  n;

    if Length(genexp) = 0 then return true; fi;

    res := ObjByExponents( coll, l );

    i := 1;
    while i < Length(genexp) do
        res := DTMultiply( res, [genexp[i], genexp[i+1]], coll );
        i := i + 2;
    od;

    for i in [1..Length(l)] do l[i] := 0; od;
    n := Length( res );
    l{ res{[1,3..n-1]} } := res{ [2,4..n] };

    return true;
end );