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

Diff for /OpenXM_contrib2/asir2018/engine/nd.c between version 1.51 and 1.53

version 1.51, 2021/03/09 07:07:02 version 1.53, 2021/03/12 01:18:33
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.50 2021/03/09 05:20:35 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.52 2021/03/09 08:48:50 noro Exp $ */
   
 #include "nd.h"  #include "nd.h"
   
Line 2623  init_eg(&eg_update);
Line 2623  init_eg(&eg_update);
   }    }
   sugar = 0;    sugar = 0;
   if ( nd_hpdata ) {    if ( nd_hpdata ) {
       if ( DP_Print ) fprintf(asir_out,"Hilbert driven algorithm.\n");
     setup_hpdata(&final_hpdata,&current_hpdata);      setup_hpdata(&final_hpdata,&current_hpdata);
   }    }
   while ( d ) {    while ( d ) {
Line 2647  again:
Line 2648  again:
         else {          else {
           final_hpvalue = hpvalue(&final_hpdata,sugar);            final_hpvalue = hpvalue(&final_hpdata,sugar);
           if ( final_hpvalue == hpvalue(&current_hpdata,sugar) ) {            if ( final_hpvalue == hpvalue(&current_hpdata,sugar) ) {
             if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar);  //            if ( DP_Print ) fprintf(asir_out,"done.\n",sugar);
             d = nd_remove_same_sugar(d,sugar);              d = nd_remove_same_sugar(d,sugar);
             continue;              continue;
           }            }
Line 2713  get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2);
Line 2714  get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2);
       if ( nd_hpdata ) {        if ( nd_hpdata ) {
         update_hpdata(&current_hpdata,nh,1);          update_hpdata(&current_hpdata,nh,1);
         if ( final_hpvalue == hpvalue(&current_hpdata,sugar) ) {          if ( final_hpvalue == hpvalue(&current_hpdata,sugar) ) {
           if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar);  //          if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar);
           d = nd_remove_same_sugar(d,sugar);            d = nd_remove_same_sugar(d,sugar);
         }          }
       }        }
Line 2753  int nd_nf_s(int mod,ND d,ND g,NDV *ps,int full,ND *nf)
Line 2754  int nd_nf_s(int mod,ND d,ND g,NDV *ps,int full,ND *nf)
 void _copydl(int n,DL d1,DL d2);  void _copydl(int n,DL d1,DL d2);
 void _subfromdl(int n,DL d1,DL d2);  void _subfromdl(int n,DL d1,DL d2);
 extern int (*cmpdl)(int n,DL d1,DL d2);  extern int (*cmpdl)(int n,DL d1,DL d2);
   int _dl_redble_ext(DL,DL,DL,int);
   
   int primitive_irred(ND p,SIG sig)
   {
     static int wpd=0,dlen=0;
     static DL dquo,squo;
     static UINT *quo;
     int i;
   
     if ( dlen < nd_nvar ) {
       NEWDL(dquo,nd_nvar);
       NEWDL(squo,nd_nvar);
       dlen = nd_nvar;
     }
     if ( wpd != nd_wpd ) {
       wpd = nd_wpd;
       quo = (UINT *)MALLOC(wpd*sizeof(UINT));
     }
     for ( i = 0; i < nd_psn; i++ ) {
       if ( sig->pos == nd_psh[i]->sig->pos &&
         _dl_redble_ext(DL(nd_psh[i]->sig),DL(sig),squo,nd_nvar) )
         if ( ndl_reducible(HDL(p),DL(nd_psh[i])) ) {
           if ( DP_Print ) fprintf(asir_out,"D");
           ndl_sub(HDL(p),DL(nd_psh[i]),quo);
           _ndltodl(quo,dquo);
           if ( _eqdl(nd_nvar,squo,dquo) )
             return 0;
         }
     }
     return 1;
   }
   
 NODE insert_sig(NODE l,SIG s)  NODE insert_sig(NODE l,SIG s)
 {  {
   int pos;    int pos;
Line 2806  ND_pairs remove_spair_s(ND_pairs d,SIG sig)
Line 2838  ND_pairs remove_spair_s(ND_pairs d,SIG sig)
   return (ND_pairs)root.next;    return (ND_pairs)root.next;
 }  }
   
 int _dl_redble_ext(DL,DL,DL,int);  
   
 int small_lcm(ND_pairs l)  int small_lcm(ND_pairs l)
 {  {
   SIG sig;    SIG sig;
Line 3049  init_eg(&eg_hpdata);
Line 3079  init_eg(&eg_hpdata);
 init_eg(&eg_sbabuch);  init_eg(&eg_sbabuch);
 get_eg(&eg3);  get_eg(&eg3);
   while ( 1 ) {    while ( 1 ) {
     if ( DP_Print && dlen%100 == 0 ) fprintf(asir_out,"(%d)",dlen);      if ( DP_Print && !nd_hpdata && dlen%1000 == 0 ) fprintf(asir_out,"(%d)",dlen);
 again :  again :
 get_eg(&eg1);  get_eg(&eg1);
     ind = nd_minsig(d);      ind = nd_minsig(d);
Line 3062  get_eg(&eg1);
Line 3092  get_eg(&eg1);
 get_eg(&eg2); add_eg(&eg_smallest,&eg1,&eg2);  get_eg(&eg2); add_eg(&eg_smallest,&eg1,&eg2);
     if ( l1 == 0 ) {      if ( l1 == 0 ) {
       d[ind] = d[ind]->next; dlen--;        d[ind] = d[ind]->next; dlen--;
       if ( DP_Print && !nd_hpdata ) fprintf(asir_out,"M");  //      if ( DP_Print && !nd_hpdata ) fprintf(asir_out,"M");
       Nnominimal++;        Nnominimal++;
       continue;        continue;
     }      }
Line 3119  get_eg(&eg2); 
Line 3149  get_eg(&eg2); 
       get_eg(&eg2); add_eg(&eg_removecont,&eg1,&eg2);        get_eg(&eg2); add_eg(&eg_removecont,&eg1,&eg2);
       nfv = ndtondv(m,nf); nd_free(nf);        nfv = ndtondv(m,nf); nd_free(nf);
       nh = ndv_newps(m,nfv,0);        nh = ndv_newps(m,nfv,0);
   
       get_eg(&eg1);        get_eg(&eg1);
       dlen += update_pairs_array_s(d,nh,syzlist);        dlen += update_pairs_array_s(d,nh,syzlist);
       get_eg(&eg2); add_eg(&eg_updatepairs,&eg1,&eg2);        get_eg(&eg2); add_eg(&eg_updatepairs,&eg1,&eg2);
Line 3130  get_eg(&eg2); 
Line 3160  get_eg(&eg2); 
         get_eg(&eg2); add_eg(&eg_hpdata,&eg1,&eg2);          get_eg(&eg2); add_eg(&eg_hpdata,&eg1,&eg2);
         if ( !compp(CO,final_hpdata.hn,current_hpdata.hn) ) {          if ( !compp(CO,final_hpdata.hn,current_hpdata.hn) ) {
           if ( DP_Print ) { printf("\nWe found a gb.\n"); }            if ( DP_Print ) { printf("\nWe found a gb.\n"); }
           break;              break;
         }          }
       }        }
    } else {     } else {
Line 3371  NODE nd_gb_trace(int m,int ishomo,int **indp)
Line 3401  NODE nd_gb_trace(int m,int ishomo,int **indp)
   }    }
   sugar = 0;    sugar = 0;
   if ( nd_hpdata ) {    if ( nd_hpdata ) {
       if ( DP_Print ) fprintf(asir_out,"Hilbert driven algorithm.\n");
     setup_hpdata(&final_hpdata,&current_hpdata);      setup_hpdata(&final_hpdata,&current_hpdata);
   }    }
   
Line 3400  again:
Line 3431  again:
         else {          else {
           final_hpvalue = hpvalue(&final_hpdata,sugar);            final_hpvalue = hpvalue(&final_hpdata,sugar);
           if ( final_hpvalue == hpvalue(&current_hpdata,sugar) ) {            if ( final_hpvalue == hpvalue(&current_hpdata,sugar) ) {
             if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar);  //            if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar);
             d = nd_remove_same_sugar(d,sugar);              d = nd_remove_same_sugar(d,sugar);
             continue;              continue;
           }            }
Line 3482  again:
Line 3513  again:
         if ( nd_hpdata ) {          if ( nd_hpdata ) {
           update_hpdata(&current_hpdata,nh,1);            update_hpdata(&current_hpdata,nh,1);
           if ( final_hpvalue == hpvalue(&current_hpdata,sugar) ) {            if ( final_hpvalue == hpvalue(&current_hpdata,sugar) ) {
             if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar);  //            if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar);
             d = nd_remove_same_sugar(d,sugar);              d = nd_remove_same_sugar(d,sugar);
           }            }
         }          }

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.53

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