=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.c,v retrieving revision 1.129 retrieving revision 1.132 diff -u -p -r1.129 -r1.132 --- OpenXM_contrib2/asir2000/engine/nd.c 2006/04/17 04:35:20 1.129 +++ OpenXM_contrib2/asir2000/engine/nd.c 2006/06/05 01:29:24 1.132 @@ -1,7 +1,8 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.128 2005/08/03 06:10:47 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.131 2006/06/05 01:01:41 noro Exp $ */ #include "nd.h" +int diag_period = 6; int (*ndl_compare_function)(UINT *a1,UINT *a2); int nd_dcomp; NM _nm_free_list; @@ -1719,6 +1720,7 @@ NODE nd_gb_trace(int m,int ishomo) Q q,den,num; union oNDC dn; struct oEGT eg_monic,egm0,egm1; + int diag_count = 0; init_eg(&eg_monic); init_eg(&eg_invdalg); @@ -1733,14 +1735,17 @@ NODE nd_gb_trace(int m,int ishomo) again: l = nd_minp(d,&d); if ( SG(l) != sugar ) { +#if 1 if ( ishomo ) { stat = do_diagonalize_trace(sugar,m); + diag_count = 0; if ( !stat ) { NEXT(l) = d; d = l; d = nd_reconstruct(1,d); goto again; } } +#endif sugar = SG(l); if ( DP_Print ) fprintf(asir_out,"%d",sugar); } @@ -1789,6 +1794,15 @@ again: nd_removecont(m,nf); nfv = ndtondv(m,nf); nd_free(nf); } nh = ndv_newps(0,nfv,nfqv); + if ( ishomo && ++diag_count == diag_period ) { + diag_count = 0; + stat = do_diagonalize_trace(sugar,m); + if ( !stat ) { + NEXT(l) = d; d = l; + d = nd_reconstruct(1,d); + goto again; + } + } d = update_pairs(d,g,nh); g = update_base(g,nh); } else {