line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Math::MVPoly::Integer;
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Copyright (c) 1998 by Brian Guarraci. All rights reserved.
|
4
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify it
|
5
|
|
|
|
|
|
|
# under the same terms as Perl itself.
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
6
|
use Math::MVPoly::Monomial;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
175
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub
|
11
|
|
|
|
|
|
|
gcd
|
12
|
|
|
|
|
|
|
{
|
13
|
144
|
|
|
144
|
1
|
138
|
my $u;
|
14
|
|
|
|
|
|
|
my $v;
|
15
|
0
|
|
|
|
|
0
|
my $q;
|
16
|
0
|
|
|
|
|
0
|
my $t;
|
17
|
0
|
|
|
|
|
0
|
my $g;
|
18
|
|
|
|
|
|
|
|
19
|
144
|
|
|
|
|
176
|
my $a = $_[0];
|
20
|
144
|
|
|
|
|
149
|
my $b = $_[1];
|
21
|
|
|
|
|
|
|
|
22
|
144
|
|
|
|
|
270
|
$u = [1,0,abs($a)];
|
23
|
144
|
|
|
|
|
255
|
$v = [0,1,abs($b)];
|
24
|
|
|
|
|
|
|
|
25
|
144
|
|
|
|
|
312
|
while($$v[2])
|
26
|
|
|
|
|
|
|
{
|
27
|
150
|
|
|
|
|
240
|
$q = int($$u[2]/$$v[2]);
|
28
|
150
|
|
|
|
|
423
|
$t = [ $$u[0] - $$v[0]*$q,
|
29
|
|
|
|
|
|
|
$$u[1] - $$v[1]*$q,
|
30
|
|
|
|
|
|
|
$$u[2] - $$v[2]*$q];
|
31
|
150
|
|
|
|
|
170
|
$u = $v;
|
32
|
150
|
|
|
|
|
380
|
$v = $t;
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
|
35
|
144
|
|
|
|
|
171
|
$g = $$u[2];
|
36
|
|
|
|
|
|
|
|
37
|
144
|
|
|
|
|
419
|
return $g;
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1;
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__
|