Annotation of OpenXM/src/kan96xx/Kan/extern2.h, Revision 1.4
1.4 ! takayama 1: /* $OpenXM: OpenXM/src/kan96xx/Kan/extern2.h,v 1.3 2003/04/09 01:06:57 ohara Exp $ */
1.1 maekawa 2: /* poly.c */
3: void KinitKan(void);
4: MONOMIAL newMonomial(struct ring *ringp);
5: MONOMIAL monomialCopy(MONOMIAL m);
6: struct coeff *newCoeff(void);
7: MP_INT *newMP_INT();
8: POLY newCell(struct coeff *c,MONOMIAL m);
9: POLY cxx(int c,int i,int k,struct ring *ringp);
10: POLY bxx(MP_INT *c,int i,int k,struct ring *ringp); /* *c is not copied */
11: POLY cdd(int c,int i,int k,struct ring *ringp);
12: POLY bdd(MP_INT *c,int i,int k,struct ring *ringp); /* *c is not copied */
13: void errorPoly(char *s);
14: void warningPoly(char *s);
15:
16: /** Note that the results of all functions are read only except
17: ppMult, mpMult, sp and constructors.
18: The results of ppMult, mpMult, sp and constructors may be rewritten.
19: **/
20: /* poly2.c */
21: POLY ppAdd(POLY f,POLY g);
22: POLY ppSub(POLY f,POLY g);
23: POLY ppMult(POLY f,POLY g);
24: POLY ppMult_poly(POLY f,POLY g);
25: POLY (*mpMult)(POLY f,POLY g);
26: POLY mpMult_poly(POLY f,POLY g);
27: MONOMIAL (*monomialAdd)(MONOMIAL f,MONOMIAL g);
28: MONOMIAL monomialAdd_poly(MONOMIAL f,MONOMIAL g);
29: POLY ppAddv(POLY f,POLY g); /* non-reentrant. It breaks f and g */
30: POLY ppAddv2(POLY f,POLY g,POLY top,POLY *nexttop);
31: /* non-reentrant. It breaks f and g */
32: POLY pCopy(POLY f); /* shallow copy of poly */
33: POLY pcCopy(POLY f); /* shallow copy of poly and coeff */
34: POLY pmCopy(POLY f); /* shallow copy of poly and monomial */
35: POLY pcmCopy(POLY f);/* Deep copy of poly, coeff and monomial */
36: POLY head(POLY f);
37: void pvSort(POLY f);
38: POLY pPower(POLY f,int k);
39: POLY pPower_poly(POLY f,int k);
40: POLY pcDiv(POLY f,struct coeff *c);
41: POLY cpMult(struct coeff *c,POLY f); /* non-reentrant */
42: POLY modulop(POLY f,struct ring *ringp);
43: POLY modulo0(POLY f,struct ring *ringp);
44: POLY modulopZ(POLY f,struct coeff *pcoeff);
45: struct pairOfPOLY quotientByNumber(POLY f,struct coeff *pcoeff);
46: int pLength(POLY f);
47:
48: /* poly3.c */
49: void initT(void);
50: void makeTable(struct coeff *c,struct exps e[],struct ring *ringp);
51: void monomialMult_diff(struct exps e[],POLY f);
52: POLY mpMult_diff(POLY f,POLY g); /* It is non-reentrant!!! */
53: POLY mpMult_difference(POLY f,POLY g);
54: /* replace.c */
55: POLY mReplace(POLY f,int lSideX[],POLY rSideX[],int sizex,
56: int lSideD[],POLY rSideD[],int sized,int commutative);
57: POLY replace(POLY f,POLY lRule[],POLY rRule[],int num);
58: POLY replace_poly(POLY f,POLY lRule[],POLY rRule[],int num);
59:
60: /* poly4.c */
61: struct matrixOfPOLY *parts(POLY f,POLY v);
62: int pDegreeWrtV(POLY f,POLY v);
63: POLY homogenize(POLY f);
64: POLY homogenize_vec(POLY f);
65: int isHomogenized(POLY f);
66: int isHomogenized_vec(POLY f);
67: int containVectorVariable(POLY f);
68: POLY POLYToPrincipalPart(POLY f);
69: POLY POLYToInitW(POLY f,int w[]);
70:
71: POLY polyGCD(POLY f,POLY g);
72: int isTheSameRing(struct ring *rstack[], int rp, struct ring *newRingp);
1.4 ! takayama 73: POLY goHomogenize(POLY f,int u[],int v[],int ds[],int dssize,int ei);
! 74: POLY goHomogenize11(POLY f,int ds[],int dssize,int ei);
! 75: POLY goHomogenize_dsIdx(POLY f,int u[],int v[],int dsIdx,int ei);
! 76: POLY goHomogenize11_dsIdx(POLY f,int ds[],int dsIdx,int ei);
1.1 maekawa 77:
78: /* coeff.c */
79: char *intToString(int i);
80: char *coeffToString(struct coeff *cp);
81: struct coeff *intToCoeff(int i,struct ring *ringp);
82: int coeffToInt(struct coeff *cp);
83: struct coeff *mpintToCoeff(MP_INT *b,struct ring *ringp);
84: struct coeff *polyToCoeff(POLY f,struct ring *ringp);
85: struct coeff *coeffNeg(struct coeff *c,struct ring *ringp);
86: void errorCoeff(char *s);
87: void warningCoeff(char *str);
88: void Cadd(struct coeff *r,struct coeff *a,struct coeff *b);
89: void Csub(struct coeff *r,struct coeff *a,struct coeff *b);
90: void Cmult(struct coeff *r,struct coeff *a,struct coeff *b);
91: void Cdiv(struct coeff *r,struct coeff *a,struct coeff *b);
92: MP_INT *BiiComb(int p,int q); /* read only */
93: int iiComb(int p,int q,int P);
94: void CiiComb(struct coeff *r,int p,int q); /* r->val.bigp is read only */
95: MP_INT *BiiPoch(int p,int k); /* read only */
96: int iiPoch(int p,int k,int P);
97: void CiiPoch(struct coeff *r,int p,int k); /* r->val.bigp is read only */
98: MP_INT *BiiPower(int p,int k); /* read only */
99: int iiPower(int p,int k,int P);
100: void CiiPower(struct coeff *r,int p,int k); /* r->val.bigp is read only */
101: struct coeff *coeffCopy(struct coeff *c);
102: struct coeff *stringToUniversalNumber(char *s,int *flagp);
103: struct coeff *newUniversalNumber(int i);
104: struct coeff *newUniversalNumber2(MP_INT *i);
105: #define is_this_coeff_MP_INT(c) ((c)->tag == MP_INTEGER?1:0)
106: #define coeff_to_MP_INT(c) ((c)->val.bigp)
107: int coeffEqual(struct coeff *c,struct coeff *d);
108: int coeffGreater(struct coeff *c,struct coeff *d);
109: POLY coeffToPoly(struct coeff *c,struct ring *rp);
110: void universalNumberDiv(struct coeff *q,struct coeff *a, struct coeff *b);
111: int isZero(struct coeff *a);
112: struct coeff *universalNumberGCD(struct coeff *a,struct coeff *b);
113:
114:
115: /* output.c */
116: char *POLYToString(POLY f,int multSym,int brace);
117: int isOne(struct coeff *cp);
118: int isMinusOne(struct coeff *cp);
119: int isMinusOne(struct coeff *cp);
120: int isNegative(struct coeff *cp);
121: int isConstant(POLY f);
122: void errorOutput(char *s);
123: int validOutputOrder(int w[],int n);
124:
125: /* order.c */
126: void setOrderByMatrix(int order[],int n,int c, int l,int omsize);
127: void printOrder(struct ring *ringp);
128: void showRing(int level,struct ring *ringp);
129: int (*mmLarger)(POLY f,POLY g);
130: int mmLarger_matrix(POLY f,POLY g);
131: int mmLarger_pureLexicographic(POLY f, POLY g);
132: int mmLarger_tower(POLY f,POLY g);
133: void setFromTo(struct ring *ringp);
134:
135: /* switch.c */
136: void print_switch_status(void);
137: char *switch_function(char *fun,char *arg);
138: void switch_init(void);
139: void switch_mmLarger(char *arg);
140: void switch_mpMult(char *arg);
141: void switch_monomialAdd(char *arg);
142: void switch_red(char *arg);
143: void switch_sp(char *arg);
144: void switch_groebner(char *arg);
145: void switch_grade(char *arg);
146: void switch_isSameComponent(char *arg);
147:
148: /* parser.c */
149: POLY stringToPOLY(char *s,struct ring *ringp);
150: char *str2strPass0(char *s,struct ring *rp);
151:
152: /* matrix.c : Arguments are read only.*/
153: struct arrayOfPOLY *aaAdd(struct arrayOfPOLY *aa,struct arrayOfPOLY *bb);
154: struct matrixOfPOLY *aaMult(struct matrixOfPOLY *aa,struct matrixOfPOLY *bb);
155: struct arrayOfPOLY *newArrayOfPOLY(int size);
156: struct matrixOfPOLY *newMatrixOfPOLY(int m,int n);
157: struct arrayOfPOLY *carrayToArrayOfPOLY(POLY a[],int size);
158: void errorMatrix(char *s);
159:
160: /* redm.c (red.c for modules) */
161: int isReducible_module(POLY f,POLY g);
162: int (*isSameComponent)(POLY f,POLY g);
163: int isSameComponent_x(POLY f,POLY g);
164: int isSameComponent_xd(POLY f,POLY g);
165: POLY lcm_module(POLY f,POLY g);
166: int grade_module1(POLY f);
167: int grade_module1v(POLY f);
168: int grade_module2(POLY f);
169: int grade_firstvec(POLY f);
170: int grade_sugar(POLY f);
171: int eliminated(POLY f);
172: int isOrdered(POLY f);
1.4 ! takayama 173: int dGrade(POLY f);
! 174: int dGrade1(POLY f);
! 175: int uvGrade(POLY f, int u[],int v[],int ds[],int dssize,int ei);
! 176: int uvGrade1(POLY f, int u[],int v[],int ds[],int dssize,int ei);
1.1 maekawa 177:
178: /* resol.c */
179: struct arrayOfMonomialSyz schreyerSkelton(struct arrayOfPOLY g);
180: struct monomialSyz *newMonomialSyz(void);
181: struct arrayOfMonomialSyz enlargeArrayOfMonomialSyz(struct arrayOfMonomialSyz p);
182:
183:
184: /* from gradedset.h */
185: int (*grade)(POLY f);
186:
187: /* macro */
188: #define pMalloc(ringp) newCell(newCoeff(),newMonomial(ringp))
189:
190: #define xset0(f,i) f->m->e[i].x = 0
191: #define dset0(f,i) f->m->e[i].D = 0
192:
193: #define checkRing2(f,g) {\
194: if ((f)->m->ringp != (g)->m->ringp) {\
195: fprintf(stderr,"f and g must be in a same ring. Type in ctrl-\\");\
1.3 ohara 196: getchar(); getchar(); exit(1);\
1.1 maekawa 197: }\
198: }
199:
200: #define checkRing(f,g) {\
201: if ((f)->m->ringp != (g)->m->ringp) {\
202: warningPoly("f and g must be in a same ring. Returns 0.\n");\
203: fprintf(stderr,"f=%s\n",POLYToString(f,'*',0));\
204: fprintf(stderr,"g=%s\n",POLYToString(g,'*',0));\
205: return(POLYNULL);\
206: }\
207: }
208:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>