version 1.7, 2001/05/04 01:06:23 |
version 1.12, 2003/06/26 13:00:10 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport0.c,v 1.6 2001/04/12 06:48:25 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport0.c,v 1.11 2003/06/26 08:14:46 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "stackm.h" |
#include "stackm.h" |
Line 1537 int KsetUpRing(ob1,ob2,ob3,ob4,ob5) |
|
Line 1537 int KsetUpRing(ob1,ob2,ob3,ob4,ob5) |
|
newRingp->schreyer = 0; |
newRingp->schreyer = 0; |
newRingp->gbListTower = NULL; |
newRingp->gbListTower = NULL; |
newRingp->outputOrder = outputVars; |
newRingp->outputOrder = outputVars; |
|
newRingp->weightedHomogenization = 0; |
|
newRingp->degreeShiftSize = 0; |
|
newRingp->degreeShiftN = 0; |
|
newRingp->degreeShift = NULL; |
|
|
if (ob5.tag != Sarray || (getoaSize(ob5) % 2) != 0) { |
if (ob5.tag != Sarray || (getoaSize(ob5) % 2) != 0) { |
errorKan1("%s\n","[(keyword) value (keyword) value ....] should be given."); |
errorKan1("%s\n","[(keyword) value (keyword) value ....] should be given."); |
Line 1583 int KsetUpRing(ob1,ob2,ob3,ob4,ob5) |
|
Line 1587 int KsetUpRing(ob1,ob2,ob3,ob4,ob5) |
|
errorKan1("%s\n","A name should be given. (ringName)"); |
errorKan1("%s\n","A name should be given. (ringName)"); |
} |
} |
ringName = KopString(getoa(ob5,i+1)); |
ringName = KopString(getoa(ob5,i+1)); |
|
} else if (strcmp(KopString(getoa(ob5,i)),"weightedHomogenization") == 0) { |
|
if (getoa(ob5,i+1).tag != Sinteger) { |
|
errorKan1("%s\n","A integer should be given. (weightedHomogenization)"); |
|
} |
|
newRingp->weightedHomogenization = KopInteger(getoa(ob5,i+1)); |
|
} else if (strcmp(KopString(getoa(ob5,i)),"degreeShift") == 0) { |
|
if (getoa(ob5,i+1).tag != Sarray) { |
|
errorKan1("%s\n","An array of array should be given. (degreeShift)"); |
|
} |
|
{ |
|
struct object ods; |
|
struct object ods2; |
|
int dssize,k,j,nn; |
|
ods=getoa(ob5,i+1); |
|
if ((getoaSize(ods) < 1) || (getoa(ods,0).tag != Sarray)) { |
|
errorKan1("%s\n", "An array of array should be given. (degreeShift)"); |
|
} |
|
nn = getoaSize(ods); |
|
dssize = getoaSize(getoa(ods,0)); |
|
newRingp->degreeShiftSize = dssize; |
|
newRingp->degreeShiftN = nn; |
|
newRingp->degreeShift = (int *) sGC_malloc(sizeof(int)*(dssize*nn+1)); |
|
if (newRingp->degreeShift == NULL) errorKan1("%s\n","No more memory."); |
|
for (j=0; j<nn; j++) { |
|
ods2 = getoa(ods,j); |
|
for (k=0; k<dssize; k++) { |
|
if (getoa(ods2,k).tag == SuniversalNumber) { |
|
(newRingp->degreeShift)[j*dssize+k] = coeffToInt(getoa(ods2,k).lc.universalNumber); |
|
}else{ |
|
(newRingp->degreeShift)[j*dssize+k] = KopInteger(getoa(ods2,k)); |
|
} |
|
} |
|
} |
|
} |
} else { |
} else { |
errorKan1("%s\n","Unknown keyword to set_up_ring@"); |
errorKan1("%s\n","Unknown keyword to set_up_ring@"); |
} |
} |
Line 2675 errorKan1(str,message) |
|
Line 2713 errorKan1(str,message) |
|
extern int GotoP; |
extern int GotoP; |
extern int ErrorMessageMode; |
extern int ErrorMessageMode; |
char tmpc[1024]; |
char tmpc[1024]; |
|
cancelAlarm(); |
if (ErrorMessageMode == 1 || ErrorMessageMode == 2) { |
if (ErrorMessageMode == 1 || ErrorMessageMode == 2) { |
sprintf(tmpc,"\nERROR(kanExport[0|1].c): "); |
sprintf(tmpc,"\nERROR(kanExport[0|1].c): "); |
if (strlen(message) < 900) { |
if (strlen(message) < 900) { |
Line 2694 errorKan1(str,message) |
|
Line 2733 errorKan1(str,message) |
|
} |
} |
stdOperandStack(); contextControl(CCRESTORE); |
stdOperandStack(); contextControl(CCRESTORE); |
/* fprintf(stderr,"Now. Long jump!\n"); */ |
/* fprintf(stderr,"Now. Long jump!\n"); */ |
|
#if defined(__CYGWIN__) |
|
siglongjmp(EnvOfStackMachine,1); |
|
#else |
longjmp(EnvOfStackMachine,1); |
longjmp(EnvOfStackMachine,1); |
|
#endif |
} |
} |
|
|
warningKan(str) |
warningKan(str) |