[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.3

1.3     ! takayama    1: /* $OpenXM: OpenXM/src/k097/lib/minimal/minimal-test.k,v 1.2 2000/06/08 08:37:53 takayama Exp $ */
1.1       takayama    2: load["minimal.k"];
                      3: def test5() {
                      4:   local a,b,c,cc,v;
                      5:   a = Sannfs3_laScala2("x^3-y^2*z^2");
                      6:   b = a[0];
                      7:   v = [x,y,z];
                      8:   c = Skernel(b[0],v);
                      9:   c = c[0];
                     10:   sm1_pmat([c,b[1],v]);
                     11:   Println("-----------------------------------");
                     12:   cc = sm1_res_div(c,b[1],v);
                     13:   sm1_pmat(sm1_gb(cc,v));
                     14:   c = Skernel(b[1],v);
                     15:   c = c[0];
                     16:   cc = sm1_res_div(c,b[2],v);
                     17:   sm1_pmat(sm1_gb(cc,v));
                     18:   return(a);
                     19: }
                     20: def test6() {
                     21:   local a,b,c,cc,v;
                     22:   a = Sannfs3("x^3-y^2*z^2");
                     23:   b = a[0];
                     24:   v = [x,y,z];
                     25:   c = Skernel(b[0],v);
                     26:   c = c[0];
                     27:   sm1_pmat([c,b[1],v]);
                     28:   Println("-------ker = im for minimal ?---------------------");
                     29:   cc = sm1_res_div(c,b[1],v);
                     30:   sm1_pmat(sm1_gb(cc,v));
                     31:   c = Skernel(b[1],v);
                     32:   c = c[0];
                     33:   cc = sm1_res_div(c,b[2],v);
                     34:   sm1_pmat(sm1_gb(cc,v));
                     35:   Println("------ ker=im for Schreyer ?------------------");
                     36:   b = a[3];
                     37:   c = Skernel(b[0],v);
                     38:   c = c[0];
                     39:   sm1_pmat([c,b[1],v]);
                     40:   cc = sm1_res_div(c,b[1],v);
                     41:   sm1_pmat(sm1_gb(cc,v));
                     42:   c = Skernel(b[1],v);
                     43:   c = c[0];
                     44:   cc = sm1_res_div(c,b[2],v);
                     45:   sm1_pmat(sm1_gb(cc,v));
                     46:   return(a);
                     47: }
                     48:
                     49: /* May 23, Tue */
                     50: def test7() {
                     51:   local a,b,c,cc,v;
                     52:   a = Sannfs3_laScala2("x^3-y^2*z^2");
                     53:   b = a[0];
                     54:   v = [x,y,z];
                     55:   c = Skernel(b[0],v);
                     56:   c = c[0];
                     57:   sm1_pmat([c,b[1],v]);
                     58:   Println("-------ker = im for minimal ?---------------------");
                     59:   cc = sm1_res_div(c,b[1],v);
                     60:   sm1_pmat(sm1_gb(cc,v));
                     61:   c = Skernel(b[1],v);
                     62:   c = c[0];
                     63:   cc = sm1_res_div(c,b[2],v);
                     64:   sm1_pmat(sm1_gb(cc,v));
                     65:   Println("------ ker=im for Schreyer ?------------------");
                     66:   b = a[3];
                     67:   c = Skernel(b[0],v);
                     68:   c = c[0];
                     69:   sm1_pmat([c,b[1],v]);
                     70:   cc = sm1_res_div(c,b[1],v);
                     71:   sm1_pmat(sm1_gb(cc,v));
                     72:   c = Skernel(b[1],v);
                     73:   c = c[0];
                     74:   cc = sm1_res_div(c,b[2],v);
                     75:   sm1_pmat(sm1_gb(cc,v));
                     76:   return(a);
                     77: }
                     78:
                     79: def sm1_resol1(p) {
                     80:   sm1(" p resol1 /FunctionValue set ");
                     81: }
                     82:
                     83:
                     84: def test8() {
                     85:   local p,pp,ans,b,c,cc,ww,ww2;
                     86:   f = "x^3-y^2*z^2";
                     87:   p = Sannfs(f,"x,y,z");
                     88:   ww = [["x",1,"y",1,"z",1,"Dx",1,"Dy",1,"Dz",1,"h",1],
                     89:                  ["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                     90:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                     91:   sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set ");
                     92:   Sweyl("x,y,z",ww);
                     93:   pp = Map(p,"Spoly");
                     94:   /* return(pp); */
                     95:   /* pp =
                     96:      [y*Dy-z*Dz , -2*x*Dx-3*y*Dy+1 , 2*x*Dy*Dz^2-3*y*Dx^2 ,
                     97:       2*x*Dy^2*Dz-3*z*Dx^2 , 2*x*z*Dz^3-3*y^2*Dx^2+4*x*Dz^2 ]
                     98:   */
                     99:   ans = sm1_resol1([pp,"x,y,z",ww]);
                    100:   /* Schreyer is in ans. */
                    101:
                    102:   v = [x,y,z];
                    103:   b = ans;
                    104:   Println("------ ker=im for Schreyer ?------------------");
                    105:   c = Skernel(b[0],v);
                    106:   c = c[0];
                    107:   sm1_pmat([c,b[1],v]);
                    108:   cc = sm1_res_div(c,b[1],v);
                    109:   sm1_pmat(sm1_gb(cc,v));
                    110:   c = Skernel(b[1],v);
                    111:   c = c[0];
                    112:   cc = sm1_res_div(c,b[2],v);
                    113:   sm1_pmat(sm1_gb(cc,v));
                    114:   return(ans);
                    115: }
                    116: /*
                    117:    a = test8();
                    118:    SisComplex(a):
                    119: */
                    120:
                    121: def test8a() {
                    122:   local p,pp,ans,b,c,cc,ww, ans_all;
                    123:   f = "x^3-y^2*z^2";
                    124:   p = Sannfs(f,"x,y,z");
                    125:   sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set ");
                    126:   ww = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                    127:   /* Removed "x",1, ... ===> It causes an error. I do not know the reason.*/
                    128:   Sweyl("x,y,z",ww);
                    129:   pp = Map(p,"Spoly");
                    130:   /* return(pp); */
                    131:   /* pp =
                    132:      [y*Dy-z*Dz , -2*x*Dx-3*y*Dy+1 , 2*x*Dy*Dz^2-3*y*Dx^2 ,
                    133:       2*x*Dy^2*Dz-3*z*Dx^2 , 2*x*z*Dz^3-3*y^2*Dx^2+4*x*Dz^2 ]
                    134:   */
                    135:   ans_all = Sschreyer(pp);
                    136:   ans = ans_all[0];
                    137:   /* ans = sm1_resol1([pp,"x,y,z",ww]); */
                    138:   /* Schreyer is in ans. */
                    139:
                    140:   v = [x,y,z];
                    141:   b = ans;
1.3     ! takayama  142:   Println("------ ker=im for Schreyer ?----- wrong method!!!-----------");
1.1       takayama  143:   c = Skernel(b[0],v);
                    144:   c = c[0];
                    145:   sm1_pmat([c,b[1],v]);
                    146:   cc = sm1_res_div(c,b[1],v);
                    147:   sm1_pmat(sm1_gb(cc,v));
                    148:   c = Skernel(b[1],v);
                    149:   c = c[0];
                    150:   cc = sm1_res_div(c,b[2],v);
                    151:   sm1_pmat(sm1_gb(cc,v));
                    152:   return(ans);
                    153: }
                    154:
                    155: /* Comparing two constructions */
                    156: def test9() {
                    157:   local p,pp,ans,b,c,cc,ww,ww2,ans_all,ans2;
                    158:   f = "x^3-y^2*z^2";
                    159:   p = Sannfs(f,"x,y,z");
                    160:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                    161:   sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set ");
                    162:   Sweyl("x,y,z",ww2);
                    163:   pp = Map(p,"Spoly");
                    164:   ans = sm1_resol1([pp,"x,y,z",ww2]);
                    165:
                    166:   f = "x^3-y^2*z^2";
                    167:   p = Sannfs(f,"x,y,z");
                    168:   sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set ");
                    169:   ww = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                    170:   Sweyl("x,y,z",ww);
                    171:   pp = Map(p,"Spoly");
                    172:   ans_all = Sschreyer(pp);
                    173:   ans2 = ans_all[0];
                    174:
                    175:   return([ans,ans2]);
1.2       takayama  176:
                    177: }
                    178:
1.3     ! takayama  179: /* Check if the complex by Sschreyer() is exact or not in our example? */
1.2       takayama  180: def test10() {
                    181:   local p,pp,ans,b,c,cc,ww,ww2,ans_all,ans2, r;
                    182:   f = "x^3-y^2*z^2";
                    183:   p = Sannfs(f,"x,y,z");
                    184:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                    185:   sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set ");
                    186:   Sweyl("x,y,z",ww2);
                    187:   pp = Map(p,"Spoly");
                    188:   ans = sm1_resol1([pp,"x,y,z",ww2]);
                    189:
                    190:   f = "x^3-y^2*z^2";
                    191:   p = Sannfs(f,"x,y,z");
                    192:   sm1(" p 0 get { [(x) (y) (z) (Dx) (Dy) (Dz)] laplace0 } map /p set ");
                    193:   ww = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
                    194:   Sweyl("x,y,z",ww);
                    195:   pp = Map(p,"Spoly");
                    196:   ans_all = Sschreyer(pp);  /* Schreyer by LaScala-Stillman */
                    197:   ans2 = ans_all[0];
                    198:
1.3     ! takayama  199:   sm1(" /gb.verbose 1 def ");
        !           200:
        !           201:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
        !           202:   Sweyl("x,y,z",ww2);
        !           203:   ans2 = ReParse(ans2);
        !           204:   r= IsExact_h(ans2,[x,y,z]);
1.2       takayama  205:   Print(r);
                    206:
                    207:   return([r,[ans,ans2]]);
1.1       takayama  208:
                    209: }
1.3     ! takayama  210:
        !           211: def test11() {
        !           212:   local  a;
        !           213:   a = test_ann3("x^3-y^2*z^2");
        !           214:   return(a);
        !           215: }
        !           216: /* f should be a string. */
        !           217: def test_ann3(f) {
        !           218:   local a,v,ww2,ans2;
        !           219:   a = Sannfs3_laScala2(f);
        !           220:   ans2 = a[0];
        !           221:   v = [x,y,z];
        !           222:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
        !           223:   Sweyl("x,y,z",ww2);
        !           224:   ans2 = ReParse(ans2);
        !           225:   r= IsExact_h(ans2,[x,y,z]);
        !           226:   Println(r);
        !           227:   return([r,ans2]);
        !           228: }
        !           229: def test11a() {
        !           230:   local a,v,ww2,ans2;
        !           231: /* constructed by test11.
        !           232:   ans2 =
        !           233:        [[[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]] ,
        !           234:         [[3*Dx^2*h , 0 , Dy , -Dz] ,
        !           235:          [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] ,
        !           236:          [0 , 2*x*Dy^2*Dz-3*z*Dx^2*h , 0 , 2*x*Dx+3*z*Dz] ,
        !           237:          [2*x*Dx+3*z*Dz-h^2 , y*Dy-z*Dz , 0 , 0] ,
        !           238:          [0 , 0 , 0 , 0] ,
        !           239:          [2*x*Dy*Dz , 0 , z , -y] ,
        !           240:          [0 , 0 , 0 , 0] ,
        !           241:          [0 , 0 , 0 , 0] ,
        !           242:          [0 , 0 , 0 , 0]] ,
        !           243:   [[0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
        !           244:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
        !           245:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
        !           246:    [-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] ,
        !           247:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
        !           248:    [3*y*z , z , y , -2*x*Dy*Dz , -3*z*Dy , 2*x*Dx , 2*x*z , -2*x*y , 0] ,
        !           249:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
        !           250:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
        !           251:    [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0]] ,
        !           252:    [[0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
        !           253:     [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0] ,
        !           254:     [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0]]]
        !           255: */
        !           256:   ans2 =
        !           257:        [[[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]] ,
        !           258:         [[3*Dx^2*h , 0 , Dy , -Dz] ,
        !           259:          [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] ,
        !           260:          [0 , 2*x*Dy^2*Dz-3*z*Dx^2*h , 0 , 2*x*Dx+3*z*Dz] ,
        !           261:          [2*x*Dx+3*z*Dz-h^2 , y*Dy-z*Dz , 0 , 0] ,
        !           262:          [2*x*Dy*Dz , 0 , z , -y]],
        !           263:   [[-2*x*Dx-3*y*Dy-3*z*Dz-6*h^2 , -Dy , -Dz , 3*Dx^2*h , 3*Dy*Dz ] ,
        !           264:    [3*y*z , z , y , -2*x*Dy*Dz , 2*x*Dx]]];
        !           265:
        !           266:   sm1_pmat( ans2[1]*ans2[0] );
        !           267:   sm1_pmat( ans2[2]*ans2[1] );
        !           268:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
        !           269:   Sweyl("x,y,z",ww2);
        !           270:   ans2 = ReParse(ans2);
        !           271:   r= IsExact_h(ans2,[x,y,z]);
        !           272:   Println(r);
        !           273:   return([r,ans2]);
        !           274: }
        !           275:
        !           276: def test12() {
        !           277:   local a,v,ww2,ans2;
        !           278:   a = Sannfs3("x^3-y^2*z^2");
        !           279:   ans2 = a[0];
        !           280:   v = [x,y,z];
        !           281:   ww2 = [["x",-1,"y",-1,"z",-1,"Dx",1,"Dy",1,"Dz",1]];
        !           282:   Sweyl("x,y,z",ww2);
        !           283:   ans2 = ReParse(ans2);
        !           284:   r= IsExact_h(ans2,[x,y,z]);
        !           285:   Println(r);
        !           286:   Println("It may stop by non-exact statement. The code of Sminimal_v (non-LaScala-Stillman contains bugs.");
        !           287:   return([r,ans2]);
        !           288: }
        !           289:

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