[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.169 and 1.170

version 1.169, 2009/02/10 06:33:08 version 1.170, 2009/02/11 03:04:42
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.168 2009/02/09 10:21:29 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.169 2009/02/10 06:33:08 noro Exp $ */
   
 #include "nd.h"  #include "nd.h"
   
Line 1476  int nd_nf_pbucket(int mod,ND g,NDV *ps,int full,ND *rp
Line 1476  int nd_nf_pbucket(int mod,ND g,NDV *ps,int full,ND *rp
   
 /* input : list of NDV, cand : list of NDV */  /* input : list of NDV, cand : list of NDV */
   
 int ndv_check_candidate(NODE input,int obpe,int oadv,EPOS oepos,NODE cand)  int ndv_check_membership(int m,NODE input,int obpe,int oadv,EPOS oepos,NODE cand)
 {  {
     int n,i,stat;      int n,i,stat;
     ND nf,d;      ND nf,d;
Line 1486  int ndv_check_candidate(NODE input,int obpe,int oadv,E
Line 1486  int ndv_check_candidate(NODE input,int obpe,int oadv,E
     Q q;      Q q;
     LIST list;      LIST list;
   
     ndv_setup(0,0,cand,GenTrace?1:0,1);      ndv_setup(m,0,cand,GenTrace?1:0,1);
     n = length(cand);      n = length(cand);
   
         if ( GenTrace ) { nd_alltracelist = 0; nd_tracelist = 0; }          if ( GenTrace ) { nd_alltracelist = 0; nd_tracelist = 0; }
Line 2785  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
Line 2785  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
     Obj obj;      Obj obj;
     NumberField nf;      NumberField nf;
     struct order_spec *ord1;      struct order_spec *ord1;
     NODE tr,tl1,tl2;      NODE tr,tl1,tl2,tl3,tl4;
     LIST l1,l2,l3;      LIST l1,l2,l3,l4,l5;
         int j;          int j;
         Q jq;          Q jq;
     int *perm;      int *perm;
       EPOS oepos;
       int obpe,oadv,ompos;
   
     nd_module = 0;      nd_module = 0;
     if ( !m && Demand ) nd_demand = 1;      if ( !m && Demand ) nd_demand = 1;
Line 2843  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
Line 2845  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
             }              }
         }          }
     nd_setup_parameters(nvar,max);      nd_setup_parameters(nvar,max);
       obpe = nd_bpe; oadv = nmv_adv; oepos = nd_epos; ompos = nd_mpos;
     ishomo = 1;      ishomo = 1;
     for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) {      for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) {
         if ( nd_module ) {          if ( nd_module ) {
Line 2869  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
Line 2872  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
     x = ndv_reducebase(x,perm);      x = ndv_reducebase(x,perm);
     if ( GenTrace ) { tl1 = nd_alltracelist; nd_alltracelist = 0; }      if ( GenTrace ) { tl1 = nd_alltracelist; nd_alltracelist = 0; }
     x = ndv_reduceall(m,x);      x = ndv_reduceall(m,x);
       if ( GenTrace ) {
           tl2 = nd_alltracelist; nd_alltracelist = 0;
           ndv_check_membership(m,fd0,obpe,oadv,oepos,x);
           if ( GenTrace ) {
               tl3 = nd_alltracelist; nd_alltracelist = 0;
           } else tl3 = 0;
           nd_gb(m,0,1,GenSyz?1:0,0)!=0;
           if ( GenTrace && GenSyz ) {
               tl4 = nd_alltracelist; nd_alltracelist = 0;
           } else tl4 = 0;
       }
     for ( r0 = 0, t = x; t; t = NEXT(t) ) {      for ( r0 = 0, t = x; t; t = NEXT(t) ) {
         NEXTNODE(r0,r);          NEXTNODE(r0,r);
     if ( nd_module ) BDY(r) = ndvtopl(m,CO,vv,BDY(t),mrank);      if ( nd_module ) BDY(r) = ndvtopl(m,CO,vv,BDY(t),mrank);
Line 2879  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
Line 2893  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
         r0 = postprocess_algcoef(av,alist,r0);          r0 = postprocess_algcoef(av,alist,r0);
     MKLIST(*rp,r0);      MKLIST(*rp,r0);
     if ( GenTrace ) {      if ( GenTrace ) {
         tl2 = nd_alltracelist; nd_alltracelist = 0;  
         tl1 = reverse_node(tl1); tl2 = reverse_node(tl2);          tl1 = reverse_node(tl1); tl2 = reverse_node(tl2);
           tl3 = reverse_node(tl3);
                 /* tl2 = [[i,[[*,j,*,*],...]],...] */                  /* tl2 = [[i,[[*,j,*,*],...]],...] */
         for ( t = tl2; t; t = NEXT(t) ) {          for ( t = tl2; t; t = NEXT(t) ) {
                         /* s = [i,[*,j,*,*],...] */                          /* s = [i,[*,j,*,*],...] */
Line 2894  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
Line 2908  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
                 for ( j = length(x)-1, t = 0; j >= 0; j-- ) {                  for ( j = length(x)-1, t = 0; j >= 0; j-- ) {
                     STOQ(perm[j],jq); MKNODE(s,jq,t); t = s;                      STOQ(perm[j],jq); MKNODE(s,jq,t); t = s;
                 }                  }
         MKLIST(l1,tl1); MKLIST(l2,tl2); MKLIST(l3,t);         MKLIST(l1,tl1); MKLIST(l2,tl2); MKLIST(l3,t); MKLIST(l4,tl3);
         tr = mknode(5,*rp,0,l1,l2,l3); MKLIST(*rp,tr);         MKLIST(l5,tl4);
         tr = mknode(7,*rp,0,l1,l2,l3,l4,l5); MKLIST(*rp,tr);
     }      }
 #if 0  #if 0
     fprintf(asir_out,"ndv_alloc=%d\n",ndv_alloc);      fprintf(asir_out,"ndv_alloc=%d\n",ndv_alloc);
Line 3128  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
Line 3143  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
         if ( nocheck )          if ( nocheck )
             break;              break;
         get_eg(&eg0);          get_eg(&eg0);
         if ( ret = ndv_check_candidate(in0,obpe,oadv,oepos,cand) ) {          if ( ret = ndv_check_membership(0,in0,obpe,oadv,oepos,cand) ) {
             if ( GenTrace ) {              if ( GenTrace ) {
                             tl3 = nd_alltracelist; nd_alltracelist = 0;                              tl3 = nd_alltracelist; nd_alltracelist = 0;
                     } else tl3 = 0;                      } else tl3 = 0;

Legend:
Removed from v.1.169  
changed lines
  Added in v.1.170

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