[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.184 and 1.189

version 1.184, 2010/04/16 07:13:42 version 1.189, 2010/05/06 09:22:09
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.183 2010/02/22 05:27:53 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.188 2010/04/26 01:10:04 noro Exp $ */
   
 #include "nd.h"  #include "nd.h"
   
Line 50  static int nd_module,nd_ispot,nd_mpos,nd_pot_nelim;
Line 50  static int nd_module,nd_ispot,nd_mpos,nd_pot_nelim;
 static NODE nd_tracelist;  static NODE nd_tracelist;
 static NODE nd_alltracelist;  static NODE nd_alltracelist;
 static int nd_gentrace,nd_gensyz,nd_nora;  static int nd_gentrace,nd_gensyz,nd_nora;
   static int *nd_gbblock;
   
 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 2300  ND_pairs nd_newpairs( NODE g, int t )
Line 2301  ND_pairs nd_newpairs( NODE g, int t )
 {  {
     NODE h;      NODE h;
     UINT *dl;      UINT *dl;
     int ts,s;      int ts,s,i,t0,min,max;
     ND_pairs r,r0;      ND_pairs r,r0;
   
     dl = DL(nd_psh[t]);      dl = DL(nd_psh[t]);
Line 2308  ND_pairs nd_newpairs( NODE g, int t )
Line 2309  ND_pairs nd_newpairs( NODE g, int t )
     for ( r0 = 0, h = g; h; h = NEXT(h) ) {      for ( r0 = 0, h = g; h; h = NEXT(h) ) {
         if ( nd_module && (MPOS(DL(nd_psh[(long)BDY(h)])) != MPOS(dl)) )          if ( nd_module && (MPOS(DL(nd_psh[(long)BDY(h)])) != MPOS(dl)) )
                 continue;                  continue;
                   if ( nd_gbblock ) {
                           t0 = (long)BDY(h);
                           for ( i = 0; nd_gbblock[i] >= 0; i += 2 ) {
                                   min = nd_gbblock[i]; max = nd_gbblock[i+1];
                                   if ( t0 >= min && t0 <= max && t >= min && t <= max )
                                           break;
                           }
                           if ( nd_gbblock[i] >= 0 )
                                   continue;
                   }
         NEXTND_pairs(r0,r);          NEXTND_pairs(r0,r);
         r->i1 = (long)BDY(h);          r->i1 = (long)BDY(h);
         r->i2 = t;          r->i2 = t;
Line 2894  void nd_gr(LIST f,LIST v,int m,int homo,int f4,struct 
Line 2905  void nd_gr(LIST f,LIST v,int m,int homo,int f4,struct 
             ndv_homogenize((NDV)BDY(t),obpe,oadv,oepos,ompos);              ndv_homogenize((NDV)BDY(t),obpe,oadv,oepos,ompos);
     }      }
   
     ndv_setup(m,0,fd0,0,0);      ndv_setup(m,0,fd0,nd_gbblock?1:0,0);
     if ( nd_gentrace ) {      if ( nd_gentrace ) {
         MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0);          MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0);
     }      }
     x = f4?nd_f4(m,&perm):nd_gb(m,ishomo,0,0,&perm);      x = f4?nd_f4(m,&perm):nd_gb(m,ishomo || homo,0,0,&perm);
         if ( !ishomo && homo ) {          if ( !ishomo && homo ) {
                 /* dehomogenization */                  /* dehomogenization */
                 for ( t = x; t; t = NEXT(t) ) ndv_dehomogenize((NDV)BDY(t),ord);                  for ( t = x; t; t = NEXT(t) ) ndv_dehomogenize((NDV)BDY(t),ord);
Line 3161  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
Line 3172  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
                 tl1 = tl2 = tl3 = tl4 = 0;                  tl1 = tl2 = tl3 = tl4 = 0;
         if ( Demand )          if ( Demand )
             nd_demand = 1;              nd_demand = 1;
         ret = ndv_setup(m,1,fd0,0,0);          ret = ndv_setup(m,1,fd0,nd_gbblock?1:0,0);
         if ( nd_gentrace ) {          if ( nd_gentrace ) {
             MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0);              MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0);
         }          }
Line 6936  void conv_ilist(int demand,int trace,NODE g,int **indp
Line 6947  void conv_ilist(int demand,int trace,NODE g,int **indp
   
 void parse_nd_option(NODE opt)  void parse_nd_option(NODE opt)
 {  {
     NODE t,p;      NODE t,p,u;
           int i,s;
     char *key;      char *key;
     Obj value;      Obj value;
   
     nd_gentrace = 0; nd_gensyz = 0; nd_nora = 0;      nd_gentrace = 0; nd_gensyz = 0; nd_nora = 0; nd_gbblock = 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));
         key = BDY((STRING)BDY(p));          key = BDY((STRING)BDY(p));
Line 6951  void parse_nd_option(NODE opt)
Line 6963  void parse_nd_option(NODE opt)
             nd_gensyz = value?1:0;              nd_gensyz = value?1:0;
         else if ( !strcmp(key,"nora") )          else if ( !strcmp(key,"nora") )
             nd_nora = value?1:0;              nd_nora = value?1:0;
           else if ( !strcmp(key,"gbblock") ) {
                           if ( !value || OID(value) != O_LIST )
                                   error("nd_* : invalid value for gbblock option");
                           u = BDY((LIST)value);
               nd_gbblock = MALLOC((2*length(u)+1)*sizeof(int));
                           for ( i = 0; u; u = NEXT(u) ) {
                                   p = BDY((LIST)BDY(u));
                                   s = nd_gbblock[i++] = QTOS((Q)BDY(p));
                                   nd_gbblock[i++] = s+QTOS((Q)BDY(NEXT(p)))-1;
                           }
                           nd_gbblock[i] = -1;
                   }
     }      }
 }  }

Legend:
Removed from v.1.184  
changed lines
  Added in v.1.189

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