1 | LIB "tst.lib"; tst_init(); |
---|
2 | LIB "ring.lib"; |
---|
3 | ring r=0,(x,y,z),ds; |
---|
4 | show(r);""; |
---|
5 | // blocksize is derived from no of vars: |
---|
6 | int t=5; |
---|
7 | def R1=extendring(t,"a","dp"); //t global: "dp" -> "dp(5)" |
---|
8 | show(R1); setring R1; ""; |
---|
9 | def R2=extendring(4,"T(","c,dp",1,r); //"dp" -> "c,..,dp(4)" |
---|
10 | show(R2); setring R2; ""; |
---|
11 | // no intvec given, blocksize given: given blocksize is used: |
---|
12 | def R3=extendring(4,"T(","dp(2)",0,r); // "dp(2)" -> "dp(2)" |
---|
13 | show(R3); setring R3; ""; |
---|
14 | // intvec given: weights and blocksize is derived from given intvec |
---|
15 | // (no specification of a blocksize in the given ordstr is allowed!) |
---|
16 | // if intvec does not cover all given blocks, the last block is used |
---|
17 | // for the remaining variables, if intvec has too many components, |
---|
18 | // the last ones are ignored |
---|
19 | intvec v=3,2,3,4,1,3; |
---|
20 | def R4=extendring(10,"A","ds,ws,Dp,dp",v,0,r); |
---|
21 | // v covers 3 blocks: v[1] (=3) : no of components of ws |
---|
22 | // next v[1] values (=v[2..4]) give weights |
---|
23 | // remaining components of v are used for the remaining blocks |
---|
24 | show(R4); |
---|
25 | kill r,R1,R2,R3,R4; |
---|
26 | tst_status(1);$ |
---|