spielwiese
Last change
on this file since 887634 was
19609c,
checked in by Christian Eder, 12 years ago
|
1. adds documentation for sba
2. adds tests for sba
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | // $Id$ |
---|
2 | |
---|
3 | // sba_s.tst -- long tests for sba |
---|
4 | // uses rcyclic examples from ISSAC'98 paper |
---|
5 | |
---|
6 | LIB "tst.lib"; |
---|
7 | tst_init(); |
---|
8 | |
---|
9 | LIB"poly.lib"; |
---|
10 | |
---|
11 | proc econ(int n) { |
---|
12 | |
---|
13 | int z = n-1; |
---|
14 | ring R = 32003,(x(0..z)),dp; |
---|
15 | |
---|
16 | int m,j,k; |
---|
17 | ideal i; |
---|
18 | poly p; |
---|
19 | p = 1; |
---|
20 | for(m=0;m<=z-2;m++) { |
---|
21 | p = p*x(m)*x(z); |
---|
22 | k = 0; |
---|
23 | for(j=m+1;j<=z-1;j++) { |
---|
24 | p = p + x(k)*x(j)*x(z); |
---|
25 | k++; |
---|
26 | } |
---|
27 | p = p - (m+1); |
---|
28 | i[m+1] = p; |
---|
29 | p = 1; |
---|
30 | } |
---|
31 | i[n-1] = x(z-1)*x(z)-(z); |
---|
32 | p = 0; |
---|
33 | for(m=0;m<=z-1;m++) { |
---|
34 | p = p + x(m); |
---|
35 | } |
---|
36 | p = p + 1; |
---|
37 | i[n] = p; |
---|
38 | |
---|
39 | string bench = "ECO-"+string(z+1); |
---|
40 | export(i); |
---|
41 | export(R); |
---|
42 | |
---|
43 | return(bench); |
---|
44 | } |
---|
45 | |
---|
46 | proc econh(int n) { |
---|
47 | |
---|
48 | int z = n-1; |
---|
49 | ring R = 32003,(x(0..z),h),dp; |
---|
50 | |
---|
51 | int m,j,k; |
---|
52 | ideal i; |
---|
53 | poly p; |
---|
54 | p = 1; |
---|
55 | for(m=0;m<=z-2;m++) { |
---|
56 | p = p*x(m)*x(z)*h; |
---|
57 | k = 0; |
---|
58 | for(j=m+1;j<=z-1;j++) { |
---|
59 | p = p + x(k)*x(j)*x(z); |
---|
60 | k++; |
---|
61 | } |
---|
62 | p = p - (m+1)*h^3; |
---|
63 | i[m+1] = p; |
---|
64 | p = 1; |
---|
65 | } |
---|
66 | i[n-1] = x(z-1)*x(z)-(z)*h^2; |
---|
67 | p = 0; |
---|
68 | for(m=0;m<=z-1;m++) { |
---|
69 | p = p + x(m); |
---|
70 | } |
---|
71 | p = p + h; |
---|
72 | i[n] = p; |
---|
73 | |
---|
74 | string bench = "ECO-"+string(z+1)+"-H"; |
---|
75 | export(i); |
---|
76 | export(R); |
---|
77 | |
---|
78 | return(bench); |
---|
79 | } |
---|
80 | |
---|
81 | string bench = econ(11); |
---|
82 | sprintf(bench); |
---|
83 | ideal f; |
---|
84 | f = sba(i,0,1); |
---|
85 | killall; |
---|
86 | string bench = econh(11); |
---|
87 | sprintf(bench); |
---|
88 | ideal f; |
---|
89 | f = sba(i,1,1); |
---|
90 | killall; |
---|
91 | |
---|
92 | tst_status(1);$ |
---|
93 | LIB "poly.lib"; |
---|
94 | killall(); |
---|
95 | killall("proc"); |
---|
96 | exit; |
---|
Note: See
TracBrowser
for help on using the repository browser.