version 1.11, 2005/08/24 06:28:39 |
version 1.13, 2006/01/05 00:21:20 |
|
|
/* |
/* |
* $OpenXM: OpenXM_contrib2/asir2000/engine/dalg.c,v 1.10 2005/08/02 07:16:42 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/dalg.c,v 1.12 2005/10/12 14:43:36 noro Exp $ |
*/ |
*/ |
|
|
#include "ca.h" |
#include "ca.h" |
Line 651 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
Line 651 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
struct order_spec *current_spec; |
struct order_spec *current_spec; |
struct oEGT eg0,eg1; |
struct oEGT eg0,eg1; |
extern struct oEGT eg_le; |
extern struct oEGT eg_le; |
|
extern int DP_Print; |
|
|
if ( !(nf=current_numberfield) ) |
if ( !(nf=current_numberfield) ) |
error("invdalg : current_numberfield is not set"); |
error("invdalg : current_numberfield is not set"); |
Line 669 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
Line 670 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
simp = (DAlg *)ALLOCA(dim*sizeof(DAlg)); |
simp = (DAlg *)ALLOCA(dim*sizeof(DAlg)); |
current_spec = dp_current_spec; initd(nf->spec); |
current_spec = dp_current_spec; initd(nf->spec); |
for ( i = 0; i < dim; i++ ) { |
for ( i = 0; i < dim; i++ ) { |
|
if ( DP_Print ) { fprintf(asir_out,"."); fflush(asir_out); } |
m = mb[i]; |
m = mb[i]; |
for ( j = i-1; j >= 0; j-- ) |
for ( j = i-1; j >= 0; j-- ) |
if ( dp_redble(m,mb[j]) ) |
if ( dp_redble(m,mb[j]) ) |
Line 706 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
Line 708 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
} |
} |
} |
} |
get_eg(&eg0); |
get_eg(&eg0); |
rank = generic_gauss_elim_hensel(mobj,&sol,&dnsol,&rinfo,&cinfo); |
rank = generic_gauss_elim_hensel_dalg(mobj,&sol,&dnsol,&rinfo,&cinfo); |
get_eg(&eg1); add_eg(&eg_le,&eg0,&eg1); |
get_eg(&eg1); add_eg(&eg_le,&eg0,&eg1); |
if ( cinfo[0] == dim ) { |
if ( cinfo[0] == dim ) { |
/* the input is invertible */ |
/* the input is invertible */ |
Line 724 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
Line 726 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
return 0; |
return 0; |
} else { |
} else { |
/* the input is not invertible */ |
/* the input is not invertible */ |
nparam = (dim+1)-rank; |
nparam = sol->col; |
/* the index 'dim' should not be in cinfo[] */ |
|
solmat = (Q **)BDY(sol); |
solmat = (Q **)BDY(sol); |
for ( k = 0; k < nparam; k++ ) |
|
if ( cinfo[k] == dim ) |
|
error("invdalg : cannot happen"); |
|
nd0 = 0; |
nd0 = 0; |
for ( k = 0; k < nparam; k++ ) { |
for ( k = 0; k < nparam; k++ ) { |
m = mb[cinfo[k]]; |
|
for ( ndt = nd0; ndt; ndt = NEXT(ndt) ) { |
|
if ( dp_redble(m,(DP)BDY(ndt)) ) break; |
|
} |
|
/* skip a redundunt basis element */ |
|
if ( ndt ) continue; |
|
/* construct a new basis element */ |
/* construct a new basis element */ |
|
m = mb[cinfo[k]]; |
mp0 = 0; |
mp0 = 0; |
NEXTMP(mp0,mp); |
NEXTMP(mp0,mp); |
chsgnq(dnsol,&dn1); mp->c = (P)dn1; |
chsgnq(dnsol,&dn1); mp->c = (P)dn1; |