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

Diff for /OpenXM/src/kan96xx/Kan/poly.c between version 1.2 and 1.3

version 1.2, 2000/01/16 07:55:40 version 1.3, 2001/05/04 01:06:24
Line 1 
Line 1 
 /* $OpenXM$ */  /* $OpenXM: OpenXM/src/kan96xx/Kan/poly.c,v 1.2 2000/01/16 07:55:40 takayama Exp $ */
 #include <stdio.h>  #include <stdio.h>
 #include "datatype.h"  #include "datatype.h"
 #include "stackm.h"  #include "stackm.h"
Line 26  void KinitKan(void) {
Line 26  void KinitKan(void) {
   int i;    int i;
   static char *smallx[] = {"x","t"};    static char *smallx[] = {"x","t"};
   static char *smalld[] = {"h","T"};    static char *smalld[] = {"h","T"};
                            /* t  x  T  h */    /* t  x  T  h */
   static int smallOrder[] = { 1, 0, 0, 0,    static int smallOrder[] = { 1, 0, 0, 0,
                               0, 1, 0, 0,                                0, 1, 0, 0,
                               0, 0, 1, 0,                                0, 0, 1, 0,
Line 64  void KinitKan(void) {
Line 64  void KinitKan(void) {
   
 #ifndef NOGC  #ifndef NOGC
   /* initialize MPZ */    /* initialize MPZ */
    mp_set_memory_functions(sGC_malloc,sGC_realloc2,sGC_free2);    mp_set_memory_functions(sGC_malloc,sGC_realloc2,sGC_free2);
 #endif  #endif
   
   /* Msize is 8 on SUN gcc */    /* Msize is 8 on SUN gcc */
Line 97  void sGC_free2(void *p,size_t size)
Line 97  void sGC_free2(void *p,size_t size)
   
   
 MONOMIAL newMonomial(ringp)  MONOMIAL newMonomial(ringp)
 struct ring *ringp;       struct ring *ringp;
 {  {
   MONOMIAL f;    MONOMIAL f;
   extern int Msize;    extern int Msize;
Line 116  struct ring *ringp;
Line 116  struct ring *ringp;
   
   
 MONOMIAL monomialCopy(m)  MONOMIAL monomialCopy(m)
 MONOMIAL m;       MONOMIAL m;
 {  {
   extern int Msize;    extern int Msize;
   MONOMIAL f;    MONOMIAL f;
Line 153  MP_INT *newMP_INT() {
Line 153  MP_INT *newMP_INT() {
 }  }
   
 POLY newCell(c,mon)  POLY newCell(c,mon)
 struct coeff *c;       struct coeff *c;
 MONOMIAL mon;       MONOMIAL mon;
 {  {
   POLY ff;    POLY ff;
   ff = (POLY) sGC_malloc(sizeof(struct listPoly));    ff = (POLY) sGC_malloc(sizeof(struct listPoly));
Line 167  MONOMIAL mon;
Line 167  MONOMIAL mon;
   
 /* constructors */  /* constructors */
 POLY cxx(c,i,k,ringp)  POLY cxx(c,i,k,ringp)
 int c,i,k;       int c,i,k;
 struct ring *ringp;       struct ring *ringp;
 /*  c x_i^k where p is the characteristic. */       /*  c x_i^k where p is the characteristic. */
 /* New cell, monomial and coeff. */       /* New cell, monomial and coeff. */
 {  {
   POLY f;    POLY f;
   int p;    int p;
Line 199  struct ring *ringp;
Line 199  struct ring *ringp;
 }  }
   
 POLY bxx(c,i,k,ringp)  POLY bxx(c,i,k,ringp)
 MP_INT *c;       MP_INT *c;
 int i,k;       int i,k;
 struct ring *ringp;       struct ring *ringp;
 /*  c x_i^k.  c is not copied. */       /*  c x_i^k.  c is not copied. */
 {  {
 /* new cell, monomial, coeff. MP_INT c is not copied. */    /* new cell, monomial, coeff. MP_INT c is not copied. */
   POLY f;    POLY f;
   int p;    int p;
   p = ringp->p;    p = ringp->p;
Line 229  struct ring *ringp;
Line 229  struct ring *ringp;
 }  }
   
 POLY cdd(c,i,k,ringp)  POLY cdd(c,i,k,ringp)
 int c,i,k;       int c,i,k;
 struct ring *ringp;       struct ring *ringp;
 /*  c D_i^k where p is the characteristic. */       /*  c D_i^k where p is the characteristic. */
 /* New cell, monomial and coeff. */       /* New cell, monomial and coeff. */
 {  {
   POLY f;    POLY f;
   int p;    int p;
Line 263  struct ring *ringp;
Line 263  struct ring *ringp;
   
   
 POLY pCopy(f)  POLY pCopy(f)
 POLY f;       POLY f;
 {  {
   POLY node;    POLY node;
   struct listPoly nod;    struct listPoly nod;
Line 281  POLY f;
Line 281  POLY f;
 }  }
   
 POLY pcCopy(f)  POLY pcCopy(f)
 POLY f;       POLY f;
 {  {
   
   POLY node;    POLY node;
Line 302  POLY f;
Line 302  POLY f;
 }  }
   
 POLY pmCopy(f)  POLY pmCopy(f)
 POLY f;       POLY f;
 {  {
   POLY node;    POLY node;
   struct listPoly nod;    struct listPoly nod;
Line 321  POLY f;
Line 321  POLY f;
 }  }
   
 POLY pcmCopy(f)  POLY pcmCopy(f)
 POLY f;       POLY f;
 {  {
   POLY node;    POLY node;
   struct listPoly nod;    struct listPoly nod;
Line 340  POLY f;
Line 340  POLY f;
 }  }
   
 POLY head(f)  POLY head(f)
 POLY f;       POLY f;
 {  {
   if (f == ZERO) return(f);    if (f == ZERO) return(f);
   else {    else {
Line 349  POLY f;
Line 349  POLY f;
 }  }
   
 void errorPoly(str)  void errorPoly(str)
 char *str;       char *str;
 {  {
   fprintf(stderr,"Error(poly.c): %s\n",str);    fprintf(stderr,"Error(poly.c): %s\n",str);
   exit(20);    exit(20);
 }  }
   
 void warningPoly(str)  void warningPoly(str)
 char *str;       char *str;
 {  {
   fprintf(stderr,"Warning(poly.c): %s\n",str);    fprintf(stderr,"Warning(poly.c): %s\n",str);
 }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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