version 1.37, 2004/09/15 01:43:32 |
version 1.41, 2004/12/04 09:39:27 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/array.c,v 1.36 2004/09/14 07:23:34 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/array.c,v 1.40 2004/12/02 13:53:31 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "base.h" |
#include "base.h" |
#include "parse.h" |
#include "parse.h" |
#include "inline.h" |
#include "inline.h" |
|
|
|
#define F4_INTRAT_PERIOD 8 |
|
|
#if 0 |
#if 0 |
#undef DMAR |
#undef DMAR |
#define DMAR(a1,a2,a3,d,r) (r)=dmar(a1,a2,a3,d); |
#define DMAR(a1,a2,a3,d,r) (r)=dmar(a1,a2,a3,d); |
|
|
add_eg(&eg_chrem_split,&tmp0,&tmp1); |
add_eg(&eg_chrem_split,&tmp0,&tmp1); |
|
|
get_eg(&tmp0); |
get_eg(&tmp0); |
if ( ind % 16 ) |
if ( ind % F4_INTRAT_PERIOD ) |
ret = 0; |
ret = 0; |
else |
else |
ret = intmtoratm(crmat,m1,*nm,dn); |
ret = intmtoratm(crmat,m1,*nm,dn); |
Line 1169 int generic_gauss_elim_hensel(MAT mat,MAT *nmmat,Q *dn |
|
Line 1171 int generic_gauss_elim_hensel(MAT mat,MAT *nmmat,Q *dn |
|
int *cinfo,*rinfo; |
int *cinfo,*rinfo; |
int *rind,*cind; |
int *rind,*cind; |
int count; |
int count; |
struct oEGT eg_mul,eg_inv,tmp0,tmp1; |
int ret; |
|
struct oEGT eg_mul,eg_inv,eg_intrat,eg_check,tmp0,tmp1; |
|
int period; |
|
|
a0 = (Q **)mat->body; |
a0 = (Q **)mat->body; |
row = mat->row; col = mat->col; |
row = mat->row; col = mat->col; |
Line 1217 int generic_gauss_elim_hensel(MAT mat,MAT *nmmat,Q *dn |
|
Line 1221 int generic_gauss_elim_hensel(MAT mat,MAT *nmmat,Q *dn |
|
*cindp = cind = (int *)MALLOC_ATOMIC((ri)*sizeof(int)); |
*cindp = cind = (int *)MALLOC_ATOMIC((ri)*sizeof(int)); |
|
|
init_eg(&eg_mul); init_eg(&eg_inv); |
init_eg(&eg_mul); init_eg(&eg_inv); |
|
init_eg(&eg_check); init_eg(&eg_intrat); |
|
period = F4_INTRAT_PERIOD; |
for ( q = ONE, count = 0; ; count++ ) { |
for ( q = ONE, count = 0; ; count++ ) { |
fprintf(stderr,"."); |
if ( DP_Print ) |
|
fprintf(stderr,"o"); |
/* wc = -b mod md */ |
/* wc = -b mod md */ |
for ( i = 0; i < rank; i++ ) |
for ( i = 0; i < rank; i++ ) |
for ( j = 0, bi = b[i], wi = wc[i]; j < ri; j++ ) |
for ( j = 0, bi = b[i], wi = wc[i]; j < ri; j++ ) |
Line 1257 int generic_gauss_elim_hensel(MAT mat,MAT *nmmat,Q *dn |
|
Line 1264 int generic_gauss_elim_hensel(MAT mat,MAT *nmmat,Q *dn |
|
add_eg(&eg_mul,&tmp0,&tmp1); |
add_eg(&eg_mul,&tmp0,&tmp1); |
/* q = q*md */ |
/* q = q*md */ |
mulq(q,mdq,&u); q = u; |
mulq(q,mdq,&u); q = u; |
if ( !(count % 16) && intmtoratm_q(xmat,NM(q),*nmmat,dn) ) { |
if ( !(count % period) ) { |
for ( j = k = l = 0; j < col; j++ ) |
get_eg(&tmp0); |
if ( cinfo[j] ) |
ret = intmtoratm_q(xmat,NM(q),*nmmat,dn); |
rind[k++] = j; |
get_eg(&tmp1); add_eg(&eg_intrat,&tmp0,&tmp1); |
else |
if ( ret ) { |
cind[l++] = j; |
for ( j = k = l = 0; j < col; j++ ) |
if ( gensolve_check(mat,*nmmat,*dn,rind,cind) ) { |
if ( cinfo[j] ) |
fprintf(stderr,"\n"); |
rind[k++] = j; |
print_eg("INV",&eg_inv); |
else |
print_eg("MUL",&eg_mul); |
cind[l++] = j; |
fflush(asir_out); |
get_eg(&tmp0); |
return rank; |
ret = gensolve_check(mat,*nmmat,*dn,rind,cind); |
} |
get_eg(&tmp1); add_eg(&eg_check,&tmp0,&tmp1); |
|
if ( ret ) { |
|
if ( DP_Print ) { |
|
fprintf(stderr,"\n"); |
|
print_eg("INV",&eg_inv); |
|
print_eg("MUL",&eg_mul); |
|
print_eg("INTRAT",&eg_intrat); |
|
print_eg("CHECK",&eg_check); |
|
fflush(asir_out); |
|
} |
|
return rank; |
|
} |
|
} else |
|
period *=2; |
} |
} |
} |
} |
} |
} |