fieker-DuValspielwiese
Last change
on this file since 352a84b was
60cc12,
checked in by Martin Lee <martinlee84@…>, 12 years ago
|
chg: added new tests for gcd from http://home.bway.net/lewis/fermat/gcdcomp
and "Evaluation of the Heuristic Polynomial GCD"
|
-
Property mode set to
100644
|
File size:
590 bytes
|
Line | |
---|
1 | LIB "tst.lib";tst_init(); |
---|
2 | proc test4 (int p) |
---|
3 | { |
---|
4 | ring r= p, x(1..11), dp; |
---|
5 | poly d= x(1)^2*x(2)^2 + 1; |
---|
6 | poly f1= x(1)^2 - x(2)^2 - 1; |
---|
7 | poly g1= x(1)*x(2) + 2; |
---|
8 | poly f= d*f1; |
---|
9 | poly g= d*g1^2; |
---|
10 | poly testgcd= gcd (f,g); |
---|
11 | testgcd= testgcd/leadcoef (testgcd); |
---|
12 | testgcd == d; |
---|
13 | int i; |
---|
14 | for (i= 3; i <= 11; i++) |
---|
15 | { |
---|
16 | d= d + x(i)^2; |
---|
17 | f1= f1 + x(i)^2; |
---|
18 | g1= g1 + x(i); |
---|
19 | f= f1*d; |
---|
20 | g= d*g1^2; |
---|
21 | testgcd= gcd (f,g); |
---|
22 | testgcd= testgcd/leadcoef (testgcd); |
---|
23 | testgcd == d; |
---|
24 | } |
---|
25 | } |
---|
26 | |
---|
27 | test4 (3); |
---|
28 | tst_status(); |
---|
29 | test4 (43051); |
---|
30 | tst_status(); |
---|
31 | test4 (0); |
---|
32 | tst_status(); |
---|
33 | tst_status(1); |
---|
34 | $ |
---|
Note: See
TracBrowser
for help on using the repository browser.