[BACK]Return to dp-supp.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2018 / builtin

Diff for /OpenXM_contrib2/asir2018/builtin/dp-supp.c between version 1.6 and 1.8

version 1.6, 2019/09/19 06:29:47 version 1.8, 2019/11/01 04:28:52
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2018/builtin/dp-supp.c,v 1.5 2019/09/13 02:04:42 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2018/builtin/dp-supp.c,v 1.7 2019/10/11 03:45:56 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "base.h"  #include "base.h"
Line 1244  void dp_removecont2(DP p1,DP p2,DP *r1p,DP *r2p,Z *con
Line 1244  void dp_removecont2(DP p1,DP p2,DP *r1p,DP *r2p,Z *con
     *r2p = 0;      *r2p = 0;
 }  }
   
   void dpm_removecont2(DPM p1,DPM p2,DPM *r1p,DPM *r2p,Z *contp)
   {
     struct oVECT v;
     int i,n1,n2,n;
     DMM m,m0,t;
     Z *w;
     Z h;
   
     if ( p1 ) {
       for ( i = 0, m = BDY(p1); m; m = NEXT(m), i++ );
       n1 = i;
     } else
       n1 = 0;
     if ( p2 ) {
       for ( i = 0, m = BDY(p2); m; m = NEXT(m), i++ );
       n2 = i;
     } else
       n2 = 0;
     n = n1+n2;
     if ( !n ) {
       *r1p = 0; *r2p = 0; *contp = ONE; return;
     }
     w = (Z *)ALLOCA(n*sizeof(Q));
     v.len = n;
     v.body = (pointer *)w;
     i = 0;
     if ( p1 )
       for ( m = BDY(p1); i < n1; m = NEXT(m), i++ ) w[i] = (Z)m->c;
     if ( p2 )
       for ( m = BDY(p2); i < n; m = NEXT(m), i++ ) w[i] = (Z)m->c;
     h = w[0]; removecont_array((P *)w,n,1); divsz(h,w[0],contp);
     i = 0;
     if ( p1 ) {
       for ( m0 = 0, t = BDY(p1); i < n1; i++, t = NEXT(t) ) {
         NEXTDMM(m0,m); m->c = (Obj)w[i]; m->dl = t->dl; m->pos = t->pos;
       }
       NEXT(m) = 0;
       MKDPM(p1->nv,m0,*r1p); (*r1p)->sugar = p1->sugar;
     } else
       *r1p = 0;
     if ( p2 ) {
       for ( m0 = 0, t = BDY(p2); i < n; i++, t = NEXT(t) ) {
         NEXTDMM(m0,m); m->c = (Obj)w[i]; m->dl = t->dl; m->pos = t->pos;
       }
       NEXT(m) = 0;
       MKDPM(p2->nv,m0,*r2p); (*r2p)->sugar = p2->sugar;
     } else
       *r2p = 0;
   }
   
 /* true nf by a marked GB */  /* true nf by a marked GB */
   
 void dp_true_nf_marked(NODE b,DP g,DP *ps,DP *hps,DP *rp,P *nmp,P *dnp)  void dp_true_nf_marked(NODE b,DP g,DP *ps,DP *hps,DP *rp,P *nmp,P *dnp)
Line 2228  int create_order_spec(VL vl,Obj obj,struct order_spec 
Line 2278  int create_order_spec(VL vl,Obj obj,struct order_spec 
           basespec->obj = baseobj;            basespec->obj = baseobj;
           spec->base = basespec;            spec->base = basespec;
         } else {  /* weighted order */          } else {  /* weighted order */
             int ordtype;
   
             ordtype = spec->module_ordtype;
           create_order_spec(0,(Obj)BDY(NEXT(NEXT(node))),&spec);            create_order_spec(0,(Obj)BDY(NEXT(NEXT(node))),&spec);
           spec->id = 300; spec->obj = obj;            spec->module_ordtype = ordtype;
             spec->id += 256; spec->obj = obj;
           node = NEXT(node);            node = NEXT(node);
           if ( !BDY(node) || OID(BDY(node)) != O_LIST )            if ( !BDY(node) || OID(BDY(node)) != O_LIST )
             error("create_order_spec : [weight_for_poly,weight_for_modlue] must be specified as a module topweight");              error("create_order_spec : [weight_for_poly,weight_for_modlue] must be specified as a module topweight");
Line 2620  void create_modorder_spec(int id,LIST shift,struct mod
Line 2674  void create_modorder_spec(int id,LIST shift,struct mod
  *   *
  */   */
   
   void dpm_homo(DPM p,DPM *rp)
   {
     DMM m,mr,mr0,t;
     int i,n,nv,td;
     DL dl,dlh;
   
     if ( !p )
       *rp = 0;
     else {
       n = p->nv; nv = n + 1;
       m = BDY(p);
       td = 0;
       for ( t = m; t; t = NEXT(t) )
         if ( m->dl->td > td ) td = m->dl->td;
       for ( mr0 = 0; m; m = NEXT(m) ) {
         NEXTDMM(mr0,mr); mr->c = m->c; mr->pos = m->pos;
         dl = m->dl;
         mr->dl = dlh = (DL)MALLOC_ATOMIC((nv+1)*sizeof(int));
         dlh->td = td;
         for ( i = 0; i < n; i++ )
           dlh->d[i] = dl->d[i];
         dlh->d[n] = td - dl->td;
       }
       NEXT(mr) = 0; MKDPM(nv,mr0,*rp); (*rp)->sugar = p->sugar;
     }
   }
   
   void dpm_dehomo(DPM p,DPM *rp)
   {
     DMM m,mr,mr0;
     int i,n,nv;
     DL dl,dlh;
   
     if ( !p )
       *rp = 0;
     else {
       n = p->nv; nv = n - 1;
       m = BDY(p);
       for ( mr0 = 0; m; m = NEXT(m) ) {
         NEXTDMM(mr0,mr); mr->c = m->c; mr->pos = m->pos;
         dlh = m->dl;
         mr->dl = dl = (DL)MALLOC_ATOMIC((nv+1)*sizeof(int));
         dl->td = dlh->td - dlh->d[nv];
         for ( i = 0; i < nv; i++ )
           dl->d[i] = dlh->d[i];
       }
       NEXT(mr) = 0; MKDPM(nv,mr0,*rp); (*rp)->sugar = p->sugar;
     }
   }
   
 void dp_homo(DP p,DP *rp)  void dp_homo(DP p,DP *rp)
 {  {
   MP m,mr,mr0;    MP m,mr,mr0;
Line 2666  void dp_dehomo(DP p,DP *rp)
Line 2770  void dp_dehomo(DP p,DP *rp)
     NEXT(mr) = 0; MKDP(nv,mr0,*rp); (*rp)->sugar = p->sugar;      NEXT(mr) = 0; MKDP(nv,mr0,*rp); (*rp)->sugar = p->sugar;
   }    }
 }  }
   
   
 void dp_mod(DP p,int mod,NODE subst,DP *rp)  void dp_mod(DP p,int mod,NODE subst,DP *rp)
 {  {

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.8

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