=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.c,v retrieving revision 1.129 retrieving revision 1.131 diff -u -p -r1.129 -r1.131 --- OpenXM_contrib2/asir2000/engine/nd.c 2006/04/17 04:35:20 1.129 +++ OpenXM_contrib2/asir2000/engine/nd.c 2006/06/05 01:01:41 1.131 @@ -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.130 2006/05/30 07:35:31 noro Exp $ */ #include "nd.h" +int diag_period = 6; int (*ndl_compare_function)(UINT *a1,UINT *a2); int nd_dcomp; NM _nm_free_list; @@ -1591,6 +1592,7 @@ NODE nd_gb(int m,int ishomo,int checkonly) NDV nfv; Q q,num,den; union oNDC dn; + int diag_count = 0; g = 0; d = 0; for ( i = 0; i < nd_psn; i++ ) { @@ -1638,6 +1640,15 @@ again: } nfv = ndtondv(m,nf); nd_free(nf); nh = ndv_newps(m,nfv,0); + if ( ishomo && ++diag_count == diag_period ) { + diag_count = 0; + stat = do_diagonalize(sugar,m); + if ( !stat ) { + NEXT(l) = d; d = l; + d = nd_reconstruct(0,d); + goto again; + } + } d = update_pairs(d,g,nh); g = update_base(g,nh); FREENDP(l); @@ -1719,6 +1730,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 +1745,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 +1804,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 {