version 1.1, 2018/09/19 05:45:06 |
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/E.c,v 1.1 2018/09/19 05:45:06 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
|
|
Line 54 void henmv(VL vl,VN vn,P f,P g0,P h0,P a0,P b0,P lg,P |
|
Line 54 void henmv(VL vl,VN vn,P f,P g0,P h0,P a0,P b0,P lg,P |
|
P g1,h1,a1,b1; |
P g1,h1,a1,b1; |
Z q2,r2,two; |
Z q2,r2,two; |
|
|
STOQ(2,two); |
STOZ(2,two); |
divqrz(q,two,&q2,&r2); |
divqrz(q,two,&q2,&r2); |
adjc(vl,g0,a0,lg0,q,&g1,&a1); adjc(vl,h0,b0,lh0,q,&h1,&b1); |
adjc(vl,g0,a0,lg0,q,&g1,&a1); adjc(vl,h0,b0,lh0,q,&h1,&b1); |
henmvmain(vl,vn,f,g1,h1,b1,a1,lg,lh,q,q2,k,gp,hp); |
henmvmain(vl,vn,f,g1,h1,b1,a1,lg,lh,q,q2,k,gp,hp); |
Line 167 void henzq(P f,P i0,UM fi0,P i1,UM fi1,int p,int k,P * |
|
Line 167 void henzq(P f,P i0,UM fi0,P i1,UM fi1,int p,int k,P * |
|
umtop(VR(f),fi0,&f0); umtop(VR(f),fi1,&f1); |
umtop(VR(f),fi0,&f0); umtop(VR(f),fi1,&f1); |
umtop(VR(f),wg0,&g0); umtop(VR(f),wg1,&g1); |
umtop(VR(f),wg0,&g0); umtop(VR(f),wg1,&g1); |
|
|
STOQ(2,two); STOQ(p,q); divqrz(q,two,&q2,&r2); |
STOZ(2,two); STOZ(p,q); divqrz(q,two,&q2,&r2); |
for ( i = 1; i < k; i++ ) { |
for ( i = 1; i < k; i++ ) { |
/* c = ((f - f0*f1)/q) mod q; |
/* c = ((f - f0*f1)/q) mod q; |
q1 = (c*g1) / f1; |
q1 = (c*g1) / f1; |
Line 246 void henzq1(P g,P h,Q bound,P *gcp,P *hcp,Z *qp) |
|
Line 246 void henzq1(P g,P h,Q bound,P *gcp,P *hcp,Z *qp) |
|
|
|
v = VR(g); n=deg(v,g); m=deg(v,h); |
v = VR(g); n=deg(v,g); m=deg(v,h); |
norm(g,&a); norm(h,&b); |
norm(g,&a); norm(h,&b); |
STOQ(m,w); pwrq(a,(Q)w,&t); |
STOZ(m,w); pwrq(a,(Q)w,&t); |
STOQ(n,w); pwrq(b,(Q)w,&s); |
STOZ(n,w); pwrq(b,(Q)w,&s); |
mulq(t,s,&ts); |
mulq(t,s,&ts); |
|
|
factorialz(n+m,&w); mulq(ts,(Q)w,&s); |
factorialz(n+m,&w); mulq(ts,(Q)w,&s); |
Line 309 void henzq1(P g,P h,Q bound,P *gcp,P *hcp,Z *qp) |
|
Line 309 void henzq1(P g,P h,Q bound,P *gcp,P *hcp,Z *qp) |
|
!remqi((Q)LC(g),mod) || |
!remqi((Q)LC(g),mod) || |
!remqi((Q)LC(h),mod) ) |
!remqi((Q)LC(h),mod) ) |
continue; |
continue; |
for ( STOQ(mod,q); cmpq((Q)q,bound) < 0; ) { |
for ( STOZ(mod,q); cmpq((Q)q,bound) < 0; ) { |
mulz(q,q,&q1); q = q1; |
mulz(q,q,&q1); q = q1; |
} |
} |
*qp = q; |
*qp = q; |
Line 478 void exthpc_generic(VL vl,P p,int d,V v,P *pr) |
|
Line 478 void exthpc_generic(VL vl,P p,int d,V v,P *pr) |
|
else { |
else { |
v0 = VR(p); |
v0 = VR(p); |
for ( MKV(v0,x), dc = DC(p), w = 0; dc; dc = NEXT(dc) ) { |
for ( MKV(v0,x), dc = DC(p), w = 0; dc; dc = NEXT(dc) ) { |
exthpc_generic(vl,COEF(dc),d-QTOS(DEG(dc)),v,&t); |
exthpc_generic(vl,COEF(dc),d-ZTOS(DEG(dc)),v,&t); |
pwrp(vl,x,DEG(dc),&xd); |
pwrp(vl,x,DEG(dc),&xd); |
mulp(vl,xd,t,&t1); addp(vl,w,t1,&a); w = a; |
mulp(vl,xd,t,&t1); addp(vl,w,t1,&a); w = a; |
} |
} |
Line 500 void exthp(VL vl,P p,int d,P *pr) |
|
Line 500 void exthp(VL vl,P p,int d,P *pr) |
|
*pr = 0; |
*pr = 0; |
else { |
else { |
for ( MKV(VR(p),x), dc = DC(p), w = 0; dc; dc = NEXT(dc) ) { |
for ( MKV(VR(p),x), dc = DC(p), w = 0; dc; dc = NEXT(dc) ) { |
exthp(vl,COEF(dc),d - QTOS(DEG(dc)),&t); |
exthp(vl,COEF(dc),d - ZTOS(DEG(dc)),&t); |
pwrp(vl,x,DEG(dc),&xd); |
pwrp(vl,x,DEG(dc),&xd); |
mulp(vl,xd,t,&t1); addp(vl,w,t1,&a); w = a; |
mulp(vl,xd,t,&t1); addp(vl,w,t1,&a); w = a; |
} |
} |
Line 537 void cbound(VL vl,P p,Q *b) |
|
Line 537 void cbound(VL vl,P p,Q *b) |
|
addq(n,n,&m); |
addq(n,n,&m); |
|
|
k = geldb(vl,p); |
k = geldb(vl,p); |
STOQ(3,t); STOQ(k,e); |
STOZ(3,t); STOZ(k,e); |
|
|
pwrq((Q)t,(Q)e,&n); |
pwrq((Q)t,(Q)e,&n); |
mulq(m,n,b); |
mulq(m,n,b); |
|
|
return( 0 ); |
return( 0 ); |
else { |
else { |
for ( dc = DC(f), m = 0; dc; dc = NEXT(dc) ) { |
for ( dc = DC(f), m = 0; dc; dc = NEXT(dc) ) { |
t = QTOS(DEG(dc))+homdeg(COEF(dc)); |
t = ZTOS(DEG(dc))+homdeg(COEF(dc)); |
m = MAX(m,t); |
m = MAX(m,t); |
} |
} |
return ( m ); |
return ( m ); |
Line 754 int minhomdeg(P f) |
|
Line 754 int minhomdeg(P f) |
|
return( 0 ); |
return( 0 ); |
else { |
else { |
for ( dc = DC(f), m = homdeg(f); dc; dc = NEXT(dc) ) { |
for ( dc = DC(f), m = homdeg(f); dc; dc = NEXT(dc) ) { |
t = QTOS(DEG(dc))+minhomdeg(COEF(dc)); |
t = ZTOS(DEG(dc))+minhomdeg(COEF(dc)); |
m = MIN(m,t); |
m = MIN(m,t); |
} |
} |
return ( m ); |
return ( m ); |
Line 801 void affinemain(VL vl,P p,V v0,int n,P *pl,P *pr) |
|
Line 801 void affinemain(VL vl,P p,V v0,int n,P *pl,P *pr) |
|
c = COEF(dc); |
c = COEF(dc); |
for ( d = DEG(dc), dc = NEXT(dc); |
for ( d = DEG(dc), dc = NEXT(dc); |
dc; d = DEG(dc), dc = NEXT(dc) ) { |
dc; d = DEG(dc), dc = NEXT(dc) ) { |
mulp(vl,pl[QTOS(d)-QTOS(DEG(dc))],c,&m); |
mulp(vl,pl[ZTOS(d)-ZTOS(DEG(dc))],c,&m); |
addp(vl,m,COEF(dc),&c); |
addp(vl,m,COEF(dc),&c); |
} |
} |
if ( d ) { |
if ( d ) { |
mulp(vl,pl[QTOS(d)],c,&m); c = m; |
mulp(vl,pl[ZTOS(d)],c,&m); c = m; |
} |
} |
*pr = c; |
*pr = c; |
} |
} |
Line 821 void restore(VL vl,P f,VN vn,P *fr) |
|
Line 821 void restore(VL vl,P f,VN vn,P *fr) |
|
for ( i = 0; vn[i].v; i++ ) { |
for ( i = 0; vn[i].v; i++ ) { |
MKV(vn[i].v,t); |
MKV(vn[i].v,t); |
if ( vn[i].n ) { |
if ( vn[i].n ) { |
STOQ(-vn[i].n,s); |
STOZ(-vn[i].n,s); |
addp(vl,t,(P)s,&vv); |
addp(vl,t,(P)s,&vv); |
} else |
} else |
vv = t; |
vv = t; |