=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/order.c,v retrieving revision 1.6 retrieving revision 1.16 diff -u -p -r1.6 -r1.16 --- OpenXM/src/kan96xx/Kan/order.c 2002/09/08 10:49:50 1.6 +++ OpenXM/src/kan96xx/Kan/order.c 2018/09/07 00:15:44 1.16 @@ -1,5 +1,6 @@ -/* $OpenXM: OpenXM/src/kan96xx/Kan/order.c,v 1.5 2002/02/09 06:21:02 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/order.c,v 1.15 2005/07/03 11:08:54 ohara Exp $ */ #include +#include #include "datatype.h" #include "stackm.h" #include "extern.h" @@ -173,15 +174,37 @@ void showRing(level,ringp) }else { mtype = "unknown"; } - fprintf(fp,"Multiplication function --%s(%xH).\n", - mtype,(unsigned int) ringp->multiplication); + fprintf(fp,"Multiplication function --%s(%p).\n", + mtype, ringp->multiplication); if (ringp->schreyer) { fprintf(fp,"schreyer=1, gbListTower="); printObjectList((struct object *)(ringp->gbListTower)); fprintf(fp,"\n"); } - + if (ringp->degreeShiftSize) { + fprintf(fp,"degreeShift vector (N=%d,Size=%d)= \n[\n",ringp->degreeShiftN,ringp->degreeShiftSize); + { + int i,j; + for (i=0; idegreeShiftN; i++) { + fprintf(fp," ["); + for (j=0; j< ringp->degreeShiftSize; j++) { + fprintf(fp," %d ",ringp->degreeShift[i*(ringp->degreeShiftSize)+j]); + } + fprintf(fp,"]\n"); + } + } + fprintf(fp,"]\n"); + } + fprintf(fp,"--- weight vectors ---\n"); if (level) printOrder(ringp); + + if (ringp->partialEcart) { + fprintf(fp,"--- partialEcartGlobalVarX ---\n"); + for (i=0; ipartialEcart; i++) { + fprintf(fp," %4s ",TransX[ringp->partialEcartGlobalVarX[i]]); + } + fprintf(fp,"\n"); + } if (ringp->next != (struct ring *)NULL) { fprintf(fp,"\n\n-------- The next ring is .... --------------\n"); @@ -304,7 +327,8 @@ void printOrder(ringp) struct object oGetOrderMatrix(struct ring *ringp) { - struct object rob,ob2; + struct object rob = OINIT; + struct object ob2 = OINIT; int n,i,j,m; int *om; n = ringp->n; @@ -336,6 +360,9 @@ int mmLarger_matrix(ff,gg) int in2; int *from, *to; int omsize; + int dssize; + int dsn; + int *degreeShiftVector; if (ff == POLYNULL ) { if (gg == POLYNULL) return( 2 ); @@ -353,6 +380,10 @@ int mmLarger_matrix(ff,gg) from = rp->from; to = rp->to; omsize = rp->orderMatrixSize; + if (dssize = rp->degreeShiftSize) { + degreeShiftVector = rp->degreeShift; /* Note. 2003.06.26 */ + dsn = rp->degreeShiftN; + } flag = 1; for (i=N-1,k=0; i>=0; i--,k++) { @@ -369,6 +400,15 @@ int mmLarger_matrix(ff,gg) sum = 0; in2 = i*2*N; /* for (k=0; k<2*N; k++) sum += exp[k]*Order[in2+k]; */ for (k=from[i]; ke[N-1].x < dssize) && (f->e[N-1].x >= 0) && + (g->e[N-1].x < dssize) && (g->e[N-1].x >= 0)) { + sum += degreeShiftVector[i*dssize+ (f->e[N-1].x)] + -degreeShiftVector[i*dssize+ (g->e[N-1].x)]; + }else{ + /*warningOrder("Size mismatch in the degree shift vector. It is ignored.");*/ + } + } if (sum > 0) return(1); if (sum < 0) return(0); } @@ -593,7 +633,7 @@ int mmLarger_tower3(POLY f,POLY g,struct object *gbLis int n,fv,gv,t,r,nn; POLY fm; POLY gm; - struct object gb; + struct object gb = OINIT; if (f == POLYNULL) { if (g == POLYNULL) return(2); @@ -647,7 +687,229 @@ int mmLarger_tower3(POLY f,POLY g,struct object *gbLis else if (fv > gv) return(0); /* modifiable */ else if (fv < gv) return(1); /* modifiable */ } - + +static struct object auxPruneZeroRow(struct object ob) { + int i,m,size; + struct object obt = OINIT; + struct object rob = OINIT; + m = getoaSize(ob); + size=0; + for (i=0; in; + m = ringp->orderMatrixSize; + om = ringp->order; + TransX = ringp->x; TransD = ringp->D; + if (m<=0) m = 1; + /*test: (1). getRing /rr set rr (oxRingStructure) dc */ + obMat = newObjectArray(m); + for (i=0; idegreeShiftSize) { + /*test: + [(x) ring_of_differential_operators [[(x)]] weight_vector 0 + [(weightedHomogenization) 1 (degreeShift) [[1 2 1]]] ] define_ring ; + (1). getRing /rr set rr (oxRingStructure) dc message + */ + obShift = newObjectArray(ringp->degreeShiftN); + for (i=0; idegreeShiftN; i++) { + obt = newObjectArray(ringp->degreeShiftSize); + for (j=0; j< ringp->degreeShiftSize; j++) { + putoa(obt,j,KpoUniversalNumber(newUniversalNumber(ringp->degreeShift[i*(ringp->degreeShiftSize)+j]))); + } + putoa(obShift,i,obt); + } + /* printObject(obShift,0,stderr); */ + } + + p = 0; + if (ringp->degreeShiftSize) { + rob = newObjectArray(3); + obt = newObjectArray(2); + putoa(obt,0,KpoString("degreeShift")); + putoa(obt,1,obShift); + putoa(rob,p, obt); p++; + }else { + rob = newObjectArray(2); + } + + obt = newObjectArray(2); + putoa(obt,0,KpoString("v")); + putoa(obt,1,obV); + putoa(rob,p, obt); p++; + + obt = newObjectArray(2); + putoa(obt,0,KpoString("order")); + putoa(obt,1,obMat); + putoa(rob,p, obt); p++; + + return(rob); +} +static int auxEffectiveVar(int idx,int n) { + int x; + if (idx < n) x=1; else x=0; + if (x) { + if ((idx >= 1) && (idx < n-1)) return 1; + else return 0; + }else{ + if ( 1 <= idx-n ) return 1; + else return 0; + } +} +/*test: + [(x,y) ring_of_differential_operators [[(Dx) 1 (Dy) 1]] + weight_vector 0] define_ring + (x). getRing (oxRingStructure) dc :: + */ +static struct object oRingToOXringStructure_short(struct ring *ringp) +{ + struct object rob = OINIT; + struct object ob2 = OINIT; + struct object obMat = OINIT; + struct object obV = OINIT; + struct object obShift = OINIT; + struct object obt = OINIT; + char **TransX; char **TransD; + int n,i,j,m,p,nonzero; + int *om; + n = ringp->n; + m = ringp->orderMatrixSize; + om = ringp->order; + TransX = ringp->x; TransD = ringp->D; + if (m<=0) m = 1; + /*test: (1). getRing /rr set rr (oxRingStructure) dc */ + obMat = newObjectArray(m); + for (i=0; idegreeShiftSize) { + /*test: + [(x) ring_of_differential_operators [[(x)]] weight_vector 0 + [(weightedHomogenization) 1 (degreeShift) [[1 2 1]]] ] define_ring ; + (1). getRing /rr set rr (oxRingStructure) dc message + */ + obShift = newObjectArray(ringp->degreeShiftN); + for (i=0; idegreeShiftN; i++) { + obt = newObjectArray(ringp->degreeShiftSize); + for (j=0; j< ringp->degreeShiftSize; j++) { + putoa(obt,j,KpoUniversalNumber(newUniversalNumber(ringp->degreeShift[i*(ringp->degreeShiftSize)+j]))); + } + putoa(obShift,i,obt); + } + /* printObject(obShift,0,stderr); */ + } + + p = 0; + if (ringp->degreeShiftSize) { + rob = newObjectArray(3); + obt = newObjectArray(2); + putoa(obt,0,KpoString("degreeShift")); + putoa(obt,1,obShift); + putoa(rob,p, obt); p++; + }else { + rob = newObjectArray(2); + } + + obt = newObjectArray(2); + putoa(obt,0,KpoString("v")); + putoa(obt,1,obV); + putoa(rob,p, obt); p++; + + obt = newObjectArray(2); + putoa(obt,0,KpoString("order")); + putoa(obt,1,obMat); + putoa(rob,p, obt); p++; + + return(rob); +} +struct object oRingToOXringStructure(struct ring *ringp) +{ + struct object rob = OINIT; + struct object tob = OINIT; + rob = newObjectArray(2); + tob = oRingToOXringStructure_short(ringp); + putoa(rob,0,tob); + tob = oRingToOXringStructure_long(ringp); + putoa(rob,1,tob); + return(rob); +} + static void warningOrder(s) char *s; {