version 1.1, 2018/09/19 05:45:07 |
version 1.2, 2018/09/28 08:20:28 |
|
|
* 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: OpenXM_contrib2/asir2018/engine/NEZ.c,v 1.1 2018/09/19 05:45:07 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
|
|
|
|
for ( n = 0, dc = dcl[0]; dc; dc = NEXT(dc), n++ ); |
for ( n = 0, dc = dcl[0]; dc; dc = NEXT(dc), n++ ); |
vn = (VN)ALLOCA(n*sizeof(struct oVN)); |
vn = (VN)ALLOCA(n*sizeof(struct oVN)); |
for ( i = 0, dc = dcl[0]; i < n; dc = NEXT(dc), i++ ) { |
for ( i = 0, dc = dcl[0]; i < n; dc = NEXT(dc), i++ ) { |
vn[i].v = VR(COEF(dc)); vn[i].n = QTOS(DEG(dc)); |
vn[i].v = VR(COEF(dc)); vn[i].n = ZTOS(DEG(dc)); |
} |
} |
for ( i = 1; i < m; i++ ) { |
for ( i = 1; i < m; i++ ) { |
for ( j = 0; j < n; j++ ) { |
for ( j = 0; j < n; j++ ) { |
for ( dc = dcl[i]; dc; dc = NEXT(dc) ) |
for ( dc = dcl[i]; dc; dc = NEXT(dc) ) |
if ( VR(COEF(dc)) == vn[j].v ) { |
if ( VR(COEF(dc)) == vn[j].v ) { |
vn[j].n = MIN(vn[j].n,QTOS(DEG(dc))); break; |
vn[j].n = MIN(vn[j].n,ZTOS(DEG(dc))); break; |
} |
} |
if ( !dc ) |
if ( !dc ) |
vn[j].n = 0; |
vn[j].n = 0; |
|
|
} |
} |
for ( j = 0, g = (P)ONE; j < n; j++ ) |
for ( j = 0, g = (P)ONE; j < n; j++ ) |
if ( vn[j].n ) { |
if ( vn[j].n ) { |
MKV(vn[j].v,x); STOQ(vn[j].n,d); |
MKV(vn[j].v,x); STOZ(vn[j].n,d); |
pwrp(vl,x,d,&t); mulp(vl,t,g,&s); g = s; |
pwrp(vl,x,d,&t); mulp(vl,t,g,&s); g = s; |
} |
} |
*r = g; |
*r = g; |
|
|
*r = gcd; return; |
*r = gcd; return; |
} |
} |
} |
} |
for ( g = gcd, k = QTOS(DEG(dc))-1; k > 0; k-- ) { |
for ( g = gcd, k = ZTOS(DEG(dc))-1; k > 0; k-- ) { |
nezgcdnp_sqfr_primitive(vl,g,pm,m,&t); |
nezgcdnp_sqfr_primitive(vl,g,pm,m,&t); |
if ( NUM(t) ) |
if ( NUM(t) ) |
break; |
break; |