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

Diff for /OpenXM_contrib2/asir2018/builtin/dp.c between version 1.18 and 1.21

version 1.18, 2019/11/19 10:50:31 version 1.21, 2019/12/27 08:13:59
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.c,v 1.17 2019/11/12 07:47:45 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2018/builtin/dp.c,v 1.20 2019/12/12 04:44:59 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "base.h"  #include "base.h"
Line 92  void Pdp_gr_checklist();
Line 92  void Pdp_gr_checklist();
 void Pdp_ltod(),Pdpv_ord(),Pdpv_ht(),Pdpv_hm(),Pdpv_hc();  void Pdp_ltod(),Pdpv_ord(),Pdpv_ht(),Pdpv_hm(),Pdpv_hc();
 void Pdpm_ltod(),Pdpm_dtol(),Pdpm_set_schreyer(),Pdpm_nf(),Pdpm_weyl_nf(),Pdpm_sp(),Pdpm_weyl_sp(),Pdpm_nf_and_quotient(),Pdpm_nf_and_quotient2();  void Pdpm_ltod(),Pdpm_dtol(),Pdpm_set_schreyer(),Pdpm_nf(),Pdpm_weyl_nf(),Pdpm_sp(),Pdpm_weyl_sp(),Pdpm_nf_and_quotient(),Pdpm_nf_and_quotient2();
 void Pdpm_schreyer_frame(),Pdpm_set_schreyer_level();  void Pdpm_schreyer_frame(),Pdpm_set_schreyer_level();
 void Pdpm_hm(),Pdpm_ht(),Pdpm_hc(),Pdpm_hp(),Pdpm_rest(),Pdpm_shift(),Pdpm_split(),Pdpm_sort(),Pdpm_dptodpm(),Pdpm_redble();  void Pdpm_list_to_array(),Pdpm_sp_nf(),Pdpm_insert_to_zlist();
   void Pdpm_hm(),Pdpm_ht(),Pdpm_hc(),Pdpm_hp(),Pdpm_rest(),Pdpm_shift(),Pdpm_split(),Pdpm_extract(),Pdpm_sort(),Pdpm_dptodpm(),Pdpm_redble();
 void Pdpm_schreyer_base(),Pdpm_simplify_syz(),Pdpm_td();  void Pdpm_schreyer_base(),Pdpm_simplify_syz(),Pdpm_td();
   void Pdpm_remove_cont();
   
 void Pdp_weyl_red();  void Pdp_weyl_red();
 void Pdp_weyl_sp();  void Pdp_weyl_sp();
Line 142  struct ftab dp_tab[] = {
Line 144  struct ftab dp_tab[] = {
   {"dp_prim",Pdp_prim,1},    {"dp_prim",Pdp_prim,1},
   {"dp_red_coef",Pdp_red_coef,2},    {"dp_red_coef",Pdp_red_coef,2},
   {"dp_cont",Pdp_cont,1},    {"dp_cont",Pdp_cont,1},
     {"dpm_remove_cont",Pdpm_remove_cont,1},
   
 /* polynomial ring */  /* polynomial ring */
   /* special operations */    /* special operations */
Line 307  struct ftab dp_supp_tab[] = {
Line 310  struct ftab dp_supp_tab[] = {
   {"dpm_rest",Pdpm_rest,1},    {"dpm_rest",Pdpm_rest,1},
   {"dpm_shift",Pdpm_shift,2},    {"dpm_shift",Pdpm_shift,2},
   {"dpm_split",Pdpm_split,2},    {"dpm_split",Pdpm_split,2},
     {"dpm_extract",Pdpm_extract,2},
   {"dpm_sort",Pdpm_sort,1},    {"dpm_sort",Pdpm_sort,1},
   {"dp_rest",Pdp_rest,1},    {"dp_rest",Pdp_rest,1},
   {"dp_initial_term",Pdp_initial_term,1},    {"dp_initial_term",Pdp_initial_term,1},
Line 334  struct ftab dp_supp_tab[] = {
Line 338  struct ftab dp_supp_tab[] = {
   {"dp_mono_raddec",Pdp_mono_raddec,2},    {"dp_mono_raddec",Pdp_mono_raddec,2},
   {"dp_mono_reduce",Pdp_mono_reduce,2},    {"dp_mono_reduce",Pdp_mono_reduce,2},
   {"dpm_schreyer_base",Pdpm_schreyer_base,1},    {"dpm_schreyer_base",Pdpm_schreyer_base,1},
     {"dpm_list_to_array",Pdpm_list_to_array,1},
     {"dpm_sp_nf",Pdpm_sp_nf,4},
     {"dpm_insert_to_zlist",Pdpm_insert_to_zlist,3},
   {"dpm_simplify_syz",Pdpm_simplify_syz,2},    {"dpm_simplify_syz",Pdpm_simplify_syz,2},
   
   {"dp_rref2",Pdp_rref2,2},    {"dp_rref2",Pdp_rref2,2},
Line 817  void Pdp_cont(NODE arg,Z *rp)
Line 824  void Pdp_cont(NODE arg,Z *rp)
   dp_cont((DP)ARG0(arg),rp);    dp_cont((DP)ARG0(arg),rp);
 }  }
   
   void dpm_ptozp(DPM p,Z *cont,DPM *r);
   
   void Pdpm_remove_cont(NODE arg,LIST *rp)
   {
     NODE nd;
     Z cont;
     DPM p;
   
     dpm_ptozp((DPM)ARG0(arg),&cont,&p);
     nd = mknode(2,cont,p);
     MKLIST(*rp,nd);
   }
   
 void Pdp_dtov(NODE arg,VECT *rp)  void Pdp_dtov(NODE arg,VECT *rp)
 {  {
   dp_dtov((DP)ARG0(arg),rp);    dp_dtov((DP)ARG0(arg),rp);
Line 1114  void Pdpm_dptodpm(NODE arg,DPM *rp)
Line 1134  void Pdpm_dptodpm(NODE arg,DPM *rp)
     for ( m0 = 0, mp = BDY(p); mp; mp = NEXT(mp) ) {      for ( m0 = 0, mp = BDY(p); mp; mp = NEXT(mp) ) {
       NEXTDMM(m0,m); m->dl = mp->dl; m->c = mp->c; m->pos = pos;        NEXTDMM(m0,m); m->dl = mp->dl; m->c = mp->c; m->pos = pos;
     }      }
     if ( dp_current_spec->module_rank ) {      if ( dp_current_spec->module_top_weight ) {
       if ( pos > dp_current_spec->module_rank )        if ( pos > dp_current_spec->module_rank )
         error("dpm_dptodpm : inconsistent order spec");          error("dpm_dptodpm : inconsistent order spec");
       shift = dp_current_spec->module_top_weight[pos-1];        shift = dp_current_spec->module_top_weight[pos-1];
Line 1924  void Pdpm_redble(NODE arg,Z *rp)
Line 1944  void Pdpm_redble(NODE arg,Z *rp)
 }  }
   
 void dpm_schreyer_base(LIST g,LIST *s);  void dpm_schreyer_base(LIST g,LIST *s);
   void dpm_schreyer_base_zlist(LIST g,LIST *s);
   
 void Pdpm_schreyer_base(NODE arg,LIST *rp)  void Pdpm_schreyer_base(NODE arg,LIST *rp)
 {  {
   asir_assert(ARG0(arg),O_LIST,"dpm_schreyer_base");    asir_assert(ARG0(arg),O_LIST,"dpm_schreyer_base");
   dpm_schreyer_base((LIST)ARG0(arg),rp);    dpm_schreyer_base_zlist((LIST)ARG0(arg),rp);
 }  }
   
   void dpm_list_to_array(LIST g,VECT *psv,VECT *psiv);
   
   void Pdpm_list_to_array(NODE arg,LIST *rp)
   {
     VECT psv,psiv;
     NODE nd;
   
     asir_assert(ARG0(arg),O_LIST,"dpm_list_to_array");
     dpm_list_to_array((LIST)ARG0(arg),&psv,&psiv);
     nd = mknode(2,psv,psiv);
     MKLIST(*rp,nd);
   }
   
   /* [quo,nf] = dpm_sp_nf(psv,psiv,i,j,top) */
   DPM dpm_sp_nf_zlist(VECT psv,VECT psiv,int i,int j,int top,DPM *nf);
   
   void Pdpm_sp_nf(NODE arg,LIST *rp)
   {
     VECT psv,psiv;
     DPM quo,nf;
     Obj val;
     int i,j,top;
     NODE nd;
   
     asir_assert(ARG0(arg),O_VECT,"dpm_sp_nf"); psv = (VECT)ARG0(arg);
     asir_assert(ARG1(arg),O_VECT,"dpm_sp_nf"); psiv = (VECT)ARG1(arg);
     asir_assert(ARG2(arg),O_N,"dpm_sp_nf"); i = ZTOS((Q)ARG2(arg));
     asir_assert(ARG3(arg),O_N,"dpm_sp_nf"); j = ZTOS((Q)ARG3(arg));
     if ( get_opt("top",&val) && val )
       top = 1;
     else
       top = 0;
     quo = dpm_sp_nf_zlist(psv,psiv,i,j,top,&nf);
     nd = mknode(2,quo,nf);
     MKLIST(*rp,nd);
   }
   
   void dpm_insert_to_zlist(VECT psiv,int pos,int i);
   
   /* insert_to_zlist(indarray,dpm_hp(f),i) */
   void Pdpm_insert_to_zlist(NODE arg,VECT *rp)
   {
     VECT psiv;
     int i,pos;
   
     asir_assert(ARG0(arg),O_VECT,"dpm_insert_to_zlist"); psiv = (VECT)ARG0(arg);
     asir_assert(ARG1(arg),O_N,"dpm_insert_to_zlist"); pos = ZTOS((Q)ARG1(arg));
     asir_assert(ARG2(arg),O_N,"dpm_insert_to_zlist"); i = ZTOS((Q)ARG2(arg));
     dpm_insert_to_zlist(psiv,pos,i);
     *rp = psiv;
   }
   
   
 void dpm_simplify_syz(LIST m,LIST s,LIST *m1,LIST *s1,LIST *w1);  void dpm_simplify_syz(LIST m,LIST s,LIST *m1,LIST *s1,LIST *w1);
   
 void Pdpm_simplify_syz(NODE arg,LIST *rp)  void Pdpm_simplify_syz(NODE arg,LIST *rp)
Line 4019  void Pdpm_set_schreyer_level(NODE arg,Q *rp)
Line 4093  void Pdpm_set_schreyer_level(NODE arg,Q *rp)
   *rp = (Q)ARG0(arg);    *rp = (Q)ARG0(arg);
 }  }
   
   DPM dmmtodpm(DMM d)
   {
   }
   
 void Pdpm_schreyer_frame(NODE arg,LIST *rp)  void Pdpm_schreyer_frame(NODE arg,LIST *rp)
 {  {
   DMMstack_array a;    DMMstack_array a;
   DMMstack *body;    DMMstack *body;
   NODE b,b1;    DMM *in,*sum;
     DPM f,s;
     NODE b,b1,nd;
   LIST l;    LIST l;
   int len,i;    VECT v;
     Z lev,deg,ind;
     int len,i,nv,rank,j;
   
   Schreyer_Frame = a = dpm_schreyer_frame(BDY((LIST)ARG0(arg)));    Schreyer_Frame = a = dpm_schreyer_frame(BDY((LIST)ARG0(arg)));
   len = a->len;    len = a->len;
   body = a->body;    body = a->body;
     /* XXX */
     nv = ((DPM)BDY(BDY((LIST)body[0]->obj)))->nv;
   b = 0;    b = 0;
   for ( i = 0; i < len; i++ ) {    for ( i = 0; i < len; i++ ) {
     MKNODE(b1,(pointer)body[i]->obj,b);      rank = body[i]->rank;
       in = body[i]->in;
       sum = body[i]->sum;
       MKVECT(v,rank+1);
       STOZ(i+1,lev);
       for ( j = 1; j <= rank; j++ ) {
         MKDPM(nv,in[j],f); f->sugar = in[j]->dl->td;
         MKDPM(nv,sum[j],s);s->sugar = sum[j]->dl->td;
         STOZ(s->sugar,deg);
         STOZ(j,ind);
         nd = mknode(5,f,s,ind,lev,deg);
         MKLIST(l,nd);
         BDY(v)[j] = (pointer)l;
       }
       MKNODE(b1,(pointer)v,b);
     b = b1;      b = b1;
   }    }
   MKLIST(l,b);    MKLIST(l,b);
Line 4098  void Pdpm_sort(NODE arg,DPM *rp)
Line 4196  void Pdpm_sort(NODE arg,DPM *rp)
   
   p = (DPM)ARG0(arg);    p = (DPM)ARG0(arg);
   if ( !p ) *rp = 0;    if ( !p ) *rp = 0;
   dpm_sort(p,rp);    else dpm_sort(p,rp);
 }  }
   
 void dpm_split(DPM p,int s,DPM *up,DPM *lo);  void dpm_split(DPM p,int s,DPM *up,DPM *lo);
   void dpm_extract(DPM p,int s,DP *r);
   
 void Pdpm_split(NODE arg,LIST *rp)  void Pdpm_split(NODE arg,LIST *rp)
 {  {
Line 4114  void Pdpm_split(NODE arg,LIST *rp)
Line 4213  void Pdpm_split(NODE arg,LIST *rp)
   dpm_split(p,s,&up,&lo);    dpm_split(p,s,&up,&lo);
   nd = mknode(2,up,lo);    nd = mknode(2,up,lo);
   MKLIST(*rp,nd);    MKLIST(*rp,nd);
   }
   
   void Pdpm_extract(NODE arg,DP *rp)
   {
     DPM p;
     int s;
   
     p = (DPM)ARG0(arg);
     s = ZTOS((Z)ARG1(arg));
     dpm_extract(p,s,rp);
 }  }
   
   

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.21

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