version 1.3, 2003/07/10 08:20:04 |
version 1.6, 2003/08/21 12:28:57 |
|
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport1.c,v 1.5 2003/07/17 07:33:03 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "stackm.h" |
#include "stackm.h" |
|
|
static int Message = 1; |
static int Message = 1; |
extern int KanGBmessage; |
extern int KanGBmessage; |
|
|
|
struct object DegreeShifto; |
|
int DegreeShifto_size = 0; |
|
int *DegreeShifto_vec = NULL; |
|
|
/** :kan, :ring */ |
/** :kan, :ring */ |
struct object Kreduction(f,set) |
struct object Kreduction(f,set) |
struct object f; |
struct object f; |
Line 38 struct object Kreduction(f,set) |
|
Line 43 struct object Kreduction(f,set) |
|
}else{ |
}else{ |
r = (*reduction)(f.lc.poly,grG,1,&syz); |
r = (*reduction)(f.lc.poly,grG,1,&syz); |
} |
} |
|
/* outputGradedPolySet(grG,0); */ |
if (flag) { |
if (flag) { |
rob = newObjectArray(3); |
rob = newObjectArray(3); |
putoa(rob,0,KpoPOLY(r)); |
putoa(rob,0,KpoPOLY(r)); |
Line 495 struct object syzPolyToArray(size,f,grG) |
|
Line 501 struct object syzPolyToArray(size,f,grG) |
|
|
|
while (f != POLYNULL) { |
while (f != POLYNULL) { |
g0 = srGrade(f); |
g0 = srGrade(f); |
i0 = srIndex(f); |
i0 = srIndex(f); |
serial = grG->polys[g0]->serial[i0]; |
serial = grG->polys[g0]->serial[i0]; |
if (serial < 0) { |
if (serial < 0) { |
errorKan1("%s\n","syzPolyToArray(): invalid serial[i] of grG."); |
errorKan1("%s\n","syzPolyToArray(): invalid serial[i] of grG."); |
Line 683 struct object homogenizeObject(ob,gradep) |
|
Line 689 struct object homogenizeObject(ob,gradep) |
|
rob = newObjectArray(size); |
rob = newObjectArray(size); |
flag = 0; |
flag = 0; |
ob1 = getoa(ob,0); |
ob1 = getoa(ob,0); |
if (ob1.tag == Sdollar) return(homogenizeObject_go(ob,gradep)); |
if (ob1.tag == Sdollar) return(homogenizeObject_go(ob,gradep)); |
ob1 = homogenizeObject(ob1,&gr); |
ob1 = homogenizeObject(ob1,&gr); |
maxg = gr; |
maxg = gr; |
getoa(rob,0) = ob1; |
getoa(rob,0) = ob1; |
Line 745 struct object homogenizeObject_vec(ob,gradep) |
|
Line 751 struct object homogenizeObject_vec(ob,gradep) |
|
if (size == 0) { |
if (size == 0) { |
errorKan1("%s\n","homogenizeObject_vec() is called for the empty array."); |
errorKan1("%s\n","homogenizeObject_vec() is called for the empty array."); |
} |
} |
if (getoa(ob,0).tag == Sdollar) return(homogenizeObject_go(ob,gradep)); |
if (getoa(ob,0).tag == Sdollar) return(homogenizeObject_go(ob,gradep)); |
rob = newObjectArray(size); |
rob = newObjectArray(size); |
for (i=0; i<size; i++) { |
for (i=0; i<size; i++) { |
ob1 = getoa(ob,i); |
ob1 = getoa(ob,i); |
Line 785 struct object homogenizeObject_go(struct object ob,int |
|
Line 791 struct object homogenizeObject_go(struct object ob,int |
|
errorKan1("%s\n","homogenizeObject_go(): the first argument must be a string."); |
errorKan1("%s\n","homogenizeObject_go(): the first argument must be a string."); |
} |
} |
if (strcmp(KopString(ob0),"degreeShift") == 0) { |
if (strcmp(KopString(ob0),"degreeShift") == 0) { |
if (size != 3) |
if (size < 2) |
errorKan1("%s\n","homogenizeObject_go(): [(degreeShift) shift-vector obj]"); |
errorKan1("%s\n","homogenizeObject_go(): [(degreeShift) shift-vector obj] or [(degreeShift) shift-vector] or [(degreeShift) (value)] homogenize"); |
ob1 = getoa(ob,1); ob2 = getoa(ob,2); |
ob1 = getoa(ob,1); |
dssize = getoaSize(ob1); |
if (ob1.tag != Sarray) { |
ds = (int *)sGC_malloc(sizeof(int)*(dssize>0?dssize:1)); |
if (DegreeShifto_size != 0) { |
for (i=0; i<dssize; i++) { |
return DegreeShifto; |
ds[i] = objToInteger(getoa(ob1,i)); |
}else{ |
} |
rob = NullObject; |
if (ob2.tag == Spoly) { |
return rob; |
f = goHomogenize11(KopPOLY(ob2),ds,dssize,-1); |
|
rob = KpoPOLY(f); |
|
}else if (ob2.tag == SuniversalNumber) { |
|
rob = ob2; |
|
}else if (ob2.tag == Sarray) { |
|
rob = newObjectArray(getoaSize(ob2)); |
|
for (i=0; i<getoaSize(ob2); i++) { |
|
tob = newObjectArray(3); |
|
ob1t = newObjectArray(dssize); |
|
if (getoa(ob2,i).tag == Spoly) { |
|
for (j=0; j<dssize; j++) getoa(ob1t,j) = KpoInteger(0); |
|
for (j=0; j<dssize-i; j++) getoa(ob1t,j) = getoa(ob1,j+i); |
|
}else{ |
|
ob1t = ob1; |
|
} |
|
getoa(tob,0) = ob0; getoa(tob,1) = ob1t; getoa(tob,2) = getoa(ob2,i); |
|
getoa(rob,i) = homogenizeObject_go(tob,gradep); |
|
} |
} |
}else{ |
|
errorKan1("%s\n","homogenizeObject_go(): invalid object for the third element."); |
|
} |
} |
|
dssize = getoaSize(ob1); |
|
ds = (int *)sGC_malloc(sizeof(int)*(dssize>0?dssize:1)); |
|
for (i=0; i<dssize; i++) { |
|
ds[i] = objToInteger(getoa(ob1,i)); |
|
} |
|
if (size == 2) { |
|
DegreeShifto = ob1; |
|
DegreeShifto_size = dssize; |
|
DegreeShifto_vec = ds; |
|
rob = ob1; |
|
}else{ |
|
ob2 = getoa(ob,2); |
|
if (ob2.tag == Spoly) { |
|
f = goHomogenize11(KopPOLY(ob2),ds,dssize,-1,0); |
|
rob = KpoPOLY(f); |
|
}else if (ob2.tag == SuniversalNumber) { |
|
rob = ob2; |
|
}else if (ob2.tag == Sarray) { |
|
rob = newObjectArray(getoaSize(ob2)); |
|
for (i=0; i<getoaSize(ob2); i++) { |
|
tob = newObjectArray(3); |
|
ob1t = newObjectArray(dssize); |
|
if (getoa(ob2,i).tag == Spoly) { |
|
for (j=0; j<dssize; j++) getoa(ob1t,j) = KpoInteger(0); |
|
for (j=0; j<dssize-i; j++) getoa(ob1t,j) = getoa(ob1,j+i); |
|
}else{ |
|
ob1t = ob1; |
|
} |
|
getoa(tob,0) = ob0; getoa(tob,1) = ob1t; getoa(tob,2) = getoa(ob2,i); |
|
getoa(rob,i) = homogenizeObject_go(tob,gradep); |
|
} |
|
}else{ |
|
errorKan1("%s\n","homogenizeObject_go(): invalid object for the third element."); |
|
} |
|
} |
}else{ |
}else{ |
errorKan1("%s\n","homogenizeObject_go(): unknown key word."); |
errorKan1("%s\n","homogenizeObject_go(): unknown key word."); |
} |
} |
return( rob ); |
return( rob ); |
} |
} |
|
|
|
|
Line 1062 struct object KvectorToSchreyer_es(struct object obarr |
|
Line 1084 struct object KvectorToSchreyer_es(struct object obarr |
|
|
|
int objToInteger(struct object ob) { |
int objToInteger(struct object ob) { |
if (ob.tag == Sinteger) { |
if (ob.tag == Sinteger) { |
return KopInteger(ob); |
return KopInteger(ob); |
}else if (ob.tag == SuniversalNumber) { |
}else if (ob.tag == SuniversalNumber) { |
return(coeffToInt(KopUniversalNumber(ob))); |
return(coeffToInt(KopUniversalNumber(ob))); |
}else { |
}else { |
errorKan1("%s\n","objToInteger(): invalid argument."); |
errorKan1("%s\n","objToInteger(): invalid argument."); |
} |
} |
} |
} |