version 1.2, 2018/09/28 08:20:28 |
version 1.3, 2019/03/03 05:21:17 |
|
|
* 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/asir2018/engine/up.c,v 1.1 2018/09/19 05:45:07 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2018/engine/up.c,v 1.2 2018/09/28 08:20:28 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include <math.h> |
#include <math.h> |
Line 296 void hybrid_squareup(int ff,UP n1,UP *nr) |
|
Line 296 void hybrid_squareup(int ff,UP n1,UP *nr) |
|
|
|
void hybrid_tmulup(int ff,UP n1,UP n2,int d,UP *nr) |
void hybrid_tmulup(int ff,UP n1,UP n2,int d,UP *nr) |
{ |
{ |
|
UP t; |
|
|
if ( !n1 || !n2 ) |
if ( !n1 || !n2 ) |
*nr = 0; |
*nr = 0; |
else if ( MAX(n1->d,n2->d) < up_fft_mag ) |
else if ( MAX(n1->d,n2->d) < up_fft_mag ) |
Line 856 void rembymulup(UP n1,UP n2,UP *nr) |
|
Line 858 void rembymulup(UP n1,UP n2,UP *nr) |
|
void hybrid_rembymulup_special(int ff,UP n1,UP n2,UP inv2,UP *nr) |
void hybrid_rembymulup_special(int ff,UP n1,UP n2,UP inv2,UP *nr) |
{ |
{ |
int d1,d2,d; |
int d1,d2,d; |
UP r1,t,s,q; |
UP r1,t,s,q,t1; |
|
|
if ( !n2 ) |
if ( !n2 ) |
error("hybrid_rembymulup : division by 0"); |
error("hybrid_rembymulup : division by 0"); |
Line 1384 void crup(ModNum **f,int d,int *mod,int index,Z m,UP * |
|
Line 1386 void crup(ModNum **f,int d,int *mod,int index,Z m,UP * |
|
mpz_t cof,c,rem; |
mpz_t cof,c,rem; |
mpz_t *s; |
mpz_t *s; |
UP u; |
UP u; |
|
Z z; |
int inv,i,j,t; |
int inv,i,j,t; |
|
|
mpz_init(c); mpz_init(cof); mpz_init(rem); |
mpz_init(c); mpz_init(cof); mpz_init(rem); |
Line 1408 void crup(ModNum **f,int d,int *mod,int index,Z m,UP * |
|
Line 1411 void crup(ModNum **f,int d,int *mod,int index,Z m,UP * |
|
else { |
else { |
u = UPALLOC(i); |
u = UPALLOC(i); |
DEG(u) = i; |
DEG(u) = i; |
for ( j = 0; j <= i; j++ ) |
for ( j = 0; j <= i; j++ ) { |
COEF(u)[j] = (Num)s[j]; |
MPZTOZ(s[j],z); COEF(u)[j] = (Num)z; |
|
} |
remcup(u,m,r); |
remcup(u,m,r); |
} |
} |
} |
} |