source: git/Tst/Long/fetch_l.tst @ f4a33e

spielwiese
Last change on this file since f4a33e was 341696, checked in by Hans Schönemann <hannes@…>, 14 years ago
Adding Id property to all files git-svn-id: file:///usr/local/Singular/svn/trunk@12231 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.7 KB
Line 
1LIB "tst.lib";
2tst_init();
3tst_ignore("CVS ID: $Id$");
4
5proc generate_ring_str(int n, string r_name, string ostring)
6{
7  return ("ring "+r_name+" = 32003,x(1.." + string(n) + ")," + ostring + ";");
8}
9
10proc generate_polys_str(int n)
11{
12  string polystr = "poly p = ";
13  int i;
14
15  for (i=1; i<=n; i = i + (i / 10) + 1)
16  {
17    polystr = polystr + "x(" + string(i) + ") + ";
18  }
19  return (polystr + "1; poly p1 = p^2+p; vector p2 = (p^2+p)*(gen(2) + gen(3)); vector p3 = (p^2+p)*(gen(2) + gen(3))+ p^2 + p; vector p4 = p3 + p^3;p; p1; p2; p3; p4");
20}
21
22proc generate_weight_str(int j)
23{
24  int i;
25  string res_str = "(";
26 
27  for (i=1; i<j; i++)
28  {
29    res_str = res_str + string(i) + ",";
30  }
31  return (res_str + string(j) + ")");
32}
33
34
35list orderings = "lp", "dp", "Dp", "ls", "ds", "Ds";
36
37list l = "dp";
38
39proc extend_orderings(list olist, int j)
40{
41  int i;
42  int c1;
43  int c2;
44  string o1;
45  string o2;
46  string o3;
47  list nl;
48  string weight_string = generate_weight_str(j);
49  o1 = olist[1];
50  if (size(olist) > 1)
51  {
52    o2 = olist[2];
53    if (size(olist) > 2)
54    {
55      o3 = olist[3];
56    }
57    else
58    {
59      o3 = olist[2];
60    }
61  }
62  else
63  {
64    o2 = o1;
65    o3 = o1;
66  }
67     
68  // add weight orderings
69  olist = olist + list("Wp" + weight_string, "wp" + weight_string);
70
71   
72  for (i=1; i<=size(olist); i++)
73  {
74    nl = nl + list(olist[i], "(C," + olist[i] + ")", "(c," + olist[i] + ")",
75                   "(" + olist[i] + ",C)", "(" + olist[i] + ",c)");
76  }
77
78  // add product orderings
79  if (j > 1)
80  {
81    c1 = j / 2;
82    if (c1 + c1 == j)
83    {
84      c2 = c1;
85    }
86    else
87    {
88      c2 = c1 + 1;
89    }
90    nl = nl + list("(" + o1 + "(" + string(c1) + "),"+ o2 + "(" + string(c2) + "))", "(" + o1 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))");
91    // and, extra weight vector
92    nl = nl + list("(a" + weight_string + "," + o2 + "(" + string(c1) + "),"+ o3 + "(" + string(c2) + "))", "(a" + generate_weight_str(j-1)+ "," + o3 + "(" + string(c1) + "),"+ o1 + "(" + string(c2) + "))");
93  }
94
95  // and, last but not least, a Matrix ordering
96  nl = nl + list("M(m)");
97 
98  return (nl);
99
100}
101   
102proc check_fetch(int n, list olist)
103{
104  int i;
105  int j;
106  list e_olist;
107 
108  for (j=1; j<=n; j = j + (j / 10) + 1)
109  {
110    e_olist = extend_orderings(olist, j);
111    execute(generate_ring_str(j, "r", e_olist[1]));
112    execute(generate_polys_str(j));
113    intmat m[j][j];
114    m = m + 1;
115    for (i=1; i<=size(e_olist); i++)
116    {
117      execute(generate_ring_str(j, "r1", e_olist[i]));
118      fetch(r, p);
119      fetch(r, p1);
120      fetch(r, p2);
121      fetch(r, p3);
122      fetch(r, p4);
123      r1;
124      kill r1;
125    }
126    kill r;
127    kill m;
128  }
129}
130
131check_fetch(15, orderings);
132
133tst_status(1);$
134 
135 
136
Note: See TracBrowser for help on using the repository browser.