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

Diff for /OpenXM_contrib2/asir2000/engine/nd.c between version 1.159 and 1.161

version 1.159, 2009/01/05 00:52:20 version 1.161, 2009/01/05 02:08:18
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.158 2009/01/04 10:02:00 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.160 2009/01/05 01:47:30 noro Exp $ */
   
 #include "nd.h"  #include "nd.h"
   
Line 46  static int nd_worb_len;
Line 46  static int nd_worb_len;
 static int nd_found,nd_create,nd_notfirst;  static int nd_found,nd_create,nd_notfirst;
 static int nmv_adv;  static int nmv_adv;
 static int nd_demand;  static int nd_demand;
 static int nd_module,nd_istop,nd_mpos;  static int nd_module,nd_ispot,nd_mpos;
   
 NumberField get_numberfield();  NumberField get_numberfield();
 UINT *nd_det_compute_bound(NDV **dm,int n,int j);  UINT *nd_det_compute_bound(NDV **dm,int n,int j);
Line 399  int ndl_weight(UINT *d)
Line 399  int ndl_weight(UINT *d)
             for ( j = 0; j < nd_epw; j++, u>>=nd_bpe )              for ( j = 0; j < nd_epw; j++, u>>=nd_bpe )
                 t += (u&nd_mask0);                  t += (u&nd_mask0);
         }          }
           if ( nd_module && current_module_weight_vector && MPOS(d) )
                   t += current_module_weight_vector[MPOS(d)];
     return t;      return t;
 }  }
   
Line 568  int ndl_module_grlex_compare(UINT *d1,UINT *d2)
Line 570  int ndl_module_grlex_compare(UINT *d1,UINT *d2)
 {  {
     int i;      int i;
   
     if ( nd_istop ) {      if ( nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
Line 577  int ndl_module_grlex_compare(UINT *d1,UINT *d2)
Line 579  int ndl_module_grlex_compare(UINT *d1,UINT *d2)
     for ( i = nd_nvar-1; i >= 0; i-- )      for ( i = nd_nvar-1; i >= 0; i-- )
         if ( GET_EXP(d1,i) < GET_EXP(d2,i) ) return 1;          if ( GET_EXP(d1,i) < GET_EXP(d2,i) ) return 1;
         else if ( GET_EXP(d1,i) > GET_EXP(d2,i) ) return -1;          else if ( GET_EXP(d1,i) > GET_EXP(d2,i) ) return -1;
     if ( !nd_istop ) {      if ( !nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
Line 588  int ndl_module_glex_compare(UINT *d1,UINT *d2)
Line 590  int ndl_module_glex_compare(UINT *d1,UINT *d2)
 {  {
     int i;      int i;
   
     if ( nd_istop ) {      if ( nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
Line 597  int ndl_module_glex_compare(UINT *d1,UINT *d2)
Line 599  int ndl_module_glex_compare(UINT *d1,UINT *d2)
     for ( i = 0; i < nd_nvar; i++ )      for ( i = 0; i < nd_nvar; i++ )
         if ( GET_EXP(d1,i) > GET_EXP(d2,i) ) return 1;          if ( GET_EXP(d1,i) > GET_EXP(d2,i) ) return 1;
         else if ( GET_EXP(d1,i) < GET_EXP(d2,i) ) return -1;          else if ( GET_EXP(d1,i) < GET_EXP(d2,i) ) return -1;
     if ( !nd_istop ) {      if ( !nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
Line 608  int ndl_module_lex_compare(UINT *d1,UINT *d2)
Line 610  int ndl_module_lex_compare(UINT *d1,UINT *d2)
 {  {
     int i;      int i;
   
     if ( nd_istop ) {      if ( nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
     for ( i = 0; i < nd_nvar; i++ )      for ( i = 0; i < nd_nvar; i++ )
         if ( GET_EXP(d1,i) > GET_EXP(d2,i) ) return 1;          if ( GET_EXP(d1,i) > GET_EXP(d2,i) ) return 1;
         else if ( GET_EXP(d1,i) < GET_EXP(d2,i) ) return -1;          else if ( GET_EXP(d1,i) < GET_EXP(d2,i) ) return -1;
     if ( !nd_istop ) {      if ( !nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
Line 626  int ndl_module_block_compare(UINT *d1,UINT *d2)
Line 628  int ndl_module_block_compare(UINT *d1,UINT *d2)
 {  {
     int i,c;      int i,c;
   
     if ( nd_istop ) {      if ( nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
     if ( c = ndl_block_compare(d1,d2) ) return c;      if ( c = ndl_block_compare(d1,d2) ) return c;
     if ( !nd_istop ) {      if ( !nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
Line 642  int ndl_module_matrix_compare(UINT *d1,UINT *d2)
Line 644  int ndl_module_matrix_compare(UINT *d1,UINT *d2)
 {  {
     int i,c;      int i,c;
   
     if ( nd_istop ) {      if ( nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
     if ( c = ndl_matrix_compare(d1,d2) ) return c;      if ( c = ndl_matrix_compare(d1,d2) ) return c;
     if ( !nd_istop ) {      if ( !nd_ispot ) {
         if ( MPOS(d1) < MPOS(d2) ) return 1;          if ( MPOS(d1) < MPOS(d2) ) return 1;
         else if ( MPOS(d1) > MPOS(d2) ) return -1;          else if ( MPOS(d1) > MPOS(d2) ) return -1;
     }      }
Line 658  int ndl_module_composite_compare(UINT *d1,UINT *d2)
Line 660  int ndl_module_composite_compare(UINT *d1,UINT *d2)
 {  {
     int i,c;      int i,c;
   
     if ( nd_istop ) {      if ( nd_ispot ) {
         if ( MPOS(d1) > MPOS(d2) ) return 1;          if ( MPOS(d1) > MPOS(d2) ) return 1;
         else if ( MPOS(d1) < MPOS(d2) ) return -1;          else if ( MPOS(d1) < MPOS(d2) ) return -1;
     }      }
     if ( c = ndl_composite_compare(d1,d2) ) return c;      if ( c = ndl_composite_compare(d1,d2) ) return c;
     if ( !nd_istop ) {      if ( !nd_ispot ) {
         if ( MPOS(d1) > MPOS(d2) ) return 1;          if ( MPOS(d1) > MPOS(d2) ) return 1;
         else if ( MPOS(d1) < MPOS(d2) ) return -1;          else if ( MPOS(d1) < MPOS(d2) ) return -1;
     }      }
Line 4453  void nd_init_ord(struct order_spec *ord)
Line 4455  void nd_init_ord(struct order_spec *ord)
   
         /* module order */          /* module order */
         case 256:          case 256:
             nd_istop = ord->istop;              nd_ispot = ord->ispot;
             nd_dcomp = -1;              nd_dcomp = -1;
             nd_isrlex = 0;              nd_isrlex = 0;
             switch ( ord->ord.simple ) {              switch ( ord->ord.simple ) {

Legend:
Removed from v.1.159  
changed lines
  Added in v.1.161

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