[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.139 and 1.145

version 1.139, 2006/06/12 00:46:48 version 1.145, 2006/08/26 05:38:06
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.138 2006/06/11 11:41:15 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.144 2006/08/26 03:09:55 noro Exp $ */
   
 #include "nd.h"  #include "nd.h"
   
Line 1592  NODE nd_gb(int m,int ishomo,int checkonly)
Line 1592  NODE nd_gb(int m,int ishomo,int checkonly)
         NDV nfv;          NDV nfv;
         Q q,num,den;          Q q,num,den;
         union oNDC dn;          union oNDC dn;
           int diag_count = 0;
   
         g = 0; d = 0;          g = 0; d = 0;
         for ( i = 0; i < nd_psn; i++ ) {          for ( i = 0; i < nd_psn; i++ ) {
Line 1604  again:
Line 1605  again:
                 l = nd_minp(d,&d);                  l = nd_minp(d,&d);
                 if ( SG(l) != sugar ) {                  if ( SG(l) != sugar ) {
                         if ( ishomo ) {                          if ( ishomo ) {
                                   diag_count = 0;
                                 stat = do_diagonalize(sugar,m);                                  stat = do_diagonalize(sugar,m);
                                 if ( !stat ) {                                  if ( !stat ) {
                                         NEXT(l) = d; d = l;                                          NEXT(l) = d; d = l;
Line 1639  again:
Line 1641  again:
                         }                          }
                         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);
                           if ( !m && (ishomo && ++diag_count == diag_period) ) {
                                   diag_count = 0;
                                   stat = do_diagonalize(sugar,m);
                                   if ( !stat ) {
                                           NEXT(l) = d; d = l;
                                           d = nd_reconstruct(1,d);
                                           goto again;
                                   }
                           }
                         d = update_pairs(d,g,nh);                          d = update_pairs(d,g,nh);
                         g = update_base(g,nh);                          g = update_base(g,nh);
                         FREENDP(l);                          FREENDP(l);
Line 2365  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
Line 2376  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
         NDV b;          NDV b;
         int ishomo,nalg;          int ishomo,nalg;
         Alg alpha,dp;          Alg alpha,dp;
         P p;          P p,zp;
           Q dmy;
         LIST f1,f2;          LIST f1,f2;
         Obj obj;          Obj obj;
         NumberField nf;          NumberField nf;
Line 2411  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
Line 2423  void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe
         nd_setup_parameters(nvar,max);          nd_setup_parameters(nvar,max);
         ishomo = 1;          ishomo = 1;
         for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) {          for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) {
                 b = (pointer)ptondv(CO,vv,(P)BDY(t));                  ptozp((P)BDY(t),1,&dmy,&zp);
                   b = (pointer)ptondv(CO,vv,zp);
                 if ( ishomo )                  if ( ishomo )
                         ishomo = ishomo && ndv_ishomo(b);                          ishomo = ishomo && ndv_ishomo(b);
                 if ( m ) ndv_mod(m,b);                  if ( m ) ndv_mod(m,b);
Line 2444  void nd_gr_postproc(LIST f,LIST v,int m,struct order_s
Line 2457  void nd_gr_postproc(LIST f,LIST v,int m,struct order_s
         NDV b;          NDV b;
         int ishomo,nalg;          int ishomo,nalg;
         Alg alpha,dp;          Alg alpha,dp;
         P p;          P p,zp;
           Q dmy;
         LIST f1,f2;          LIST f1,f2;
         Obj obj;          Obj obj;
         NumberField nf;          NumberField nf;
Line 2484  void nd_gr_postproc(LIST f,LIST v,int m,struct order_s
Line 2498  void nd_gr_postproc(LIST f,LIST v,int m,struct order_s
         nd_setup_parameters(nvar,max);          nd_setup_parameters(nvar,max);
         ishomo = 1;          ishomo = 1;
         for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) {          for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) {
                 b = (pointer)ptondv(CO,vv,(P)BDY(t));                  ptozp((P)BDY(t),1,&dmy,&zp);
                   b = (pointer)ptondv(CO,vv,zp);
                 if ( ishomo )                  if ( ishomo )
                         ishomo = ishomo && ndv_ishomo(b);                          ishomo = ishomo && ndv_ishomo(b);
                 if ( m ) ndv_mod(m,b);                  if ( m ) ndv_mod(m,b);
Line 2523  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
Line 2538  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
         int m,nocheck,nvar,mindex,e,max;          int m,nocheck,nvar,mindex,e,max;
         NDV c;          NDV c;
         NMV a;          NMV a;
         P p;          P p,zp;
           Q dmy;
         EPOS oepos;          EPOS oepos;
         int obpe,oadv,wmax,i,len,cbpe,ishomo,nalg;          int obpe,oadv,wmax,i,len,cbpe,ishomo,nalg;
         Alg alpha,dp;          Alg alpha,dp;
Line 2532  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
Line 2548  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
         Obj obj;          Obj obj;
         NumberField nf;          NumberField nf;
         struct order_spec *ord1;          struct order_spec *ord1;
           struct oEGT eg_check,eg0,eg1;
   
         get_vars((Obj)f,&fv); pltovl(v,&vv);          get_vars((Obj)f,&fv); pltovl(v,&vv);
         for ( nvar = 0, tv = vv; tv; tv = NEXT(tv), nvar++ );          for ( nvar = 0, tv = vv; tv; tv = NEXT(tv), nvar++ );
Line 2578  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
Line 2595  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
         obpe = nd_bpe; oadv = nmv_adv; oepos = nd_epos;          obpe = nd_bpe; oadv = nmv_adv; oepos = nd_epos;
         ishomo = 1;          ishomo = 1;
         for ( in0 = 0, fd0 = 0, t = BDY(f); t; t = NEXT(t) ) {          for ( in0 = 0, fd0 = 0, t = BDY(f); t; t = NEXT(t) ) {
                 c = ptondv(CO,vv,(P)BDY(t));                  ptozp((P)BDY(t),1,&dmy,&zp);
                   c = (pointer)ptondv(CO,vv,zp);
                 if ( ishomo )                  if ( ishomo )
                         ishomo = ishomo && ndv_ishomo(c);                          ishomo = ishomo && ndv_ishomo(c);
                 if ( c ) {                  if ( c ) {
Line 2623  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
Line 2641  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
                 cbpe = nd_bpe;                  cbpe = nd_bpe;
                 if ( nocheck )                  if ( nocheck )
                         break;                          break;
                   get_eg(&eg0);
                 if ( ndv_check_candidate(in0,obpe,oadv,oepos,cand) )                  if ( ndv_check_candidate(in0,obpe,oadv,oepos,cand) )
                         /* success */                          /* success */
                         break;                          break;
Line 2642  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
Line 2661  void nd_gr_trace(LIST f,LIST v,int trace,int homo,int 
                         }                          }
                 }                  }
         }          }
           get_eg(&eg1); init_eg(&eg_check); add_eg(&eg_check,&eg0,&eg1);
           if ( DP_Print )
                   fprintf(asir_out,"check=%fsec\n",eg_check.exectime+eg_check.gctime);
         /* dp->p */          /* dp->p */
         nd_bpe = cbpe;          nd_bpe = cbpe;
         nd_setup_parameters(nd_nvar,0);          nd_setup_parameters(nd_nvar,0);

Legend:
Removed from v.1.139  
changed lines
  Added in v.1.145

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