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

Annotation of OpenXM/src/k097/lib/minimal/cohom.k, Revision 1.1

1.1     ! takayama    1: /* $OpenXM$ */
        !             2:
        !             3:
        !             4: def Boundp(a) {
        !             5:    local b;
        !             6:    sm1("[(parse) [(/) ",a," ( load tag 0 eq
        !             7:                           { /FunctionValue 0 def }
        !             8:                           { /FunctionValue 1 def } ifelse )] cat ] extension");
        !             9: }
        !            10:
        !            11: def load_cohom() {
        !            12:   if (Boundp("cohom.sm1.loaded")) {
        !            13:   }else{
        !            14:     sm1(" [(parse) (k0-cohom.sm1) pushfile ] extension ");
        !            15:   }
        !            16: }
        !            17:
        !            18: load_cohom();
        !            19:
        !            20: def sm1_deRham(a,b) {
        !            21:   local aa,bb;
        !            22:   aa = ToString(a);
        !            23:   if (IsArray(b)) {
        !            24:      bb = Map(b,"ToString");
        !            25:   }else{
        !            26:      bb = ToString(b);
        !            27:   }
        !            28:   sm1("[", aa,bb, " ]  deRham /FunctionValue set ");
        !            29: }
        !            30:
        !            31:
        !            32: def Weyl(v,w,p) {
        !            33:   local a,L;
        !            34:   L=Length(Arglist);
        !            35:   if (L == 1) {
        !            36:     a=RingD(v);
        !            37:   } else if (L == 2) {
        !            38:     a=RingD(v,w);
        !            39:   }else if (L == 3) {
        !            40:     a=RingD(v,w,p);
        !            41:   }else{
        !            42:     Println("Error: argument mismatch");
        !            43:     return(null);
        !            44:   }
        !            45:   sm1(" define_ring_variables ");
        !            46:   return(a);
        !            47: }
        !            48:
        !            49: def sm1_pmat(a) {
        !            50:   sm1(a," pmat ");
        !            51: }
        !            52:
        !            53: Weyl("x,y");
        !            54: /*  See page 8, (2.2).  */
        !            55: cech=[
        !            56:   [ [x*Dx],
        !            57:     [y*Dy]
        !            58:   ],
        !            59:   [[ y*Dy, -x*Dx]]
        !            60: ];
        !            61:
        !            62: def sm1_v_string(V) {
        !            63:   if (IsArray(V)) {
        !            64:     V = Map(V,"ToString");
        !            65:   }else {
        !            66:     V = ToString(V);
        !            67:   }
        !            68:   return(V);
        !            69: }
        !            70:
        !            71: def sm1_syz(A,V,W) {
        !            72:   local L,P;
        !            73:   L=Length(Arglist);
        !            74:   if (L == 1) {
        !            75:     P = [A];
        !            76:   }else if (L==2) {
        !            77:     V = sm1_v_string(V);
        !            78:     P = [A,V];
        !            79:   }else if (L==3) {
        !            80:     P = [A,V,W];
        !            81:   }else {
        !            82:     Println("sm1_syz: Argument mismatch");
        !            83:     return(null);
        !            84:   }
        !            85:   sm1(P," syz /FunctionValue set");
        !            86: }
        !            87: /*
        !            88:   sm1_syz([x*Dx,y*Dy],[x,y]):
        !            89:   We want to syz_h, too.
        !            90:   Step 1: Control by global variable ?  syz ==> syz_generic
        !            91:   Step 2: syz and syz_h
        !            92: */
        !            93:
        !            94: def sm1_resol1(I,V,W) {
        !            95:   local P,L;
        !            96:   L=Length(Arglist);
        !            97:   if (L == 1) {
        !            98:     P = [I];
        !            99:   }else if (L==2) {
        !           100:     V = sm1_v_string(V);
        !           101:     P = [I,V];
        !           102:   }else if (L==3) {
        !           103:     P = [I,V,W];
        !           104:   }else {
        !           105:     Println("sm1_syz: Argument mismatch");
        !           106:     return(null);
        !           107:   }
        !           108:   sm1(P," resol1 /FunctionValue set ");
        !           109: }
        !           110: /*  sm1_resol1([x^2,x*y],[x,y]):  */
        !           111:
        !           112: def sm1_res_solv(A,B,C) {
        !           113:   local P,L;
        !           114:   L=Length(Arglist);
        !           115:   if (L == 2) {
        !           116:     P = [A,B];
        !           117:     sm1(P," res-solv /FunctionValue set");
        !           118:   }else if (L==3) {
        !           119:     C = sm1_v_string(C);
        !           120:     P = [[A,B], C];
        !           121:     sm1(P," res*solv /FunctionValue set ");
        !           122:   }else{
        !           123:     Println("Error: argument mismatch");
        !           124:     return(null);
        !           125:   }
        !           126: }
        !           127: /*
        !           128:  sm1_res_solv(
        !           129:   [[x*Dx + 2, 0],
        !           130:    [Dx+3,    x^3],
        !           131:    [3,      x],
        !           132:    [Dx*(x*Dx + 3) - (x*Dx + 2)*(x*Dx -4), 0]],
        !           133:    [1, 0], [x,y]):
        !           134:
        !           135:  sm1_res_solv([x,1],1,"x"):
        !           136:  sm1_res_solv([x,y],y,"x,y"):
        !           137: */
        !           138:
        !           139: def sm1_res_solv_h(A,B,C) {
        !           140:   local P;
        !           141:   P = [[A,B], C];
        !           142:   sm1(P," res*solv*h /FunctionValue set ");
        !           143: }
        !           144:
        !           145: def Reparse(A) {
        !           146:   if (IsArray(A)) {
        !           147:     return(Map(A,"Reparse"));
        !           148:   }else if (IsPolynomial(A) || IsInteger(A)) {
        !           149:     return(Poly(ToString(A)));
        !           150:   }else{
        !           151:     return(A);
        !           152:   }
        !           153: }
        !           154:
        !           155: def sm1_res_sub2Q(I,V) {
        !           156:   local L,P;
        !           157:   L = Length(Arglist);
        !           158:   if (L == 1) {
        !           159:     P = I;
        !           160:   }else if ( L == 2) {
        !           161:     V = sm1_v_string(V);
        !           162:     if (IsArray(V)) {
        !           163:       sm1(V," from_records /V set ");
        !           164:     }
        !           165:     Weyl(V);
        !           166:     P = Reparse(I);
        !           167:   }
        !           168:   sm1(P," res-sub2Q /FunctionValue set ");
        !           169: }
        !           170:
        !           171: /*
        !           172:    sm1_res_sub2Q([x*Dx,Dy]):
        !           173:    M res-sub2Q =: J,   M \simeq D^p/J
        !           174: */
        !           175:
        !           176: def ex2_9() {
        !           177:   Weyl("x,y,z");
        !           178:   I = [ x*Dx+y*Dy+z*Dz+6,
        !           179:         z^2*Dy-y^2*Dz,
        !           180:         z^2*Dx-x^2*Dz,
        !           181:         y^2*Dx-x^2*Dy,
        !           182:         x^3*Dz+y^3*Dz+z^3*Dz+6*z^2,
        !           183:         x^3*Dy+y^3*Dy+y^2*z*Dz+6*y^2];
        !           184:   a = sm1_resol1(I,"x,y,z");
        !           185:   return(a);
        !           186: }
        !           187:

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