version 1.8, 2003/08/19 08:02:10 |
version 1.9, 2003/08/21 12:28:58 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/poly4.c,v 1.7 2003/07/19 06:03:57 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/poly4.c,v 1.8 2003/08/19 08:02:10 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "stackm.h" |
#include "stackm.h" |
Line 539 int isTheSameRing(struct ring *rstack[],int rp, struct |
|
Line 539 int isTheSameRing(struct ring *rstack[],int rp, struct |
|
|
|
/* s->1 */ |
/* s->1 */ |
POLY goDeHomogenizeS(POLY f) { |
POLY goDeHomogenizeS(POLY f) { |
|
POLY lRule[1]; |
|
POLY rRule[1]; |
|
struct ring *rp; |
|
POLY ans; |
|
/* printf("1:[%s]\n",POLYToString(f,'*',1)); */ |
|
if (f == POLYNULL) return f; |
|
rp = f->m->ringp; |
|
if (rp->next == NULL) { |
|
lRule[0] = cxx(1,0,1,rp); |
|
rRule[0] = cxx(1,0,0,rp); |
|
ans=replace(f,lRule,rRule,1); |
|
}else{ |
|
struct coeff *cp; |
|
POLY t; |
|
POLY nc; |
|
ans = POLYNULL; |
|
while (f != POLYNULL) { |
|
cp = f->coeffp; |
|
if (cp->tag == POLY_COEFF) { |
|
t = goDeHomogenizeS((cp->val).f); |
|
nc = newCell(polyToCoeff(t,f->m->ringp),f->m); |
|
ans = ppAddv(ans,nc); |
|
f = f->next; |
|
}else{ |
|
ans = f; break; |
|
} |
|
} |
|
} |
|
/* printf("2:[%s]\n",POLYToString(ans,'*',1)); */ |
|
return ans; |
|
} |
|
|
|
POLY goDeHomogenizeS_buggy(POLY f) { |
POLY node; |
POLY node; |
POLY lastf; |
POLY lastf; |
struct listPoly nod; |
struct listPoly nod; |
Line 546 POLY goDeHomogenizeS(POLY f) { |
|
Line 579 POLY goDeHomogenizeS(POLY f) { |
|
POLY tf; |
POLY tf; |
int gt,first; |
int gt,first; |
|
|
|
printf("1:[%s]\n",POLYToString(f,'*',1)); |
if (f == POLYNULL) return(POLYNULL); |
if (f == POLYNULL) return(POLYNULL); |
node = &nod; |
node = &nod; |
node->next = POLYNULL; |
node->next = POLYNULL; |
Line 575 POLY goDeHomogenizeS(POLY f) { |
|
Line 609 POLY goDeHomogenizeS(POLY f) { |
|
} |
} |
f = f->next; |
f = f->next; |
} |
} |
|
printf("2:[%s]\n",POLYToString(node->next,'*',1)); |
return (node->next); |
return (node->next); |
} |
} |
|
|