[BACK]Return to minimal-test.k CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / lib / minimal

Annotation of OpenXM/src/k097/lib/minimal/minimal-test.k, Revision 1.17

1.17    ! takayama    1: /* $OpenXM: OpenXM/src/k097/lib/minimal/minimal-test.k,v 1.16 2000/08/09 03:45:27 takayama Exp $ */
1.1       takayama    2: load["minimal.k"];
                      3: def sm1_resol1(p) {
                      4:   sm1(" p resol1 /FunctionValue set ");
                      5: }
                      6:
                      7: def test8() {
                      8:   local p,pp,ans,b,c,cc,ww,ww2;
                      9:   f = "x^3-y^2*z^2";
                     10:   p = Sannfs(f,"x,y,z");
                     11:   ww = [["x",1,"y",1,"z",1,"Dx",1,"Dy",1,"Dz",1,"h",1],
                     12:                  ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                     13:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                     14:   sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set ");
                     15:   Sweyl("x,y,z",ww);
                     16:   pp = Map(p,"Spoly");
                     17:   /* return(pp); */
                     18:   /* pp =
                     19:      [y*Dy-z*Dz , -2*x*Dx-3*y*Dy+1 , 2*x*Dy*Dz^2-3*y*Dx^2 ,
                     20:       2*x*Dy^2*Dz-3*z*Dx^2 , 2*x*z*Dz^3-3*y^2*Dx^2+4*x*Dz^2 ]
                     21:   */
                     22:   ans = sm1_resol1([pp,"x,y,z",ww]);
                     23:   /* Schreyer is in ans. */
                     24:
                     25:   v = [x,y,z];
                     26:   b = ans;
                     27:   Println("------ ker=im for Schreyer ?------------------");
                     28:   c = Skernel(b[0],v);
                     29:   c = c[0];
                     30:   sm1_pmat([c,b[1],v]);
                     31:   cc = sm1_res_div(c,b[1],v);
                     32:   sm1_pmat(sm1_gb(cc,v));
                     33:   c = Skernel(b[1],v);
                     34:   c = c[0];
                     35:   cc = sm1_res_div(c,b[2],v);
                     36:   sm1_pmat(sm1_gb(cc,v));
                     37:   return(ans);
                     38: }
                     39: /*
                     40:    a = test8();
                     41:    SisComplex(a):
                     42: */
                     43:
1.3       takayama   44: def test11() {
                     45:   local  a;
                     46:   a = test_ann3("x^3-y^2*z^2");
                     47:   return(a);
                     48: }
                     49: /* f should be a string. */
1.5       takayama   50: /* a=test_ann3("x^3+y^3+z^3");
                     51: It returns the following resolution in 1.5 hours.  June 14, 2000.
                     52:  [
                     53:   [
                     54:     [    x*Dx+y*Dy+z*Dz-3*h^2 ]
                     55:     [    -z*Dy^2+y*Dz^2 ]
                     56:     [    -z*Dx^2+x*Dz^2 ]
                     57:     [    -y*Dx^2+x*Dy^2 ]
                     58:   ]
                     59:   [
                     60:     [    0 , -x , y , -z ]
                     61:     [    z*Dx^2-x*Dz^2 , x*Dy , x*Dx+z*Dz-3*h^2 , z*Dy ]
                     62:     [    y*Dx^2-x*Dy^2 , -x*Dz , y*Dz , x*Dx+y*Dy-3*h^2 ]
                     63:     [    0 , Dx^2 , -Dy^2 , Dz^2 ]
                     64:     [    z*Dy^2-y*Dz^2 , x*Dx+y*Dy+z*Dz-2*h^2 , 0 , 0 ]
                     65:   ]
                     66:   [
                     67:     [    -x*Dx+3*h^2 , y , -z , 0 , -x ]
                     68:     [    Dy^3+Dz^3 , Dy^2 , -Dz^2 , x*Dx+y*Dy+z*Dz , -Dx^2 ]
                     69:   ]
                     70:  ]
                     71: */
1.3       takayama   72: def test_ann3(f) {
                     73:   local a,v,ww2,ans2;
1.7       takayama   74:   a = Sannfs3(f);
1.3       takayama   75:   ans2 = a[0];
                     76:   v = [x,y,z];
                     77:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                     78:   Sweyl("x,y,z",ww2);
                     79:   ans2 = ReParse(ans2);
                     80:   r= IsExact_h(ans2,[x,y,z]);
                     81:   Println(r);
1.9       takayama   82:   return([r,ans2,a]);
1.3       takayama   83: }
                     84: def test11a() {
                     85:   local a,v,ww2,ans2;
                     86: /* constructed by test11.
                     87:   ans2 =
                     88:        [[[y*Dy-z*Dz] , [-2*x*Dx-3*z*Dz+h^2] , [2*x*Dy*Dz^2-3*y*Dx^2*h] , [2*x*Dy^2*Dz-3*z*Dx^2*h]] ,
                     89:         [[3*Dx^2*h , 0 , Dy , -Dz] ,
                     90:          [6*x*Dy*Dz^2-9*y*Dx^2*h , -2*x*Dy*Dz^2+3*y*Dx^2*h , -2*x*Dx-3*y*Dy , 0] ,
                     91:          [0 , 2*x*Dy^2*Dz-3*z*Dx^2*h , 0 , 2*x*Dx+3*z*Dz] ,
                     92:          [2*x*Dx+3*z*Dz-h^2 , y*Dy-z*Dz , 0 , 0] ,
                     93:          [0 , 0 , 0 , 0] ,
                     94:          [2*x*Dy*Dz , 0 , z , -y] ,
                     95:          [0 , 0 , 0 , 0] ,
                     96:          [0 , 0 , 0 , 0] ,
                     97:          [0 , 0 , 0 , 0]] ,
                     98:   [[0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
                     99:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
                    100:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
                    101:    [-2*x*Dx-3*y*Dy-3*z*Dz-6*h^2 , -Dy , -Dz , 3*Dx^2*h , 3*Dy^2 , 3*Dy*Dz , -2*x*Dy , 2*x*Dz , 0] ,
                    102:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
                    103:    [3*y*z , z , y , -2*x*Dy*Dz , -3*z*Dy , 2*x*Dx , 2*x*z , -2*x*y , 0] ,
                    104:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
                    105:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
                    106:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0]] ,
                    107:    [[0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
                    108:     [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
                    109:     [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0]]]
                    110: */
                    111:   ans2 =
                    112:        [[[y*Dy-z*Dz] , [-2*x*Dx-3*z*Dz+h^2] , [2*x*Dy*Dz^2-3*y*Dx^2*h] , [2*x*Dy^2*Dz-3*z*Dx^2*h]] ,
                    113:         [[3*Dx^2*h , 0 , Dy , -Dz] ,
                    114:          [6*x*Dy*Dz^2-9*y*Dx^2*h , -2*x*Dy*Dz^2+3*y*Dx^2*h , -2*x*Dx-3*y*Dy , 0] ,
                    115:          [0 , 2*x*Dy^2*Dz-3*z*Dx^2*h , 0 , 2*x*Dx+3*z*Dz] ,
                    116:          [2*x*Dx+3*z*Dz-h^2 , y*Dy-z*Dz , 0 , 0] ,
                    117:          [2*x*Dy*Dz , 0 , z , -y]],
                    118:   [[-2*x*Dx-3*y*Dy-3*z*Dz-6*h^2 , -Dy , -Dz , 3*Dx^2*h , 3*Dy*Dz ] ,
                    119:    [3*y*z , z , y , -2*x*Dy*Dz , 2*x*Dx]]];
                    120:
                    121:   sm1_pmat( ans2[1]*ans2[0] );
                    122:   sm1_pmat( ans2[2]*ans2[1] );
                    123:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                    124:   Sweyl("x,y,z",ww2);
                    125:   ans2 = ReParse(ans2);
                    126:   r= IsExact_h(ans2,[x,y,z]);
                    127:   Println(r);
                    128:   return([r,ans2]);
                    129: }
                    130:
                    131: def test12() {
                    132:   local a,v,ww2,ans2;
                    133:   a = Sannfs3("x^3-y^2*z^2");
                    134:   ans2 = a[0];
                    135:   v = [x,y,z];
                    136:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
1.4       takayama  137:   Sweyl("x,y,z",ww2);
                    138:   ans2 = ReParse(ans2); /* DO NOT FORGET! */
1.3       takayama  139:   r= IsExact_h(ans2,[x,y,z]);
                    140:   Println(r);
                    141:   return([r,ans2]);
                    142: }
1.4       takayama  143:
                    144: def test13() {
                    145:   Println("test13 try to construct a minimal free resolution");
                    146:   Println("of a GKZ system [[1,2]]. 6/12, 2000.");
1.5       takayama  147:   ans2 = GKZ([[1,2]],[0]);
                    148:    /* Be careful!! It resets the grade to module1, not module1v */
1.4       takayama  149:   ww2 = [["x1",-1,"x2",-1,"Dx1",1,"Dx2",1]];
                    150:   Sweyl("x1,x2",ww2);
                    151:   ans2 = ReParse(ans2[0]);
1.5       takayama  152:   Println(ans2);
1.4       takayama  153:   return(Sminimal(ans2));
                    154: }
                    155:
                    156: def test14() {
                    157:   Println("test14 try to construct a minimal free resolution");
                    158:   Println("of a GKZ system [[1,2,3]]. 6/12, 2000.");
1.6       takayama  159:   ans2 = GKZ([[1,2,3]],[0]);
                    160:      /* It stops by the strategy error.
                    161:         July 26, 2000. It works fine after fixing a bug in resol.c */
1.4       takayama  162:   ww2 = [["x1",-1,"x2",-1,"x3",-1,"Dx1",1,"Dx2",1,"Dx3",1]];
                    163:   Sweyl("x1,x2,x3",ww2);
                    164:   ans2 = ReParse(ans2[0]);
                    165:   return(Sminimal(ans2));
                    166: }
                    167: def test14a() {
                    168:   Println("test14a try to construct a minimal free resolution");
                    169:   Println("of a GKZ system [[1,2,3]]. 6/12, 2000.");
                    170:   Println("Without automatic homogenization.");
                    171:   ww2 = [["x1",-1,"x2",-1,"x3",-1,"Dx1",1,"Dx2",1,"Dx3",1]];
                    172:   Sweyl("x1,x2,x3",ww2);
                    173:   ans2 = [x1*Dx1+2*x2*Dx2+3*x3*Dx3 , Dx1^2-Dx2*h , -Dx1*Dx2+Dx3*h ,
                    174:           Dx2^2-Dx1*Dx3 ];
                    175:   ans2 = ReParse(ans2);
1.8       takayama  176:   return(Sminimal(ans2,["homogenized"]));
1.4       takayama  177: }
                    178:
                    179: def test15() {
                    180:   Println("test15 try to construct a minimal free resolution");
                    181:   Println("of a GKZ system [[1,2,3]] by the order filt. 6/12, 2000.");
                    182:   ww2 = [["Dx1",1,"Dx2",1,"Dx3",1]];
1.7       takayama  183:   ans2 = GKZ([[1,2,3]],[0]);
1.4       takayama  184:   Sweyl("x1,x2,x3",ww2);
                    185:   ans2 = ReParse(ans2[0]);
1.7       takayama  186:   a = Sminimal(ans2);
                    187:   Println("Minimal Resolution is "); sm1_pmat(a[0]);
                    188:   Sweyl("x1,x2,x3");
                    189:   ans3 = ReParse(a[0]);
                    190:   r= IsExact_h(ans3,[x1,x2,x3]);
                    191:   Println(r);
                    192:   return(a);
1.4       takayama  193: }
                    194:
                    195: def test15b() {
                    196:   Println("test15b try to construct a minimal free resolution");
                    197:   Println("of toric [[1,2,3]] by the order filt. 6/12, 2000.");
                    198:   ww2 = [["Dx1",1,"Dx2",1,"Dx3",1]];
                    199:   Sweyl("x1,x2,x3",ww2);
                    200:   ans2 = [Dx1^2-Dx2*h , -Dx1*Dx2+Dx3*h , Dx2^2-Dx1*Dx3 ];
                    201:   ans2 = ReParse(ans2);
1.8       takayama  202:   return(Sminimal(ans2,["homogenized"]));
1.4       takayama  203: }
                    204:
1.7       takayama  205: def test15c() {
                    206:   Println("test15c try to construct a minimal free resolution ");
                    207:   Println("of a GKZ system [[1,2,3]] by -1,1");
                    208:   ww2 = [["Dx1",1,"Dx2",1,"Dx3",1,"x1",-1,"x2",-1,"x3",-1]];
                    209:   ans2 = GKZ([[1,2,3]],[0]);
                    210:   Sweyl("x1,x2,x3",ww2);
                    211:   ans2 = ReParse(ans2[0]);
                    212:   a = Sminimal(ans2);
                    213:   Println("Minimal Resolution is "); sm1_pmat(a[0]);
                    214:   Sweyl("x1,x2,x3");
                    215:   ans3 = ReParse(a[0]);
                    216:   r= IsExact_h(ans3,[x1,x2,x3]);
                    217:   Println(r);
                    218:   return(a);
                    219: }
1.4       takayama  220: def test16() {
                    221:   Println("test16 try to construct a minimal free resolution");
                    222:   Println("of a GKZ system [[1,2,3,5]] by the order filt. 6/12, 2000.");
                    223:   ww2 = [["Dx1",1,"Dx2",1,"Dx3",1,"Dx4",1]];
                    224:   Sweyl("x1,x2,x3,x4",ww2);
                    225:   ans2 = GKZ([[1,2,3,5]],[0]);
                    226:   ans2 = ReParse(ans2[0]);
                    227:   return(Sminimal(ans2));
                    228: }
                    229:
                    230: def test16b() {
                    231:   Println("test16b try to construct a minimal free resolution");
                    232:   Println("of a toric [[1,2,3,5]] by the order filt. 6/12, 2000.");
                    233:   ww2 = [["Dx1",1,"Dx2",1,"Dx3",1,"Dx4",1]];
                    234:   Sweyl("x1,x2,x3,x4",ww2);
                    235:   ans2 = GKZ([[1,2,3,5]],[0]);
                    236:   ans3 = Rest(ans2[0]);
                    237:   ans3 = ReParse(ans3);
                    238:   Println("Toric variety:");
                    239:   Println(ans3);
                    240:   return(Sminimal(ans3));
                    241: }
                    242:
1.9       takayama  243:
                    244: def test17() {
                    245:    a=Sannfs3("x^3-y^2*z^2");
                    246:    b=a[0]; w = ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1];
                    247:    Sweyl("x,y,z",[w]); b = Reparse(b);
                    248:    c=Sinit_w(b,w);
                    249:    Println("Resolution (b)----");
                    250:    sm1_pmat(b);
                    251:    Println("Initial (c)----");
                    252:    sm1_pmat(c);
                    253:    Println(IsExact_h(c,"x,y,z"));
                    254: }
1.10      takayama  255:
                    256: def test_if_v_strict(resmat,w,v) {
1.12      takayama  257:    local b,c,g;
1.10      takayama  258:    Sweyl(v,[w]); b = Reparse(resmat);
1.13      takayama  259:    Println("Degree shifts ");
                    260:    Println(SgetShifts(b,w));
1.9       takayama  261:    c=Sinit_w(b,w);
                    262:    Println("Resolution (b)----");
                    263:    sm1_pmat(b);
                    264:    Println("Initial (c)----");
1.12      takayama  265:    sm1_pmat(c);
1.10      takayama  266:    Println("Exactness of the resolution ---");
1.12      takayama  267:    Println(IsExact_h(b,v));
1.10      takayama  268:    Println("Exactness of the initial complex.---");
1.12      takayama  269:    Println(IsExact_h(c,v));
1.9       takayama  270:    g = Sinvolutive(b[0],w);
1.10      takayama  271:    /* Println("Involutive basis ---");
1.11      takayama  272:       sm1_pmat(g);
1.12      takayama  273:       Println(Sinvolutive(c[0],w));
1.11      takayama  274:       sm1(" /gb.verbose 1 def "); */
1.9       takayama  275:    Println("Is same ideal?");
1.12      takayama  276:    Println(IsSameIdeal_h(g,c[0],v));
1.10      takayama  277: }
                    278: def test17b() {
                    279:    a=Sannfs3("x^3-y^2*z^2");
1.11      takayama  280:    b=a[0]; w = ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1];
1.10      takayama  281:    test_if_v_strict(b,w,"x,y,z");
                    282:    return(a);
1.9       takayama  283: }
                    284:
                    285: def test18() {
                    286:    a=Sannfs2("x^3-y^2");
                    287:    b=a[0]; w = ["x",-1,"y",-1,"Dx",1,"Dy",1];
1.10      takayama  288:    test_if_v_strict(b,w,"x,y");
                    289:    return(a);
1.9       takayama  290: }
1.4       takayama  291:
1.10      takayama  292: def test19() {
                    293:   Println("test19 try to construct a minimal free resolution and check if it is v-strict.");
                    294:   Println("of a GKZ system [[1,2,3]] by -1,1");
                    295:   ww2 = ["Dx1",1,"Dx2",1,"Dx3",1,"x1",-1,"x2",-1,"x3",-1];
                    296:   ans2 = GKZ([[1,2,3]],[0]);
                    297:   Sweyl("x1,x2,x3",[ww2]);
                    298:   ans2 = ReParse(ans2[0]);
                    299:   a = Sminimal(ans2);
                    300:   Println("Minimal Resolution is "); sm1_pmat(a[0]);
                    301:   b = a[0];
                    302:   test_if_v_strict(b,ww2,"x1,x2,x3");
                    303:   return(a);
                    304: }
                    305:
1.13      takayama  306: /* Need more than 100M memory. 291, 845, 1266, 1116, 592 : Schreyer frame.
                    307:    I've not yet tried to finish the computation. */
1.10      takayama  308: def test20() {
                    309:   w = ["Dx1",1,"Dx2",1,"Dx3",1,"Dx4",1,"x1",-1,"x2",-1,"x3",-1,"x4",-1];
                    310:   ans2 = GKZ([[1,1,1,1],[0,1,3,4]],[0,0]);
                    311:   Sweyl("x1,x2,x3,x4",[w]);
                    312:   ans2 = ReParse(ans2[0]);
                    313:   a = Sminimal(ans2);
                    314:   Println("Minimal Resolution is "); sm1_pmat(a[0]);
                    315:   b = a[0];
                    316:   /* test_if_v_strict(b,w,"x1,x2,x3,x4"); */
                    317:   return(a);
                    318: }
                    319: def test20b() {
                    320:   w = ["Dx1",1,"Dx2",1,"Dx3",1,"Dx4",1,"x1",-1,"x2",-1,"x3",-1,"x4",-1];
                    321:   ans2 = GKZ([[1,1,1,1],[0,1,3,4]],[1,2]);
                    322:   Sweyl("x1,x2,x3,x4",[w]);
                    323:   ans2 = ReParse(ans2[0]);
                    324:   a = Sminimal(ans2);
                    325:   Println("Minimal Resolution is "); sm1_pmat(a[0]);
                    326:   b = a[0];
                    327:   /* test_if_v_strict(b,w,"x1,x2,x3,x4"); */
                    328:   return(a);
                    329: }
1.13      takayama  330:
                    331: def test21() {
                    332:    a=Sannfs3("x^3-y^2*z^2+y^2+z^2");
                    333:    /* a=Sannfs3("x^3-y-z");  for debug */
                    334:    b=a[0]; w = ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1];
                    335:    test_if_v_strict(b,w,"x,y,z");
                    336:    Println("Degree shifts of Schreyer resolution ----");
                    337:    Println(SgetShifts(Reparse(a[4,0]),w));
                    338:    return(a);
                    339: }
1.15      takayama  340: def test21b() {
                    341:   local i,j,n,sss, maxR, ttt,ans,p;
                    342:   Println("The dimensions of linear spaces -----");
                    343:   /* sss is the SgetShifts of the Schreyer resol. */
                    344:   sss=
                    345:   [[    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ,
                    346:    [ -1, -1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3 ] ,
                    347:    [ 0, 1, -1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 3, 2, 2, 1, 4, 3, 3, 2, 0, 2, 1, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 0, 1, 2, 2, 2, 2, 3, 2, 2, 3, 1, 3, 3, 3, 3, 4 ] ,
                    348:    [ 1, 0, 2, 3, 2, 3, 1, 1, 1, 2, 1, 2, 2, 2, 0, 3, 1, 3, 2, 3, 4 ] ,
                    349:    [ 1, 1 ]  ] ;
                    350:    maxR = 2; /* Maximal root of the b-function. */
                    351:   n = Length(sss);
                    352:   for (i=0; i<n; i++) {
                    353:     ttt = sss[i];
                    354:     ans = 0;
                    355:     for (j=0; j<Length(ttt); j++) {
                    356:       p = ttt[j] + maxR + 3; /* degree */
                    357:       if (p >= 0) {
                    358:         ans = ans + CancelNumber(p*(p-1)*(p-2)/(3*2*1));
                    359:         /* Add the number of monomials */
                    360:       }
                    361:     }
                    362:     Print(ans); Print(", ");
                    363:   }
                    364:   Println(" ");
                    365: }
1.13      takayama  366: def test22() {
                    367:    a=Sannfs3("x^3+y^3+z^3");
1.14      takayama  368:    b=a[0]; w = ["x",-1,"y",-2,"z",-3,"Dx",1,"Dy",2,"Dz",3];
1.13      takayama  369:    test_if_v_strict(b,w,"x,y,z");
                    370:    return(a);
                    371: }
1.16      takayama  372:
                    373: def FillFromLeft(mat,p,z) {
                    374:   local m,n,i,j,aa;
                    375:   m = Length(mat); n = Length(mat[0]);
                    376:   aa = NewMatrix(m,n+p);
                    377:   for (i=0; i<m; i++) {
                    378:     for (j=0; j<p; j++) {
                    379:       aa[i,j] = z; /* zero */
                    380:     }
                    381:     for (j=0; j<n; j++) {
                    382:       aa[i,j+p] = mat[i,j];
                    383:     }
                    384:   }
                    385:   return(aa);
                    386: }
                    387:
                    388: def FillFromRight(mat,p,z) {
                    389:   local m,n,i,j,aa;
                    390:   m = Length(mat); n = Length(mat[0]);
                    391:   aa = NewMatrix(m,n+p);
                    392:   for (i=0; i<m; i++) {
                    393:     for (j=n; j<n+p; j++) {
                    394:       aa[i,j] = z; /* zero */
                    395:     }
                    396:     for (j=0; j<n; j++) {
                    397:       aa[i,j] = mat[i,j];
                    398:     }
                    399:   }
                    400:   return(aa);
                    401: }
                    402:
                    403: def test23() {
                    404:   w = ["Dx1",1,"Dx2",1,"Dx3",1,"x1",-1,"x2",-1,"x3",-1];
                    405:   Sweyl("x1,x2,x3",[w]);
                    406:   d2 = [[Dx1^2-Dx2*h] , [-Dx1*Dx2+Dx3*h] , [Dx2^2-Dx1*Dx3] ];
                    407:   d1 = [[-Dx2, -Dx1, -h],[Dx3,Dx2,Dx1]];
                    408:   LL = x1*Dx1 + 2*x2*Dx2+3*x3*Dx3;
                    409:   /* It is exact for LL = Dx1 + 2*Dx2+3*Dx3;  */
                    410:   u1 = [[LL+4*h^2,Poly("0")],[Poly("0"),LL+5*h^2]];
                    411:   u2 = [[LL+2*h^2,Poly("0"),Poly("0")],
                    412:         [Poly("0"),LL+3*h^2,Poly("0")],
                    413:         [Poly("0"),Poly("0"),LL+4*h^2]];
                    414:   u3 = [[LL]];
                    415:   Println("Checking if it is a double complex. ");
                    416:   Println("u^2 d^2 - d^2 u^3");
                    417:   sm1_pmat(u2*d2 - d2*u3);
                    418:   Println("u^1 d^1 - d^1 u^2");
                    419:   sm1_pmat(u1*d1 - d1*u2);
                    420:   aa = [
                    421:          Join(u3,d2),
                    422:          Join(FillFromLeft(u2,1,Poly("0"))-FillFromRight(d2,3,Poly("0")),
                    423:               FillFromLeft(d1,1,Poly("0"))),
                    424:          FillFromLeft(u1,3,Poly("0"))-FillFromRight(d1,2,Poly("0"))
                    425:        ];
                    426:   Println([ aa[1]*aa[0], aa[2]*aa[1] ]);
                    427:   r= IsExact_h(aa,[x1,x2,x3]);
                    428:   Println(r);
                    429:   /* sm1_pmat(aa); */
                    430:   return(aa);
                    431: }
                    432:
                    433:
1.17    ! takayama  434: def test24() {
        !           435:   local Res, Eqs, ww,a;
        !           436:   ww = ["x",-1,"y",-1,"Dx",1,"Dy",1];
        !           437:   Println("Example of V-minimal <> minimal ");
        !           438:   Sweyl("x,y", [ww]);
        !           439:   Eqs = [Dx-(x*Dx+y*Dy),
        !           440:          Dy-(x*Dx+y*Dy)];
        !           441:   sm1(" Eqs dehomogenize /Eqs set");
        !           442:   Res = Sminimal(Eqs);
        !           443:   Sweyl("x,y", [ww]);
        !           444:   a = Reparse(Res[0]);
        !           445:   sm1_pmat(a);
        !           446:   Println("Initial of the complex is ");
        !           447:   sm1_pmat( Sinit_w(a,ww) );
        !           448:   return(Res);
        !           449: }
        !           450:
        !           451: def test24b() {
        !           452:   local Res, Eqs, ww ;
        !           453:   ww = ["x",-1,"y",-1,"Dx",1,"Dy",1];
        !           454:   Println("Construction of minimal ");
        !           455:   Sweyl("x,y", [ww]);
        !           456:   Eqs = [Dx-(x*Dx+y*Dy),
        !           457:          Dy-(x*Dx+y*Dy)];
        !           458:   sm1(" Eqs dehomogenize /Eqs set");
        !           459:   Res = Sminimal(Eqs,["Sordinary"]);
        !           460:   sm1_pmat(Res[0]);
        !           461:   return(Res);
        !           462: }
1.16      takayama  463:
                    464:
1.13      takayama  465:
1.3       takayama  466:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>