version 1.139, 2006/06/12 00:46:48 |
version 1.142, 2006/08/09 02:43:38 |
|
|
/* $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.141 2006/06/17 10:12:06 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 1548 int do_diagonalize(int sugar,int m) |
|
Line 1548 int do_diagonalize(int sugar,int m) |
|
Q q,num,den; |
Q q,num,den; |
union oNDC dn; |
union oNDC dn; |
|
|
for ( i = nd_psn-1; i >= 0 && SG(nd_psh[i]) == sugar; i-- ) { |
for ( i = nd_psn-1; i >= 0; i-- ) { |
|
if ( SG(nd_psh[i]) != sugar ) continue; |
if ( nd_demand ) |
if ( nd_demand ) |
nfv = ndv_load(i); |
nfv = ndv_load(i); |
else |
else |
Line 1592 NODE nd_gb(int m,int ishomo,int checkonly) |
|
Line 1593 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++ ) { |
|
|
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; |
|
|
} |
} |
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 1665 int do_diagonalize_trace(int sugar,int m) |
|
Line 1677 int do_diagonalize_trace(int sugar,int m) |
|
Q q,den,num; |
Q q,den,num; |
union oNDC dn; |
union oNDC dn; |
|
|
for ( i = nd_psn-1; i >= 0 && SG(nd_psh[i]) == sugar; i-- ) { |
for ( i = nd_psn-1; i >= 0; i-- ) { |
|
if ( SG(nd_psh[i]) != sugar ) continue; |
/* for nd_ps */ |
/* for nd_ps */ |
s = ndvtond(m,nd_ps[i]); |
s = ndvtond(m,nd_ps[i]); |
s = nd_separate_head(s,&head); |
s = nd_separate_head(s,&head); |