Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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

""" 

Long tests for libGAP 

 

These stress test the garbage collection inside GAP 

""" 

 

from sage.libs.all import libgap 

 

 

def test_loop_1(): 

""" 

EXAMPLES:: 

 

sage: from sage.libs.gap.test_long import test_loop_1 

sage: test_loop_1() # long time (up to 25s on sage.math, 2013) 

""" 

libgap.collect() 

for i in range(10000): 

G = libgap.CyclicGroup(2) 

 

 

def test_loop_2(): 

""" 

EXAMPLES:: 

 

sage: from sage.libs.gap.test_long import test_loop_2 

sage: test_loop_2() # long time (10s on sage.math, 2013) 

""" 

G =libgap.FreeGroup(2) 

a,b = G.GeneratorsOfGroup() 

for i in range(100): 

rel = libgap([a**2, b**2, a*b*a*b]) 

H = G / rel 

H1 = H.GeneratorsOfGroup()[0] 

n = H1.Order() 

assert n.sage() == 2 

 

for i in range(300000): 

n = libgap.Order(H1) 

 

 

def test_loop_3(): 

""" 

EXAMPLES:: 

 

sage: from sage.libs.gap.test_long import test_loop_3 

sage: test_loop_3() # long time (31s on sage.math, 2013) 

""" 

G = libgap.FreeGroup(2) 

(a,b) = G.GeneratorsOfGroup() 

for i in range(300000): 

lis=libgap([]) 

lis.Add(a ** 2) 

lis.Add(b ** 2) 

lis.Add(b * a)