[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.7

version 1.6, 2019/09/19 06:29:47 version 1.7, 2019/10/11 03:45:56
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.6 2019/09/19 06:29:47 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "base.h"  #include "base.h"
Line 2228  int create_order_spec(VL vl,Obj obj,struct order_spec 
Line 2228  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 2624  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 2720  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.7

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