version 1.210, 2013/09/26 00:38:47 |
version 1.214, 2013/09/27 07:00:45 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.209 2013/09/25 02:36:24 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.213 2013/09/27 02:45:17 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
|
|
return 1; |
return 1; |
} |
} |
|
|
|
int check_splist_f4(int m,NODE splist) |
|
{ |
|
UINT *s0vect; |
|
PGeoBucket bucket; |
|
NODE p,rp0,t; |
|
ND_pairs d,r,l,ll; |
|
int col,stat; |
|
|
|
for ( d = 0, t = splist; t; t = NEXT(t) ) { |
|
p = BDY((LIST)BDY(t)); |
|
NEXTND_pairs(d,r); |
|
r->i1 = QTOS((Q)ARG0(p)); r->i2 = QTOS((Q)ARG1(p)); |
|
ndl_lcm(DL(nd_psh[r->i1]),DL(nd_psh[r->i2]),r->lcm); |
|
SG(r) = TD(LCM(r)); /* XXX */ |
|
} |
|
if ( d ) NEXT(r) = 0; |
|
|
|
while ( d ) { |
|
l = nd_minsugarp(d,&d); |
|
bucket = create_pbucket(); |
|
stat = nd_sp_f4(m,0,l,bucket); |
|
if ( !stat ) { |
|
for ( ll = l; NEXT(ll); ll = NEXT(ll) ); |
|
NEXT(ll) = d; d = l; |
|
d = nd_reconstruct(0,d); |
|
continue; |
|
} |
|
if ( bucket->m < 0 ) continue; |
|
col = nd_symbolic_preproc(bucket,0,&s0vect,&rp0); |
|
if ( !col ) { |
|
for ( ll = l; NEXT(ll); ll = NEXT(ll) ); |
|
NEXT(ll) = d; d = l; |
|
d = nd_reconstruct(0,d); |
|
continue; |
|
} |
|
if ( nd_f4_red(m,l,0,s0vect,col,rp0,0) ) return 0; |
|
} |
|
return 1; |
|
} |
|
|
int do_diagonalize_trace(int sugar,int m) |
int do_diagonalize_trace(int sugar,int m) |
{ |
{ |
int i,nh,stat; |
int i,nh,stat; |
Line 2980 void nd_gr(LIST f,LIST v,int m,int homo,int retdp,int |
|
Line 3020 void nd_gr(LIST f,LIST v,int m,int homo,int retdp,int |
|
ndv_homogenize((NDV)BDY(t),obpe,oadv,oepos,ompos); |
ndv_homogenize((NDV)BDY(t),obpe,oadv,oepos,ompos); |
} |
} |
|
|
ndv_setup(m,0,fd0,(nd_gbblock||nd_splist)?1:0,0); |
ndv_setup(m,0,fd0,(nd_gbblock||nd_splist||nd_check_splist)?1:0,0); |
if ( nd_gentrace ) { |
if ( nd_gentrace ) { |
MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0); |
MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0); |
} |
} |
Line 2989 void nd_gr(LIST f,LIST v,int m,int homo,int retdp,int |
|
Line 3029 void nd_gr(LIST f,LIST v,int m,int homo,int retdp,int |
|
return; |
return; |
} |
} |
if ( nd_check_splist ) { |
if ( nd_check_splist ) { |
if ( check_splist(m,nd_check_splist) ) *rp = (LIST)ONE; |
if ( f4 ) { |
else *rp = 0; |
if ( check_splist_f4(m,nd_check_splist) ) *rp = (LIST)ONE; |
|
else *rp = 0; |
|
} else { |
|
if ( check_splist(m,nd_check_splist) ) *rp = (LIST)ONE; |
|
else *rp = 0; |
|
} |
return; |
return; |
} |
} |
x = f4?nd_f4(m,&perm):nd_gb(m,ishomo || homo,0,0,&perm); |
x = f4?nd_f4(m,&perm):nd_gb(m,ishomo || homo,0,0,&perm); |
Line 6262 NODE nd_f4_red_q_main(ND_pairs sp0,int nsp,int trace,U |
|
Line 6307 NODE nd_f4_red_q_main(ND_pairs sp0,int nsp,int trace,U |
|
rank = nd_gauss_elim_q(spmat,spsugar,sprow,spcol,colstat); |
rank = nd_gauss_elim_q(spmat,spsugar,sprow,spcol,colstat); |
w = (pointer *)ALLOCA(rank*sizeof(pointer)); |
w = (pointer *)ALLOCA(rank*sizeof(pointer)); |
for ( i = 0; i < rank; i++ ) { |
for ( i = 0; i < rank; i++ ) { |
|
#if 0 |
w[rank-i-1] = (pointer)vect_to_ndv_q(spmat[i],spcol,col,rhead,s0vect); |
w[rank-i-1] = (pointer)vect_to_ndv_q(spmat[i],spcol,col,rhead,s0vect); |
SG((NDV)w[rank-i-1]) = spsugar[i]; |
SG((NDV)w[rank-i-1]) = spsugar[i]; |
|
#else |
|
w[i] = (pointer)vect_to_ndv_q(spmat[i],spcol,col,rhead,s0vect); |
|
SG((NDV)w[i]) = spsugar[i]; |
|
#endif |
/* GCFREE(spmat[i]); */ |
/* GCFREE(spmat[i]); */ |
} |
} |
#if 0 |
#if 0 |