亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? zz_pex.txt

?? 一個比較通用的大數運算庫
?? TXT
?? 第 1 頁 / 共 2 頁
字號:

/**************************************************************************\

MODULE: ZZ_pEX

SUMMARY:

The class ZZ_pEX represents polynomials over ZZ_pE,
and so can be used, for example, for arithmentic in GF(p^n)[X].
However, except where mathematically necessary (e.g., GCD computations),
ZZ_pE need not be a field.

\**************************************************************************/

#include <NTL/ZZ_pE.h>
#include <NTL/vec_ZZ_pE.h>

class ZZ_pEX {
public:

   ZZ_pEX(); // initial value 0

   ZZ_pEX(const ZZ_pEX& a); // copy

   ZZ_pEX& operator=(const ZZ_pEX& a); // assignment
   ZZ_pEX& operator=(const ZZ_pE& a);
   ZZ_pEX& operator=(const ZZ_p& a);
   ZZ_pEX& operator=(long a);

   ~ZZ_pEX(); // destructor

   ZZ_pEX(long i, const ZZ_pE& c); // initilaize to X^i*c
   ZZ_pEX(long i, const ZZ_p& c); 
   ZZ_pEX(long i, long c); 

   
};






/**************************************************************************\

                                  Comparison

\**************************************************************************/


long operator==(const ZZ_pEX& a, const ZZ_pEX& b);
long operator!=(const ZZ_pEX& a, const ZZ_pEX& b);

long IsZero(const ZZ_pEX& a); // test for 0
long IsOne(const ZZ_pEX& a); // test for 1

// PROMOTIONS: ==, != promote {long,ZZ_p,ZZ_pE} to ZZ_pEX on (a, b).

/**************************************************************************\

                                   Addition

\**************************************************************************/

// operator notation:

ZZ_pEX operator+(const ZZ_pEX& a, const ZZ_pEX& b);
ZZ_pEX operator-(const ZZ_pEX& a, const ZZ_pEX& b);
ZZ_pEX operator-(const ZZ_pEX& a);

ZZ_pEX& operator+=(ZZ_pEX& x, const ZZ_pEX& a);
ZZ_pEX& operator+=(ZZ_pEX& x, const ZZ_pE& a);
ZZ_pEX& operator+=(ZZ_pEX& x, const ZZ_p& a);
ZZ_pEX& operator+=(ZZ_pEX& x, long a);


ZZ_pEX& operator++(ZZ_pEX& x);  // prefix
void operator++(ZZ_pEX& x, int);  // postfix

ZZ_pEX& operator-=(ZZ_pEX& x, const ZZ_pEX& a);
ZZ_pEX& operator-=(ZZ_pEX& x, const ZZ_pE& a);
ZZ_pEX& operator-=(ZZ_pEX& x, const ZZ_p& a);
ZZ_pEX& operator-=(ZZ_pEX& x, long a);

ZZ_pEX& operator--(ZZ_pEX& x);  // prefix
void operator--(ZZ_pEX& x, int);  // postfix

// procedural versions:

void add(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& b); // x = a + b
void sub(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& b); // x = a - b 
void negate(ZZ_pEX& x, const ZZ_pEX& a); // x = - a 

// PROMOTIONS: +, -, add, sub promote {long,ZZ_p,ZZ_pE} to ZZ_pEX on (a, b).



/**************************************************************************\

                               Multiplication

\**************************************************************************/

// operator notation:

ZZ_pEX operator*(const ZZ_pEX& a, const ZZ_pEX& b);

ZZ_pEX& operator*=(ZZ_pEX& x, const ZZ_pEX& a);
ZZ_pEX& operator*=(ZZ_pEX& x, const ZZ_pE& a);
ZZ_pEX& operator*=(ZZ_pEX& x, const ZZ_p& a);
ZZ_pEX& operator*=(ZZ_pEX& x, long a);


// procedural versions:


void mul(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& b); // x = a * b

void sqr(ZZ_pEX& x, const ZZ_pEX& a); // x = a^2
ZZ_pEX sqr(const ZZ_pEX& a); 

// PROMOTIONS: *, mul promote {long,ZZ_p,ZZ_pE} to ZZ_pEX on (a, b).

void power(ZZ_pEX& x, const ZZ_pEX& a, long e);  // x = a^e (e >= 0)
ZZ_pEX power(const ZZ_pEX& a, long e);


/**************************************************************************\

                               Shift Operations

LeftShift by n means multiplication by X^n
RightShift by n means division by X^n

A negative shift amount reverses the direction of the shift.

\**************************************************************************/

// operator notation:

ZZ_pEX operator<<(const ZZ_pEX& a, long n);
ZZ_pEX operator>>(const ZZ_pEX& a, long n);

ZZ_pEX& operator<<=(ZZ_pEX& x, long n);
ZZ_pEX& operator>>=(ZZ_pEX& x, long n);

// procedural versions:

void LeftShift(ZZ_pEX& x, const ZZ_pEX& a, long n); 
ZZ_pEX LeftShift(const ZZ_pEX& a, long n);

void RightShift(ZZ_pEX& x, const ZZ_pEX& a, long n); 
ZZ_pEX RightShift(const ZZ_pEX& a, long n); 



/**************************************************************************\

                                  Division

\**************************************************************************/

// operator notation:

ZZ_pEX operator/(const ZZ_pEX& a, const ZZ_pEX& b);
ZZ_pEX operator/(const ZZ_pEX& a, const ZZ_pE& b);
ZZ_pEX operator/(const ZZ_pEX& a, const ZZ_p& b);
ZZ_pEX operator/(const ZZ_pEX& a, long b);

ZZ_pEX operator%(const ZZ_pEX& a, const ZZ_pEX& b);

ZZ_pEX& operator/=(ZZ_pEX& x, const ZZ_pEX& a);
ZZ_pEX& operator/=(ZZ_pEX& x, const ZZ_pE& a);
ZZ_pEX& operator/=(ZZ_pEX& x, const ZZ_p& a);
ZZ_pEX& operator/=(ZZ_pEX& x, long a);

ZZ_pEX& operator%=(ZZ_pEX& x, const ZZ_pEX& a);

// procedural versions:


void DivRem(ZZ_pEX& q, ZZ_pEX& r, const ZZ_pEX& a, const ZZ_pEX& b);
// q = a/b, r = a%b

void div(ZZ_pEX& q, const ZZ_pEX& a, const ZZ_pEX& b);
void div(ZZ_pEX& q, const ZZ_pEX& a, const ZZ_pE& b);
void div(ZZ_pEX& q, const ZZ_pEX& a, const ZZ_p& b);
void div(ZZ_pEX& q, const ZZ_pEX& a, long b);
// q = a/b

void rem(ZZ_pEX& r, const ZZ_pEX& a, const ZZ_pEX& b);
// r = a%b

long divide(ZZ_pEX& q, const ZZ_pEX& a, const ZZ_pEX& b);
// if b | a, sets q = a/b and returns 1; otherwise returns 0

long divide(const ZZ_pEX& a, const ZZ_pEX& b);
// if b | a, sets q = a/b and returns 1; otherwise returns 0


/**************************************************************************\

                                   GCD's

These routines are intended for use when ZZ_pE is a field.

\**************************************************************************/


void GCD(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& b);
ZZ_pEX GCD(const ZZ_pEX& a, const ZZ_pEX& b); 
// x = GCD(a, b),  x is always monic (or zero if a==b==0).


void XGCD(ZZ_pEX& d, ZZ_pEX& s, ZZ_pEX& t, const ZZ_pEX& a, const ZZ_pEX& b);
// d = gcd(a,b), a s + b t = d 


/**************************************************************************\

                                  Input/Output

I/O format:

   [a_0 a_1 ... a_n],

represents the polynomial a_0 + a_1*X + ... + a_n*X^n.

On output, all coefficients will be polynomials of degree < ZZ_pE::degree() and
a_n not zero (the zero polynomial is [ ]).  On input, the coefficients
are arbitrary polynomials which are reduced modulo ZZ_pE::modulus(), 
and leading zeros stripped.

\**************************************************************************/

istream& operator>>(istream& s, ZZ_pEX& x);
ostream& operator<<(ostream& s, const ZZ_pEX& a);


/**************************************************************************\

                              Some utility routines

\**************************************************************************/

long deg(const ZZ_pEX& a);  // return deg(a); deg(0) == -1.

const ZZ_pE& coeff(const ZZ_pEX& a, long i);
// returns a read-only reference to the coefficient of X^i, or zero if
// i not in range

const ZZ_pE& LeadCoeff(const ZZ_pEX& a);
// read-only reference to leading term of a, or zero if a == 0

const ZZ_pE& ConstTerm(const ZZ_pEX& a);
// read-only reference to constant term of a, or zero if a == 0

void SetCoeff(ZZ_pEX& x, long i, const ZZ_pE& a);
void SetCoeff(ZZ_pEX& x, long i, const ZZ_p& a);
void SetCoeff(ZZ_pEX& x, long i, long a);
// makes coefficient of X^i equal to a;  error is raised if i < 0

void SetCoeff(ZZ_pEX& x, long i);
// makes coefficient of X^i equal to 1;  error is raised if i < 0

void SetX(ZZ_pEX& x); // x is set to the monomial X

long IsX(const ZZ_pEX& a); // test if x = X

void diff(ZZ_pEX& x, const ZZ_pEX& a); // x = derivative of a
ZZ_pEX diff(const ZZ_pEX& a); 

void MakeMonic(ZZ_pEX& x); 
// if x != 0 makes x into its monic associate; LeadCoeff(x) must be
// invertible in this case

void reverse(ZZ_pEX& x, const ZZ_pEX& a, long hi);
ZZ_pEX reverse(const ZZ_pEX& a, long hi);

void reverse(ZZ_pEX& x, const ZZ_pEX& a);
ZZ_pEX reverse(const ZZ_pEX& a);

// x = reverse of a[0]..a[hi] (hi >= -1);
// hi defaults to deg(a) in second version

void VectorCopy(vec_ZZ_pE& x, const ZZ_pEX& a, long n);
vec_ZZ_pE VectorCopy(const ZZ_pEX& a, long n);
// x = copy of coefficient vector of a of length exactly n.
// input is truncated or padded with zeroes as appropriate.




/**************************************************************************\

                             Random Polynomials

\**************************************************************************/

void random(ZZ_pEX& x, long n);
ZZ_pEX random_ZZ_pEX(long n);
// x = random polynomial of degree < n 


/**************************************************************************\

                    Polynomial Evaluation and related problems

\**************************************************************************/


void BuildFromRoots(ZZ_pEX& x, const vec_ZZ_pE& a);
ZZ_pEX BuildFromRoots(const vec_ZZ_pE& a);
// computes the polynomial (X-a[0]) ... (X-a[n-1]), where n = a.length()

void eval(ZZ_pE& b, const ZZ_pEX& f, const ZZ_pE& a);
ZZ_pE eval(const ZZ_pEX& f, const ZZ_pE& a);
// b = f(a)

void eval(ZZ_pE& b, const ZZ_pX& f, const ZZ_pE& a);
ZZ_pE eval(const ZZ_pEX& f, const ZZ_pE& a);
// b = f(a); uses ModComp algorithm for ZZ_pX

void eval(vec_ZZ_pE& b, const ZZ_pEX& f, const vec_ZZ_pE& a);
vec_ZZ_pE eval(const ZZ_pEX& f, const vec_ZZ_pE& a);
//  b.SetLength(a.length()); b[i] = f(a[i]) for 0 <= i < a.length()

void interpolate(ZZ_pEX& f, const vec_ZZ_pE& a, const vec_ZZ_pE& b);
ZZ_pEX interpolate(const vec_ZZ_pE& a, const vec_ZZ_pE& b);
// interpolates the polynomial f satisfying f(a[i]) = b[i].  

/**************************************************************************\

                       Arithmetic mod X^n

Required: n >= 0; otherwise, an error is raised.

\**************************************************************************/

void trunc(ZZ_pEX& x, const ZZ_pEX& a, long n); // x = a % X^n
ZZ_pEX trunc(const ZZ_pEX& a, long n); 

void MulTrunc(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& b, long n);
ZZ_pEX MulTrunc(const ZZ_pEX& a, const ZZ_pEX& b, long n);
// x = a * b % X^n

void SqrTrunc(ZZ_pEX& x, const ZZ_pEX& a, long n);
ZZ_pEX SqrTrunc(const ZZ_pEX& a, long n);
// x = a^2 % X^n

void InvTrunc(ZZ_pEX& x, const ZZ_pEX& a, long n);
ZZ_pEX InvTrunc(ZZ_pEX& x, const ZZ_pEX& a, long n);
// computes x = a^{-1} % X^m.  Must have ConstTerm(a) invertible.

/**************************************************************************\

                Modular Arithmetic (without pre-conditioning)

Arithmetic mod f.

All inputs and outputs are polynomials of degree less than deg(f), and
deg(f) > 0.


NOTE: if you want to do many computations with a fixed f, use the
ZZ_pEXModulus data structure and associated routines below for better
performance.

\**************************************************************************/

void MulMod(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& b, const ZZ_pEX& f);
ZZ_pEX MulMod(const ZZ_pEX& a, const ZZ_pEX& b, const ZZ_pEX& f);
// x = (a * b) % f

void SqrMod(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& f);
ZZ_pEX SqrMod(const ZZ_pEX& a, const ZZ_pEX& f);
// x = a^2 % f

void MulByXMod(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& f);
ZZ_pEX MulByXMod(const ZZ_pEX& a, const ZZ_pEX& f);
// x = (a * X) mod f

void InvMod(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& f);
ZZ_pEX InvMod(const ZZ_pEX& a, const ZZ_pEX& f);
// x = a^{-1} % f, error is a is not invertible

long InvModStatus(ZZ_pEX& x, const ZZ_pEX& a, const ZZ_pEX& f);
// if (a, f) = 1, returns 0 and sets x = a^{-1} % f; otherwise,
// returns 1 and sets x = (a, f)


/**************************************************************************\

                     Modular Arithmetic with Pre-Conditioning

If you need to do a lot of arithmetic modulo a fixed f, build
ZZ_pEXModulus F for f.  This pre-computes information about f that
speeds up subsequent computations.

As an example, the following routine the product modulo f of a vector
of polynomials.

#include <NTL/ZZ_pEX.h>

void product(ZZ_pEX& x, const vec_ZZ_pEX& v, const ZZ_pEX& f)
{
   ZZ_pEXModulus F(f);
   ZZ_pEX res;
   res = 1;
   long i;
   for (i = 0; i < v.length(); i++)
      MulMod(res, res, v[i], F); 
   x = res;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av中文字幕一区二区三区| 制服.丝袜.亚洲.中文.综合| 欧美日韩一区二区三区四区五区| 日韩一区二区三区观看| 中文字幕字幕中文在线中不卡视频| 日韩中文字幕1| 在线免费观看日本欧美| 欧美极品美女视频| 黄网站免费久久| 欧美日韩综合色| 亚洲人成精品久久久久| 国精产品一区一区三区mba桃花| 欧美影院一区二区三区| 中文字幕一区二区不卡 | 亚洲国产精品久久人人爱蜜臀| 蜜臀av一区二区在线观看| 91电影在线观看| 亚洲视频香蕉人妖| 成人在线视频一区| 国产日韩欧美高清| 国产激情精品久久久第一区二区| 日韩欧美国产综合在线一区二区三区| 婷婷亚洲久悠悠色悠在线播放| 91麻豆国产在线观看| 国产欧美日韩三级| 成人免费电影视频| 国产精品美女久久久久aⅴ| 国内精品国产成人国产三级粉色| 日韩欧美国产电影| 久久精工是国产品牌吗| 欧美一区二区在线不卡| 日韩av网站在线观看| 日韩一区二区三区av| 久久99国产精品久久99果冻传媒| 欧美不卡一二三| 7777精品伊人久久久大香线蕉| 国产精品久久久久影院亚瑟| 丁香桃色午夜亚洲一区二区三区| 久久久久久电影| 成人午夜视频在线观看| 国产日韩视频一区二区三区| 日本亚洲天堂网| 91色视频在线| 一区二区三国产精华液| 欧美在线观看视频在线| 亚洲第一成年网| 欧美成人一级视频| 国产一本一道久久香蕉| 国产欧美一区二区三区鸳鸯浴 | 亚洲电影在线免费观看| 欧美精品九九99久久| 免费看黄色91| 国产精品女同互慰在线看| 成人福利视频网站| 亚洲国产日韩av| 欧美成人伊人久久综合网| 国模少妇一区二区三区| 亚洲视频一区二区在线观看| 欧洲一区二区av| 久久精品国产77777蜜臀| 久久久久久99久久久精品网站| 成人综合激情网| 午夜激情综合网| 久久免费电影网| 91激情在线视频| 狠狠色综合日日| 亚洲精品免费在线播放| 日韩天堂在线观看| 色呦呦一区二区三区| 美脚の诱脚舐め脚责91| 国产精品免费免费| 日韩三级精品电影久久久| 国产成人在线免费观看| 亚洲永久精品大片| 国产欧美精品区一区二区三区| 92国产精品观看| 国产一区91精品张津瑜| 亚洲自拍都市欧美小说| 欧美韩日一区二区三区| 欧美色视频一区| 99久久婷婷国产综合精品电影| 蜜桃视频在线一区| 亚洲一区视频在线| 国产精品欧美一区喷水| 欧美电视剧在线观看完整版| 91浏览器在线视频| 粉嫩欧美一区二区三区高清影视| 亚洲地区一二三色| 亚洲视频免费在线| 国产欧美精品一区二区色综合 | 麻豆免费精品视频| 亚洲综合久久av| 亚洲色图在线播放| 亚洲国产精品成人综合色在线婷婷| 欧美一级黄色录像| 欧美片网站yy| 欧美视频一区二区三区四区 | 国产一区二区三区免费| 日本网站在线观看一区二区三区| 亚洲精品一二三区| 亚洲欧洲国产日本综合| 亚洲国产成人一区二区三区| 精品欧美一区二区在线观看| 欧美午夜在线观看| 91国偷自产一区二区开放时间 | 91麻豆精品国产自产在线观看一区 | 欧美影院午夜播放| 91亚洲国产成人精品一区二区三| 国产永久精品大片wwwapp| 蜜桃视频一区二区三区| 男男视频亚洲欧美| 蜜臀91精品一区二区三区| 日韩黄色一级片| 久久超碰97中文字幕| 蜜桃在线一区二区三区| 另类小说图片综合网| 精品在线你懂的| 国产精品69久久久久水密桃| 蜜桃av一区二区| 国产一区二区精品久久| 国内精品免费在线观看| 国产精品888| 99re这里只有精品视频首页| 99vv1com这只有精品| 91久久精品网| 欧美一区二区三区在线视频| 欧美一区二区三区在线观看 | 成人免费一区二区三区视频| 国产精品久久久久9999吃药| 中文字幕一区在线| 亚洲线精品一区二区三区| 日韩av电影免费观看高清完整版在线观看| 青青青伊人色综合久久| 国内欧美视频一区二区| heyzo一本久久综合| 欧美中文字幕一区二区三区亚洲| 欧美乱妇23p| 91视视频在线直接观看在线看网页在线看| 欧美三级电影网| 欧美一区二区视频观看视频| 欧美一区二区三区男人的天堂| www日韩大片| 亚洲欧美激情小说另类| 香蕉久久夜色精品国产使用方法 | 亚洲国产成人av网| 精品亚洲国内自在自线福利| 大尺度一区二区| 91精品欧美综合在线观看最新| 久久久久一区二区三区四区| 亚洲欧美另类图片小说| 美女视频网站久久| 色综合中文字幕| 亚洲精品一区在线观看| 亚洲欧美怡红院| 韩国一区二区在线观看| 91女神在线视频| 久久久综合激的五月天| 亚洲情趣在线观看| 国产一区二区按摩在线观看| 国产精品欧美一区喷水| 1024亚洲合集| 青青草视频一区| 99精品桃花视频在线观看| 日韩午夜在线观看视频| 亚洲精品国久久99热| 国产成人精品免费网站| 欧美三级在线播放| 日韩理论片中文av| 国内国产精品久久| 91精品国产乱| 亚洲午夜电影网| 99国产精品久久| 国产精品美女久久久久aⅴ国产馆| 丝袜脚交一区二区| 色一情一乱一乱一91av| 国产欧美日韩视频一区二区| 青青国产91久久久久久| 欧美三级资源在线| 有坂深雪av一区二区精品| 成人综合日日夜夜| 国产区在线观看成人精品| 久久精品国产99国产精品| 欧美另类久久久品| 亚洲成人av电影在线| av一区二区不卡| 中文字幕日韩欧美一区二区三区| 国产一区二区三区在线观看免费视频 | 亚洲影院在线观看| 色综合欧美在线视频区| 亚洲欧洲精品天堂一级 | 亚洲女同ⅹxx女同tv| 成人免费毛片aaaaa**| 精品处破学生在线二十三| 日日夜夜精品视频免费| 欧美日韩在线观看一区二区 | 国产欧美日韩另类一区| 国模冰冰炮一区二区| 亚洲精品一区二区三区在线观看| 日本 国产 欧美色综合| 欧美一区三区二区|