spielwiese
Last change
on this file since b7d0a9c 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:
624 bytes
|
Line | |
---|
1 | LIB "tst.lib";tst_init(); |
---|
2 | proc test2 (int p) |
---|
3 | { |
---|
4 | ring r= p, x(1..11), dp; |
---|
5 | poly d1= x(1) + x(2) + 1; |
---|
6 | poly f1= x(1) - x(2) - 2; |
---|
7 | poly g1= x(1) + x(2) + 2; |
---|
8 | poly d= d1^2; |
---|
9 | poly f= d*f1^2; |
---|
10 | poly g= d*g1^2; |
---|
11 | poly testgcd= gcd (f,g); |
---|
12 | testgcd= testgcd/leadcoef (testgcd); |
---|
13 | testgcd == d; |
---|
14 | int i; |
---|
15 | for (i= 3; i <= 11; i++) |
---|
16 | { |
---|
17 | d1= d1 + x(i); |
---|
18 | f1= f1 - x(i); |
---|
19 | g1= g1 + x(i); |
---|
20 | d= d1^2; |
---|
21 | f= (f1^2)*d; |
---|
22 | g= (g1^2)*d; |
---|
23 | testgcd= gcd (f, g); |
---|
24 | testgcd= testgcd/leadcoef (testgcd); |
---|
25 | testgcd == d; |
---|
26 | } |
---|
27 | } |
---|
28 | |
---|
29 | test2 (3); |
---|
30 | tst_status(); |
---|
31 | test2 (43051); |
---|
32 | tst_status(); |
---|
33 | test2 (0); |
---|
34 | tst_status(); |
---|
35 | tst_status(1); |
---|
36 | $ |
---|
37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.