[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.60 and 1.63

version 1.60, 2021/12/17 23:53:13 version 1.63, 2022/01/13 08:15:02
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.59 2021/12/14 01:02:40 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.62 2021/12/19 08:23:28 noro Exp $ */
   
 #include "nd.h"  #include "nd.h"
   
Line 70  static NODE nd_tracelist;
Line 70  static NODE nd_tracelist;
 static NODE nd_alltracelist;  static NODE nd_alltracelist;
 static int nd_gentrace,nd_gensyz,nd_nora,nd_newelim,nd_intersect,nd_lf,nd_norb;  static int nd_gentrace,nd_gensyz,nd_nora,nd_newelim,nd_intersect,nd_lf,nd_norb;
 static int nd_f4_td,nd_sba_f4step,nd_sba_pot,nd_sba_largelcm,nd_sba_dontsort,nd_sba_redundant_check;  static int nd_f4_td,nd_sba_f4step,nd_sba_pot,nd_sba_largelcm,nd_sba_dontsort,nd_sba_redundant_check;
 static int nd_top,nd_sba_syz,nd_sba_inputisgb;  static int nd_top,nd_sba_syz,nd_sba_inputisgb,nd_sba_heu;
 static int *nd_gbblock;  static int *nd_gbblock;
 static NODE nd_nzlist,nd_check_splist;  static NODE nd_nzlist,nd_check_splist;
 static int nd_splist;  static int nd_splist;
Line 2588  ND_pairs nd_remove_same_sugar( ND_pairs d, int sugar)
Line 2588  ND_pairs nd_remove_same_sugar( ND_pairs d, int sugar)
 {  {
   struct oND_pairs root;    struct oND_pairs root;
   ND_pairs prev,cur;    ND_pairs prev,cur;
     int i;
   
   root.next = d;    root.next = d;
   prev = &root; cur = d;    prev = &root; cur = d;
     i = 0;
   while ( cur ) {    while ( cur ) {
     if ( SG(cur) == sugar )      if ( SG(cur) == sugar ) {
       prev->next = cur->next;        prev->next = cur->next;
     else        i++;
       } else
       prev = cur;        prev = cur;
     cur = cur->next;      cur = cur->next;
   }    }
     if ( DP_Print && i ) fprintf(asir_out,"[%d]",i);
   return root.next;    return root.next;
 }  }
   
Line 2713  get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2);
Line 2717  get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2);
         update_hpdata(&current_hpdata,nh);          update_hpdata(&current_hpdata,nh);
         dg = comp_hn(final_hpdata.hn,current_hpdata.hn);          dg = comp_hn(final_hpdata.hn,current_hpdata.hn);
         if ( dg < 0 ) {          if ( dg < 0 ) {
            fprintf(asir_out,"We found a gb\n");             int d_len;
            d = 0;             for ( d_len = 0; d; d = d->next, d_len++);
              fprintf(asir_out,"[%d] We found a gb\n",d_len);
         }          }
         sugar0 = sugar;          sugar0 = sugar;
         while ( d && dg > sugar0 ) {          while ( d && dg > sugar0 ) {
           if ( DP_Print ) { fprintf(asir_out,"[%d]",sugar0); fflush(asir_out); }  
           d = nd_remove_same_sugar(d,sugar0);            d = nd_remove_same_sugar(d,sugar0);
           sugar0++;            sugar0++;
         }          }
Line 3167  get_eg(&eg2); 
Line 3171  get_eg(&eg2); 
        get_eg(&eg2); add_eg(&eg_updatepairs,&eg1,&eg2);         get_eg(&eg2); add_eg(&eg_updatepairs,&eg1,&eg2);
        nd_sba_pos[sig->pos] = append_one(nd_sba_pos[sig->pos],nh);         nd_sba_pos[sig->pos] = append_one(nd_sba_pos[sig->pos],nh);
        if ( nd_hpdata ) {         if ( nd_hpdata ) {
            int dg,sugar0;
   
          get_eg(&eg1);           get_eg(&eg1);
          update_hpdata(&current_hpdata,nh);           update_hpdata(&current_hpdata,nh);
          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) ) {           dg = comp_hn(final_hpdata.hn,current_hpdata.hn);
   //         if ( !compp(CO,final_hpdata.hn,current_hpdata.hn) )
            if ( dg < 0 ) {
            if ( DP_Print ) { printf("\nWe found a gb.\n"); }             if ( DP_Print ) { printf("\nWe found a gb.\n"); }
              break;               break;
          }           } else if ( nd_sba_heu == 1 ) {
              for ( i = 0; i < ngen; i++ ) {
                sugar0 = sugar;
                while ( d[i] && dg > sugar0 ) {
                  d[i] = nd_remove_same_sugar(d[i],sugar0);
                  sugar0++;
                }
             }
           }
       }        }
    } else {     } else {
       d[ind] = d[ind]->next; dlen--;        d[ind] = d[ind]->next; dlen--;
Line 3193  get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2);
Line 3209  get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2);
  g = conv_ilist_s(nd_demand,0,indp);   g = conv_ilist_s(nd_demand,0,indp);
  if ( DP_Print ) {   if ( DP_Print ) {
    printf("\ndlen=%d,nd_sba done. nd_add=%d,Nsyz=%d,Nsamesig=%d,Nnominimal=%d\n",dlen,Nnd_add,Nsyz,Nsamesig,Nnominimal);     printf("\ndlen=%d,nd_sba done. nd_add=%d,Nsyz=%d,Nsamesig=%d,Nnominimal=%d\n",dlen,Nnd_add,Nsyz,Nsamesig,Nnominimal);
    printf("Nbase=%d,Nnfnz=%d,Nnfz=%d,Nnfsingular=%d\n",Nnfnz,Nnfz,Nnfs,nd_psn);     printf("Nbase=%d,Nnfnz=%d,Nnfz=%d,Nnfsingular=%d\n",nd_psn,Nnfnz,Nnfz,Nnfs);
    fflush(stdout);     fflush(stdout);
    if ( nd_sba_redundant_check )     if ( nd_sba_redundant_check )
    printf("Nredundant=%d\n",Nredundant);     printf("Nredundant=%d\n",Nredundant);
Line 3516  again:
Line 3532  again:
           update_hpdata(&current_hpdata,nh);            update_hpdata(&current_hpdata,nh);
           dg = comp_hn(final_hpdata.hn,current_hpdata.hn);            dg = comp_hn(final_hpdata.hn,current_hpdata.hn);
           if ( dg < 0 ) {            if ( dg < 0 ) {
              fprintf(asir_out,"We found a gb\n");               int d_len;
              d = 0;               for ( d_len = 0; d; d = d->next, d_len++);
                fprintf(asir_out,"[%d] We found a gb\n",d_len);
           }            }
           sugar0 = sugar;            sugar0 = sugar;
           while ( d && dg > sugar0 ) {            while ( d && dg > sugar0 ) {
             if ( DP_Print ) { fprintf(asir_out,"[%d]",sugar0); fflush(asir_out); }  
             d = nd_remove_same_sugar(d,sugar0);              d = nd_remove_same_sugar(d,sugar0);
             sugar0++;              sugar0++;
           }            }
Line 10666  void parse_nd_option(VL vl,NODE opt)
Line 10682  void parse_nd_option(VL vl,NODE opt)
   nd_f4_td = 0; nd_sba_f4step = 2; nd_sba_pot = 0; nd_sba_largelcm = 0;    nd_f4_td = 0; nd_sba_f4step = 2; nd_sba_pot = 0; nd_sba_largelcm = 0;
   nd_sba_dontsort = 0; nd_top = 0; nd_sba_redundant_check = 0;    nd_sba_dontsort = 0; nd_top = 0; nd_sba_redundant_check = 0;
   nd_sba_syz = 0; nd_sba_modord = 0; nd_sba_inputisgb = 0;    nd_sba_syz = 0; nd_sba_modord = 0; nd_sba_inputisgb = 0;
   nd_hpdata = 0;    nd_hpdata = 0; nd_sba_heu = 0;
   
   for ( t = opt; t; t = NEXT(t) ) {    for ( t = opt; t; t = NEXT(t) ) {
     p = BDY((LIST)BDY(t));      p = BDY((LIST)BDY(t));
Line 10735  void parse_nd_option(VL vl,NODE opt)
Line 10751  void parse_nd_option(VL vl,NODE opt)
       nd_sba_dontsort = value?1:0;        nd_sba_dontsort = value?1:0;
     } else if ( !strcmp(key,"sba_syz") ) {      } else if ( !strcmp(key,"sba_syz") ) {
       nd_sba_syz = value?1:0;        nd_sba_syz = value?1:0;
       } else if ( !strcmp(key,"sba_heu") ) {
         nd_sba_heu = value?1:0;
     } else if ( !strcmp(key,"sba_modord") ) {      } else if ( !strcmp(key,"sba_modord") ) {
       // value=[vlist,ordspec,weight]        // value=[vlist,ordspec,weight]
       u = BDY((LIST)value);        u = BDY((LIST)value);

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.63

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