=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/kanExport0.c,v retrieving revision 1.28 retrieving revision 1.35 diff -u -p -r1.28 -r1.35 --- OpenXM/src/kan96xx/Kan/kanExport0.c 2004/08/31 04:45:42 1.28 +++ OpenXM/src/kan96xx/Kan/kanExport0.c 2004/09/15 06:40:26 1.35 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport0.c,v 1.27 2004/08/28 07:28:54 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport0.c,v 1.34 2004/09/13 11:24:11 takayama Exp $ */ #include #include "datatype.h" #include "stackm.h" @@ -687,8 +687,16 @@ KooEqualQ(obj1,obj2) { struct object ob; int i; + extern int Verbose; if (obj1.tag != obj2.tag) { warningKan("KooEqualQ(ob1,ob2): the datatypes of ob1 and ob2 are not same. Returns false (0).\n"); + if (Verbose & 0x10) { + fprintf(stderr,"obj1="); + printObject(obj1,0,stderr); + fprintf(stderr,", obj2="); + printObject(obj2,0,stderr); + fprintf(stderr,"\n"); fflush(stderr); + } return(0); } switch(obj1.tag) { @@ -919,6 +927,10 @@ struct object KdataConversion(obj,key) return(rob); }else if (strcmp(key,"poly") == 0) { rob = KpoPOLY(ZERO); + return rob; + }else if (strcmp(key,"array") == 0) { + rob = newObjectArray(0); + return rob; }else{ warningKan("Sorry. The data conversion from null to this data type has not supported yet.\n"); } @@ -1015,7 +1027,7 @@ struct object KdataConversion(obj,key) if (strcmp(key,"array") == 0) { return(rob); }else if (strcmp(key,"list") == 0) { - rob = *( arrayToList(obj) ); + rob = KarrayToList(obj); return(rob); }else if (strcmp(key,"arrayOfPOLY")==0) { rob = KpoArrayOfPOLY(arrayToArrayOfPOLY(obj)); @@ -1108,7 +1120,7 @@ struct object KdataConversion(obj,key) break; case Slist: if (strcmp(key,"array") == 0) { - rob = listToArray(&obj); + rob = KlistToArray(obj); return(rob); } break; @@ -1212,8 +1224,8 @@ struct object KdataConversion(obj,key) return(NullObject); } -/* cf. macro to_int */ -struct object Kto_int(struct object ob) { +/* cf. macro to_int32 */ +struct object Kto_int32(struct object ob) { int n,i; struct object otmp; struct object rob; @@ -1222,7 +1234,7 @@ struct object Kto_int(struct object ob) { n = getoaSize(ob); rob = newObjectArray(n); for (i=0; idegreeShiftSize = 0; newRingp->degreeShiftN = 0; newRingp->degreeShift = NULL; + newRingp->partialEcart = 0; + newRingp->partialEcartGlobalVarX = NULL; if (ob5.tag != Sarray || (getoaSize(ob5) % 2) != 0) { errorKan1("%s\n","[(keyword) value (keyword) value ....] should be given."); @@ -1722,6 +1736,36 @@ int KsetUpRing(ob1,ob2,ob3,ob4,ob5) } } } + } else if (strcmp(KopString(getoa(ob5,i)),"partialEcartGlobalVarX") == 0) { + if (getoa(ob5,i+1).tag != Sarray) { + errorKan1("%s\n","An array of array should be given. (partialEcart)"); + } + { + struct object odv; + struct object ovv; + int k,j,nn; + char *vname; + odv=getoa(ob5,i+1); + nn = getoaSize(odv); + newRingp->partialEcart = nn; + newRingp->partialEcartGlobalVarX = (int *) sGC_malloc(sizeof(int)*nn+1); + if (newRingp->partialEcartGlobalVarX == NULL) errorKan1("%s\n","No more memory."); + for (j=0; jpartialEcartGlobalVarX)[j] = -1; + for (j=0; jpartialEcartGlobalVarX)[j] = k; break; + }else{ + if (k == n-1) errorKan1("%s\n","partialEcartGlobalVarX: no such variable."); + } + } + } + } + switch_function("grade","module1v"); /* Warning: grading is changed to module1v!! */ } else { @@ -2946,8 +2990,85 @@ struct object KdefaultPolyRing(struct object ob) { } +struct object Krest(struct object ob) { + struct object rob; + struct object *op; + int n,i; + if (ob.tag == Sarray) { + n = getoaSize(ob); + if (n == 0) return ob; + rob = newObjectArray(n-1); + for (i=1; i