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

Diff for /OpenXM/src/kan96xx/Kan/poly2.c between version 1.4 and 1.7

version 1.4, 2003/08/20 01:39:17 version 1.7, 2005/07/03 11:08:54
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/kan96xx/Kan/poly2.c,v 1.3 2001/05/04 01:06:25 takayama Exp $ */  /* $OpenXM: OpenXM/src/kan96xx/Kan/poly2.c,v 1.6 2005/06/16 05:07:23 takayama Exp $ */
 #include <stdio.h>  #include <stdio.h>
   #include <stdlib.h>
 #include "datatype.h"  #include "datatype.h"
 #include "stackm.h"  #include "stackm.h"
 #include "extern.h"  #include "extern.h"
Line 694  POLY modulo0(f,ringp)
Line 695  POLY modulo0(f,ringp)
 struct object test(ob)  /* test3 */  struct object test(ob)  /* test3 */
          struct object ob;           struct object ob;
 {  {
   struct object rob;    struct object rob = OINIT;
   int k;    int k;
   static POLY f0;    static POLY f0;
   static POLY f1;    static POLY f1;
Line 953  POLY reduceContentOfPoly(POLY f,struct coeff **contp) 
Line 954  POLY reduceContentOfPoly(POLY f,struct coeff **contp) 
   struct coeff *cOne = NULL;    struct coeff *cOne = NULL;
   extern struct ring *SmallRingp;    extern struct ring *SmallRingp;
   if (cOne == NULL) cOne = intToCoeff(1,SmallRingp);    if (cOne == NULL) cOne = intToCoeff(1,SmallRingp);
     *contp = cOne;
   
   if (f == POLYNULL) return f;    if (f == POLYNULL) return f;
   if (f->m->ringp->p != 0) return f;    if (f->m->ringp->p != 0) return f;
Line 990  struct coeff *gcdOfCoeff(POLY f) {
Line 992  struct coeff *gcdOfCoeff(POLY f) {
         cOne = newMP_INT();          cOne = newMP_INT();
         mpz_set_si(cOne,(long) 1);          mpz_set_si(cOne,(long) 1);
   }    }
   if (f == POLYNULL) return 0;    if (f == POLYNULL) return intToCoeff(0,SmallRingp);
   if (f->m->ringp->p != 0) return intToCoeff(0,SmallRingp);    if (f->m->ringp->p != 0) return intToCoeff(0,SmallRingp);
   if (f->coeffp->tag != MP_INTEGER) return intToCoeff(0,SmallRingp);    if (f->coeffp->tag != MP_INTEGER) return intToCoeff(0,SmallRingp);
   tmp = f->coeffp->val.bigp;    tmp = f->coeffp->val.bigp;
Line 1003  struct coeff *gcdOfCoeff(POLY f) {
Line 1005  struct coeff *gcdOfCoeff(POLY f) {
   }    }
   return mpintToCoeff(tmp,SmallRingp);    return mpintToCoeff(tmp,SmallRingp);
   
   }
   
   int shouldReduceContent(POLY f,int ss) {
     extern DoCancel;
     static int prevSize = 1;
     int size;
     if (f == POLYNULL) return 0;
     if (f->m->ringp->p != 0) return 0;
     if (f->coeffp->tag != MP_INTEGER) return 0;
     if (DoCancel & 2) return 1;
     /* Apply the Noro strategy to reduce content. */
     size = mpz_size(f->coeffp->val.bigp);
     if (ss > 0) {
           prevSize = size;
           return 0;
     }
     if (size > 2*prevSize) {
           return 1;
     }else{
           return 0;
     }
 }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.7

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