[BACK]Return to demo.k CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / lib / restriction

Diff for /OpenXM/src/k097/lib/restriction/demo.k between version 1.3 and 1.7

version 1.3, 2000/12/27 08:09:27 version 1.7, 2001/01/26 12:24:57
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/k097/lib/restriction/demo.k,v 1.2 2000/12/15 02:44:32 takayama Exp $  */  /* $OpenXM: OpenXM/src/k097/lib/restriction/demo.k,v 1.6 2001/01/05 11:14:29 takayama Exp $  */
   
 load["restriction.k"];;  load["restriction.k"];;
 load("../ox/ox.k");;  load("../ox/ox.k");;
Line 8  def demoSendAsirCommand(a) {
Line 8  def demoSendAsirCommand(a) {
   a.executeString(" def myann(F) { B=ann(eval_str(F)); print(B); return(map(dp_ptod,B,[hoge,x,y,z,s,hh,ee,dx,dy,dz,ds,dhh])); }; ");    a.executeString(" def myann(F) { B=ann(eval_str(F)); print(B); return(map(dp_ptod,B,[hoge,x,y,z,s,hh,ee,dx,dy,dz,ds,dhh])); }; ");
   a.executeString(" def myann0(F) { B=ann0(eval_str(F)); print(B); return(map(dp_ptod,B[1],[hoge,x,y,z,s,hh,ee,dx,dy,dz,ds,dhh])); }; ");    a.executeString(" def myann0(F) { B=ann0(eval_str(F)); print(B); return(map(dp_ptod,B[1],[hoge,x,y,z,s,hh,ee,dx,dy,dz,ds,dhh])); }; ");
   a.executeString(" def mybfct(F) { return(rtostr(bfct(eval_str(F)))); }; ");    a.executeString(" def mybfct(F) { return(rtostr(bfct(eval_str(F)))); }; ");
     a.executeString(" def mygeneric_bfct(F,VV,DD,WW) { print([F,VV,DD,WW]); return(generic_bfct(F,VV,DD,WW));}; ");
 }  }
   
 as = startAsir();  if (Boundp("NoX")) {
     as = Asir.generate(false);
   }else{
     as = Asir.generate();
   }
   
 asssssir = as;  asssssir = as;
 demoSendAsirCommand(as);  demoSendAsirCommand(as);
 RingD("x,y,z,s");  RingD("x,y,z,s");
Line 32  def asirAnnfsXYZ(a,f) {
Line 38  def asirAnnfsXYZ(a,f) {
   return(b);    return(b);
 }  }
   
 def asir_rpc_old(argv_rpc_asir) {  
    sm1(" oxasir.ccc [ ] eq {  
        (Starting ox_asir server.) message  
         ox_asirConnectMethod  
         } {  } ifelse ");  
    sm1(" oxasir.ccc argv_rpc_asir asir /FunctionValue set ");  
 }  
 def asir_define_own_functions() {  
    asir_rpc_old(["igcd",2,3]);  
    sm1(" oxasir.ccc (def mygeneric_bfct(Id,V,DV,W)  {  
                             return( rtostr(generic_bfct(Id,V,DV,W)));  
                       })  oxsubmit ");  
 }  
   
 def asir_generic_bfct(ii,vv,dd,ww) {  def asir_generic_bfct(a,ii,vv,dd,ww) {
    local ans;     local ans;
    ans = asir_rpc_old(["mygeneric_bfct",ii,vv,dd,ww]);     ans = a.rpc_str("mygeneric_bfct",[ii,vv,dd,ww]);
    return(ans);     return(ans);
 }  }
 /* asir_generic_bfct([Dx^2+Dy^2-1,Dx*Dy-4],[x,y],[Dx,Dy],[1,1]): */  /* a=startAsir();
      asir_generic_bfct(a,[Dx^2+Dy^2-1,Dx*Dy-4],[x,y],[Dx,Dy],[1,1]): */
   
   /* usage: misc/tmp/complex-ja.texi */
   def ChangeRing(f) {
     local r;
     r = GetRing(f);
     if (Tag(r) == 14) {
       SetRing(r);
       return(true);
     }else{
       return(false);
     }
   }
   
 def asir_BfRoots2(G) {  def asir_BfRoots2(G) {
    local bb,ans,ss;     local bb,ans,ss;
    sm1(" G flatten {dehomogenize} map /G set ");     sm1(" G flatten {dehomogenize} map /G set ");
    asir_define_own_functions();     ChangeRing(G);
    ss = asir_generic_bfct(G,[x,y],[Dx,Dy],[1,1]);     ss = asir_generic_bfct(asssssir,G,[x,y],[Dx,Dy],[1,1]);
    bb = [ss];     bb = [ss];
    sm1(" bb 0 get findIntegralRoots { (universalNumber) dc } map /ans set ");     sm1(" bb 0 get findIntegralRoots { (universalNumber) dc } map /ans set ");
    return([ans, bb]);     return([ans, bb]);
Line 65  def asir_BfRoots2(G) {
Line 71  def asir_BfRoots2(G) {
 def asir_BfRoots3(G) {  def asir_BfRoots3(G) {
    local bb,ans,ss;     local bb,ans,ss;
    sm1(" G flatten {dehomogenize} map /G set ");     sm1(" G flatten {dehomogenize} map /G set ");
    asir_define_own_functions();     ChangeRing(G);
    ss = asir_generic_bfct(G,[x,y,z],[Dx,Dy,Dz],[1,1,1]);     ss = asir_generic_bfct(asssssir,G,[x,y,z],[Dx,Dy,Dz],[1,1,1]);
    bb = [ss];     bb = [ss];
    sm1(" bb 0 get findIntegralRoots { (universalNumber) dc } map /ans set ");     sm1(" bb 0 get findIntegralRoots { (universalNumber) dc } map /ans set ");
    return([ans, bb]);     return([ans, bb]);
Line 93  def asirAnnXYZ(a,f) {
Line 99  def asirAnnXYZ(a,f) {
   
 def nonquasi2(p,q) {  def nonquasi2(p,q) {
   local s,ans,f;    local s,ans,f;
   
     sm1("0 set_timer "); sm1(" oxNoX ");
     asssssir.OnTimer();
   
   f = x^p+y^q+x*y^(q-1);    f = x^p+y^q+x*y^(q-1);
   Print("f=");Println(f);    Print("f=");Println(f);
   s = ToString(f);    s = ToString(f);
Line 113  def nonquasi2(p,q) {
Line 123  def nonquasi2(p,q) {
   Print("Roots and b-function are "); Println(R);    Print("Roots and b-function are "); Println(R);
   R0 = R[0];    R0 = R[0];
   Ans=Srestall(Res0, ["x", "y"],  ["x", "y"], R0[Length(R0)-1]);    Ans=Srestall(Res0, ["x", "y"],  ["x", "y"], R0[Length(R0)-1]);
   
     Println("Timing data: sm1 "); sm1(" 1 set_timer ");
     Print("     ox_asir [CPU,GC]:  ");Println(asssssir.OffTimer());
   
   Print("Answer is "); Println(Ans[0]);    Print("Answer is "); Println(Ans[0]);
   return(Ans);    return(Ans);
 }  }
Line 128  def asirAnn0XYZ(a,f) {
Line 142  def asirAnn0XYZ(a,f) {
   
 def DeRham2WithAsir(f) {  def DeRham2WithAsir(f) {
   local s;    local s;
   
     sm1("0 set_timer "); sm1(" oxNoX ");
     asssssir.OnTimer();
   
   s = ToString(f);    s = ToString(f);
   II = asirAnn0XYZ(asssssir,f);    II = asirAnn0XYZ(asssssir,f);
   Print("Step 1: Annhilating ideal (II)"); Println(II);    Print("Step 1: Annhilating ideal (II)"); Println(II);
Line 143  def DeRham2WithAsir(f) {
Line 161  def DeRham2WithAsir(f) {
   Print("Roots and b-function are "); Println(R);    Print("Roots and b-function are "); Println(R);
   R0 = R[0];    R0 = R[0];
   Ans=Srestall(Res0, ["x", "y"],  ["x", "y"],R0[Length(R0)-1] );    Ans=Srestall(Res0, ["x", "y"],  ["x", "y"],R0[Length(R0)-1] );
   
     Println("Timing data: sm1 "); sm1(" 1 set_timer ");
     Print("     ox_asir [CPU,GC]:  ");Println(asssssir.OffTimer());
   
   Print("Answer is ");Println(Ans[0]);    Print("Answer is ");Println(Ans[0]);
   return(Ans);    return(Ans);
 }  }
 def DeRham3WithAsir(f) {  def DeRham3WithAsir(f) {
   local s;    local s;
   
     sm1("0 set_timer "); sm1(" oxNoX ");
     asssssir.OnTimer();
   
   s = ToString(f);    s = ToString(f);
   II = asirAnn0XYZ(asssssir,f);    II = asirAnn0XYZ(asssssir,f);
   Print("Step 1: Annhilating ideal (II)"); Println(II);    Print("Step 1: Annhilating ideal (II)"); Println(II);
Line 157  def DeRham3WithAsir(f) {
Line 183  def DeRham3WithAsir(f) {
   Res = Sminimal(pp);    Res = Sminimal(pp);
   Res0 = Res[0];    Res0 = Res[0];
   Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);    Print("Step2: (-1,1)-minimal resolution (Res0) "); sm1_pmat(Res0);
 /*  R = BfRoots1(Res0[0],"x,y,z"); */    /* R = BfRoots1(Res0[0],"x,y,z");  */
   R = asir_BfRoots3(Res0[0]);    R = asir_BfRoots3(Res0[0]);
   Println("Step3: computing the cohomology of the truncated complex.");    Println("Step3: computing the cohomology of the truncated complex.");
   Print("Roots and b-function are "); Println(R);    Print("Roots and b-function are "); Println(R);
   R0 = R[0];    R0 = R[0];
   Ans=Srestall(Res0, ["x", "y", "z"],  ["x", "y", "z"],R0[Length(R0)-1] );    Ans=Srestall(Res0, ["x", "y", "z"],  ["x", "y", "z"],R0[Length(R0)-1] );
   
     Println("Timing data: sm1 "); sm1(" 1 set_timer ");
     Print("     ox_asir [CPU,GC]:  ");Println(asssssir.OffTimer());
   
   Print("Answer is ");Println(Ans[0]);    Print("Answer is ");Println(Ans[0]);
   return(Ans);    return(Ans);
 }  }
   
   /*  test data
   
      NoX=true;
      nonquasi2(4,5);
      nonquasi2(4,6);
      nonquasi2(4,7);
      nonquasi2(4,8);
      nonquasi2(4,9);
      nonquasi2(4,10);
   
      nonquasi2(5,6);
      nonquasi2(6,7);
      nonquasi2(7,8);
      nonquasi2(8,9);
      nonquasi2(9,10);
   */
   
      P2 = [
        "x^3-y^2",
        "y^2-x^3-x-1",
        "y^2-x^5-x-1",
        "y^2-x^7-x-1",
        "y^2-x^9-x-1",
        "y^2-x^11-x-1"
      ];
   
      P3 = [
        "x^3-y^2*z^2",
        "x^2*z+y^3+y^2*z+z^3",
        "y*z^2+x^3+x^2*y^2+y^6",
        "x*z^2+x^2*y+x*y^3+y^5"
      ];
   
   
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.7

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