File: gaussian.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 (118 lines) | stat: -rw-r--r-- 2,916 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#############################################################################
##
#W  gaussian.tst                GAP library                     Thomas Breuer
##
#H  @(#)$Id: gaussian.tst,v 4.9.4.3 2005/08/29 14:50:35 gap Exp $
##
#Y  Copyright (C)  1996,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
##
##  To be listed in testall.g
##

gap> START_TEST("$Id: gaussian.tst,v 4.9.4.3 2005/08/29 14:50:35 gap Exp $");

gap> 257 in GaussianIntegers;
true
gap> 257 + 17*E(4) in GaussianIntegers;
true
gap> 1/2 in GaussianIntegers;
false
gap> 1 + E(3) in GaussianIntegers;
false

gap> 257 in GaussianRationals;
true
gap> 257 + 17*E(4) in GaussianRationals;
true
gap> 1/2 in GaussianRationals;
true
gap> 1 + E(3) in GaussianRationals;
false

gap> IsSubset( GaussianRationals, GaussianIntegers );
true

gap> Quotient( GaussianIntegers, 35, 5 );
7
gap> Quotient( GaussianIntegers, 35, 1+2*E(4) );
7-14*E(4)
gap> Quotient( GaussianIntegers, 35, 1+E(4) );
fail

gap> IsAssociated( GaussianIntegers, 4, -4*E(4) );
true
gap> IsAssociated( GaussianIntegers, 4*E(4), -4 );
true
gap> IsAssociated( GaussianIntegers, 4*E(4), 5 );
false

gap> StandardAssociate( GaussianIntegers,      4 );
4
gap> StandardAssociate( GaussianIntegers,     -4 );
4
gap> StandardAssociate( GaussianIntegers, 1-E(4) );
1+E(4)
gap> StandardAssociate( GaussianIntegers, 1+E(4) );
1+E(4)

gap> EuclideanDegree( GaussianIntegers, 1+E(4) );
2
gap> EuclideanDegree( GaussianIntegers,      2 );
4

gap> EuclideanRemainder( GaussianIntegers, 35, 7 );
0
gap> EuclideanRemainder( GaussianIntegers, 5, 1+2*E(4) );
0
gap> EuclideanRemainder( GaussianIntegers, 5, 1+E(4) );
-1
gap> EuclideanRemainder( GaussianIntegers, 5-2*E(4), 1+E(4) );
-1

gap> EuclideanQuotient( GaussianIntegers, 35, 7 );
5
gap> EuclideanQuotient( GaussianIntegers, 5, 1+2*E(4) );
1-2*E(4)
gap> EuclideanQuotient( GaussianIntegers, 5, 1+E(4) );
3-3*E(4)
gap> EuclideanQuotient( GaussianIntegers, 5-2*E(4), 1+E(4) );
2-4*E(4)

gap> QuotientRemainder( GaussianIntegers, 35, 7 );
[ 5, 0 ]
gap> QuotientRemainder( GaussianIntegers, 5, 1+2*E(4) );
[ 1-2*E(4), 0 ]
gap> QuotientRemainder( GaussianIntegers, 5, 1+E(4) );
[ 3-3*E(4), -1 ]
gap> QuotientRemainder( GaussianIntegers, 5-2*E(4), 1+E(4) );
[ 2-4*E(4), -1 ]

gap> IsPrime( GaussianIntegers, 3 );
true
gap> IsPrime( GaussianIntegers, 5 );
false
gap> IsPrime( GaussianIntegers, 2+E(4) );
true
gap> IsPrime( GaussianIntegers, 1+2*E(4) );
true
gap> IsPrime( GaussianIntegers, 5-E(4) );
false

gap> Factors( GaussianIntegers, 35 );
[ 2-E(4), 2+E(4), 7 ]
gap> Factors( GaussianIntegers, 255 );
[ -3, 1+2*E(4), 2+E(4), 1+4*E(4), 4+E(4) ]
gap> Factors( GaussianIntegers, 2+E(4) );
[ 2+E(4) ]
gap> Factors( GaussianIntegers, 1+2*E(4) );
[ 1+2*E(4) ]
gap> Factors( GaussianIntegers, 5-E(4) );
[ 1-E(4), 3+2*E(4) ]

gap> STOP_TEST( "gaussian.tst", 600000 );


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