version 1.8, 2001/10/09 01:36:11 |
version 1.12, 2004/09/14 09:25:48 |
|
|
* 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/engine/PU.c,v 1.7 2001/10/01 01:58:03 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/PU.c,v 1.11 2004/09/14 07:23:34 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
|
|
Line 116 void substp(VL vl,P p,V v0,P p0,P *pr) |
|
Line 116 void substp(VL vl,P p,V v0,P p0,P *pr) |
|
|
|
void detp(VL vl,P **rmat,int n,P *dp) |
void detp(VL vl,P **rmat,int n,P *dp) |
{ |
{ |
int i,j,k,sgn; |
int i,j,k,l,sgn,nmin,kmin,lmin,ntmp; |
P mjj,mij,t,s,u,d; |
P mjj,mij,t,s,u,d; |
P **mat; |
P **mat; |
P *mi,*mj; |
P *mi,*mj; |
Line 130 void detp(VL vl,P **rmat,int n,P *dp) |
|
Line 130 void detp(VL vl,P **rmat,int n,P *dp) |
|
if ( i == n ) { |
if ( i == n ) { |
*dp = 0; return; |
*dp = 0; return; |
} |
} |
for ( k = i; k < n; k++ ) |
nmin = nmonop(mat[i][j]); |
if ( mat[k][j] && (nmonop(mat[k][j]) < nmonop(mat[i][j]) ) ) |
kmin=i; lmin=j; |
i = k; |
for ( k = j; k < n; k++ ) |
if ( j != i ) { |
for ( l = j; l < n; l++ ) |
mj = mat[j]; mat[j] = mat[i]; mat[i] = mj; sgn = -sgn; |
if ( mat[k][l] && ((ntmp=nmonop(mat[k][l])) < nmin) ) { |
|
kmin = k; lmin = l; nmin = ntmp; |
|
} |
|
if ( kmin != j ) { |
|
mj = mat[j]; mat[j] = mat[kmin]; mat[kmin] = mj; sgn = -sgn; |
} |
} |
|
if ( lmin != j ) { |
|
for ( k = j; k < n; k++ ) { |
|
t = mat[k][j]; mat[k][j] = mat[k][lmin]; mat[k][lmin] = t; |
|
} |
|
sgn = -sgn; |
|
} |
for ( i = j + 1, mj = mat[j], mjj = mj[j]; i < n; i++ ) |
for ( i = j + 1, mj = mat[j], mjj = mj[j]; i < n; i++ ) |
for ( k = j + 1, mi = mat[i], mij = mi[j]; k < n; k++ ) { |
for ( k = j + 1, mi = mat[i], mij = mi[j]; k < n; k++ ) { |
mulp(vl,mi[k],mjj,&t); mulp(vl,mj[k],mij,&s); |
mulp(vl,mi[k],mjj,&t); mulp(vl,mj[k],mij,&s); |
Line 635 showmat(VL vl,P **mat,int n) |
|
Line 645 showmat(VL vl,P **mat,int n) |
|
|
|
for ( i = 0; i < n; i++ ) { |
for ( i = 0; i < n; i++ ) { |
for ( j = 0; j < n; j++ ) { |
for ( j = 0; j < n; j++ ) { |
mptop(mat[i][j],&t); printp(vl,t); fprintf(out," "); |
mptop(mat[i][j],&t); asir_printp(vl,t); fprintf(out," "); |
} |
} |
fprintf(out,"\n"); |
fprintf(out,"\n"); |
} |
} |
Line 646 showmp(VL vl,P p) |
|
Line 656 showmp(VL vl,P p) |
|
{ |
{ |
P t; |
P t; |
|
|
mptop(p,&t); printp(vl,t); fprintf(out,"\n"); |
mptop(p,&t); asir_printp(vl,t); fprintf(out,"\n"); |
} |
} |
#endif |
#endif |
|
|
Line 1030 int maxblenp(P p) |
|
Line 1040 int maxblenp(P p) |
|
return n_bits(NM((Q)p))+(INT((Q)p)?0:n_bits(DN((Q)p))); |
return n_bits(NM((Q)p))+(INT((Q)p)?0:n_bits(DN((Q)p))); |
else { |
else { |
for ( dc = DC(p), s = 0; dc; dc = NEXT(dc) ) { |
for ( dc = DC(p), s = 0; dc; dc = NEXT(dc) ) { |
t = p_mag(COEF(dc)); |
t = maxblenp(COEF(dc)); |
s = MAX(t,s); |
s = MAX(t,s); |
} |
} |
return s; |
return s; |