[BACK]Return to ecart.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Diff for /OpenXM/src/kan96xx/Kan/ecart.c between version 1.12 and 1.15

version 1.12, 2003/08/21 12:28:57 version 1.15, 2003/08/26 05:52:43
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/kan96xx/Kan/ecart.c,v 1.11 2003/08/21 02:30:23 takayama Exp $ */  /* $OpenXM: OpenXM/src/kan96xx/Kan/ecart.c,v 1.14 2003/08/26 05:06:01 takayama Exp $ */
 #include <stdio.h>  #include <stdio.h>
 #include "datatype.h"  #include "datatype.h"
 #include "extern2.h"  #include "extern2.h"
Line 297  static POLY reduction_ecart0(r,gset,needSyz,syzp)
Line 297  static POLY reduction_ecart0(r,gset,needSyz,syzp)
   POLY cf_o;    POLY cf_o;
   POLY syz_o;    POLY syz_o;
   POLY r_0;    POLY r_0;
     int se;
     struct coeff *cont;
   
   extern struct ring *CurrentRingp;    extern struct ring *CurrentRingp;
   struct ring *rp;    struct ring *rp;
Line 316  static POLY reduction_ecart0(r,gset,needSyz,syzp)
Line 318  static POLY reduction_ecart0(r,gset,needSyz,syzp)
     }      }
   }    }
   
     if (DoCancel && (r != POLYNULL)) shouldReduceContent(r,1);
   
   if (DebugReductionEcart&1) printf("--------------------------------------\n");    if (DebugReductionEcart&1) printf("--------------------------------------\n");
   do {    do {
     if (DebugReductionRed) printf("r=%s\n",POLYToString(r,'*',1));      if (DebugReductionRed) printf("r=%s\n",POLYToString(r,'*',1));
Line 339  static POLY reduction_ecart0(r,gset,needSyz,syzp)
Line 343  static POLY reduction_ecart0(r,gset,needSyz,syzp)
       }        }
       if (ell > 0) r = mpMult(cxx(1,0,ell,rp),r); /* r = s^ell r */        if (ell > 0) r = mpMult(cxx(1,0,ell,rp),r); /* r = s^ell r */
       r = (*reduction1)(r,pp,needSyz,&cc,&cg);        r = (*reduction1)(r,pp,needSyz,&cc,&cg);
   
         if (DoCancel && (r != POLYNULL)) {
           if (shouldReduceContent(r,0)) {
             r = reduceContentOfPoly(r,&cont);
             shouldReduceContent(r,1);
             if (DebugReductionEcart || DebugReductionRed || DebugContentReduction) printf("CONT=%s ",coeffToString(cont));
           }
         }
   
   
       if (needSyz) {        if (needSyz) {
         if (ells.first) {          if (ells.first) {
           if (ell >0) cc = ppMult(cc,cxx(1,0,ell,rp));            if (ell >0) cc = ppMult(cc,cxx(1,0,ell,rp));
Line 368  static POLY reduction_ecart0(r,gset,needSyz,syzp)
Line 382  static POLY reduction_ecart0(r,gset,needSyz,syzp)
         }          }
       }        }
       if (r ISZERO) goto ss;        if (r ISZERO) goto ss;
       /*r = ecartDivideSv(r,&se); r = r/s^? Don't do this. */  
         /* r = r/s^? Don't do this?? */
         r = ecartDivideSv(r,&se);
             if (needSyz && (se > 0)) {
                   POLY tt;
                   tt = cxx(1,0,-se,rp);
                   cf = mpMult(tt,cf);
                   syz = cpMult(toSyzCoeff(tt),syz);
             }
   
     }      }
   }while (ell >= 0);    }while (ell >= 0);
   
Line 378  static POLY reduction_ecart0(r,gset,needSyz,syzp)
Line 401  static POLY reduction_ecart0(r,gset,needSyz,syzp)
     syzp->syz = syz; /* syz is in the SyzRingp */      syzp->syz = syz; /* syz is in the SyzRingp */
   }    }
   
     if (DoCancel && (r != POLYNULL)) {
       if (r->m->ringp->p == 0) {
             r = reduceContentOfPoly(r,&cont);
             if (DebugReductionEcart || DebugReductionRed || DebugContentReduction) printf("cont=%s ",coeffToString(cont));
       }
     }
   
   return(r);    return(r);
 }  }
   
Line 499  static POLY reduction_ecart1(r,gset,needSyz,syzp)
Line 529  static POLY reduction_ecart1(r,gset,needSyz,syzp)
   
       if (r ISZERO) goto ss1;        if (r ISZERO) goto ss1;
       r = ecartDivideSv(r,&se); /* r = r/s^? */        r = ecartDivideSv(r,&se); /* r = r/s^? */
   
             if (needSyz && (se > 0)) { /* It may not necessary because of dehomo*/
                   POLY tt;
                   /*printf("!1/H!"); fflush(NULL);*/ /* misc-2003/ecart/t1.sm1 foo4 */
                   tt = cxx(1,0,-se,rp);
                   cf = mpMult(tt,cf);
                   syz = cpMult(toSyzCoeff(tt),syz);
             }
   
     }      }
   }while (ell >= 0);    }while (ell >= 0);
   
Line 507  static POLY reduction_ecart1(r,gset,needSyz,syzp)
Line 546  static POLY reduction_ecart1(r,gset,needSyz,syzp)
     /* dehomogenize the syzygy. BUG, this may be inefficient.  */      /* dehomogenize the syzygy. BUG, this may be inefficient.  */
         cf = goDeHomogenizeS(cf);          cf = goDeHomogenizeS(cf);
         syz = goDeHomogenizeS(syz);          syz = goDeHomogenizeS(syz);
         printf("cf=%s\n",POLYToString(cf,'*',1));          /*printf("cf=%s\n",POLYToString(cf,'*',1));
         printf("syz=%s\n",POLYToString(syz,'*',1));            printf("syz=%s\n",POLYToString(syz,'*',1));*/
     syzp->cf = cf;   /* cf is in the CurrentRingp */      syzp->cf = cf;   /* cf is in the CurrentRingp */
     syzp->syz = syz; /* syz is in the SyzRingp */      syzp->syz = syz; /* syz is in the SyzRingp */
   }    }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.15

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>