File: grpfree.tst

package info (click to toggle)
gap 4r4p12-2
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 29,584 kB
  • ctags: 7,113
  • sloc: ansic: 98,786; sh: 3,299; perl: 2,263; makefile: 498; asm: 63; awk: 6
file content (100 lines) | stat: -rw-r--r-- 1,965 bytes parent folder | download | duplicates (3)
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
99
100
#############################################################################
##
#W  grpfree.tst                GAP-4 library                    Thomas Breuer
##
#H  @(#)$Id: grpfree.tst,v 4.10.4.3 2005/05/11 14:53:02 gap Exp $
##
#Y  Copyright 1997,    Lehrstuhl D fuer Mathematik,   RWTH Aachen,    Germany
##
##  To be listed in testall.g
##

gap> START_TEST("$Id: grpfree.tst,v 4.10.4.3 2005/05/11 14:53:02 gap Exp $");

gap> g:= FreeGroup( "a", "b" );
<free group on the generators [ a, b ]>
gap> IsWholeFamily( g );
true
gap> IsFinite( g );
false
gap> Size( g );
infinity
gap> gens:= GeneratorsOfGroup( g );
[ a, b ]
gap> a:= gens[1];; b:= gens[2];;
gap> iter:= Iterator( g );;
gap> for i in [ 1 .. 50 ] do
>   Print( NextIterator( iter ), "\n" );
> od;
<identity ...>
a
a^-1
b
b^-1
a^2
a^-2
b*a
b^-1*a
b*a^-1
b^-1*a^-1
a*b
a^-1*b
a*b^-1
a^-1*b^-1
b^2
b^-2
a^3
a^-3
b*a^2
b^-1*a^2
b*a^-2
b^-1*a^-2
a*b*a
a^-1*b*a
a*b^-1*a
a^-1*b^-1*a
a*b*a^-1
a^-1*b*a^-1
a*b^-1*a^-1
a^-1*b^-1*a^-1
b^2*a
b^-2*a
b^2*a^-1
b^-2*a^-1
a^2*b
a^-2*b
a^2*b^-1
a^-2*b^-1
b*a*b
b^-1*a*b
b*a^-1*b
b^-1*a^-1*b
b*a*b^-1
b^-1*a*b^-1
b*a^-1*b^-1
b^-1*a^-1*b^-1
a*b^2
a^-1*b^2
a*b^-2
gap> IsDoneIterator( iter );
false
gap> enum:= Enumerator( g );;
gap> first50:=List( [ 1 .. 50 ], x -> enum[x] );;
gap> Print(first50,"\n");
[ <identity ...>, a, a^-1, b, b^-1, a^2, a^-2, b*a, b^-1*a, a*b, a^-1*b, 
  b*a^-1, b^-1*a^-1, a*b^-1, a^-1*b^-1, b^2, b^-2, a^3, a^-3, b*a^2, 
  b^-1*a^2, a*b*a, a^-1*b*a, b*a^-2, b^-1*a^-2, a*b^-1*a, a^-1*b^-1*a, b^2*a, 
  b^-2*a, a^2*b, a^-2*b, b*a*b, b^-1*a*b, a*b*a^-1, a^-1*b*a^-1, b*a^-1*b, 
  b^-1*a^-1*b, a*b^-1*a^-1, a^-1*b^-1*a^-1, b^2*a^-1, b^-2*a^-1, a^2*b^-1, 
  a^-2*b^-1, b*a*b^-1, b^-1*a*b^-1, a*b^2, a^-1*b^2, b*a^-1*b^-1, 
  b^-1*a^-1*b^-1, a*b^-2 ]
gap> List( first50, x -> Position( enum, x ) ) = [ 1 .. 50 ];
true

gap> STOP_TEST( "grpfree.tst", 4200000 );


#############################################################################
##
#E