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

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

?? gf2ex.txt

?? 大數運算類
?? TXT
?? 第 1 頁 / 共 2 頁
字號:

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

MODULE: GF2EX

SUMMARY:

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

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

#include <NTL/GF2E.h>
#include <NTL/vec_GF2E.h>

class GF2EX {
public:

   GF2EX(); // initial value 0

   GF2EX(const GF2EX& a); // copy

   GF2EX& operator=(const GF2EX& a); // assignment
   GF2EX& operator=(const GF2E& a);
   GF2EX& operator=(GF2 a);
   GF2EX& operator=(long a);

   ~GF2EX(); // destructor

   GF2EX(long i, const GF2E& c); // initilaize to X^i*c
   GF2EX(long i, GF2 c); 
   GF2EX(long i, long c); 

   
};






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

                                  Comparison

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


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

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

// PROMOTIONS: ==, != promote {long,GF2,GF2E} to GF2EX on (a, b).

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

                                   Addition

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

// operator notation:

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

GF2EX& operator+=(GF2EX& x, const GF2EX& a);
GF2EX& operator+=(GF2EX& x, const GF2E& a);
GF2EX& operator+=(GF2EX& x, GF2 a);
GF2EX& operator+=(GF2EX& x, long a);


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

GF2EX& operator-=(GF2EX& x, const GF2EX& a);
GF2EX& operator-=(GF2EX& x, const GF2E& a);
GF2EX& operator-=(GF2EX& x, GF2 a);
GF2EX& operator-=(GF2EX& x, long a);

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

// procedural versions:

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

// PROMOTIONS: +, -, add, sub promote {long,GF2,GF2E} to GF2EX on (a, b).



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

                               Multiplication

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

// operator notation:

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

GF2EX& operator*=(GF2EX& x, const GF2EX& a);
GF2EX& operator*=(GF2EX& x, const GF2E& a);
GF2EX& operator*=(GF2EX& x, GF2 a);
GF2EX& operator*=(GF2EX& x, long a);


// procedural versions:


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

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

// PROMOTIONS: *, mul promote {long,GF2,GF2E} to GF2EX on (a, b).

void power(GF2EX& x, const GF2EX& a, long e);  // x = a^e (e >= 0)
GF2EX power(const GF2EX& 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:

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

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

// procedural versions:

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

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



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

                                  Division

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

// operator notation:

GF2EX operator/(const GF2EX& a, const GF2EX& b);
GF2EX operator/(const GF2EX& a, const GF2E& b);
GF2EX operator/(const GF2EX& a, GF2 b);
GF2EX operator/(const GF2EX& a, long b);

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

GF2EX& operator/=(GF2EX& x, const GF2EX& a);
GF2EX& operator/=(GF2EX& x, const GF2E& a);
GF2EX& operator/=(GF2EX& x, GF2 a);
GF2EX& operator/=(GF2EX& x, long a);

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

// procedural versions:


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

void div(GF2EX& q, const GF2EX& a, const GF2EX& b);
void div(GF2EX& q, const GF2EX& a, const GF2E& b);
void div(GF2EX& q, const GF2EX& a, GF2 b);
void div(GF2EX& q, const GF2EX& a, long b);
// q = a/b

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

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

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


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

                                   GCD's

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

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


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


void XGCD(GF2EX& d, GF2EX& s, GF2EX& t, const GF2EX& a, const GF2EX& 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 < GF2E::degree() and
a_n not zero (the zero polynomial is [ ]).  On input, the coefficients
are arbitrary polynomials which are reduced modulo GF2E::modulus(), and leading
zeros stripped.

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

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


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

                              Some utility routines

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void VectorCopy(vec_GF2E& x, const GF2EX& a, long n);
vec_GF2E VectorCopy(const GF2EX& 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(GF2EX& x, long n);
GF2EX random_GF2EX(long n);
// x = random polynomial of degree < n 


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

                    Polynomial Evaluation and related problems

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


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

void eval(GF2E& b, const GF2EX& f, const GF2E& a);
GF2E eval(const GF2EX& f, const GF2E& a);
// b = f(a)

void eval(GF2E& b, const GF2X& f, const GF2E& a);
GF2E eval(const GF2EX& f, const GF2E& a);
// b = f(a); uses ModComp algorithm for GF2X

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

void interpolate(GF2EX& f, const vec_GF2E& a, const vec_GF2E& b);
GF2EX interpolate(const vec_GF2E& a, const vec_GF2E& 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(GF2EX& x, const GF2EX& a, long n); // x = a % X^n
GF2EX trunc(const GF2EX& a, long n); 

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

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

void InvTrunc(GF2EX& x, const GF2EX& a, long n);
GF2EX InvTrunc(GF2EX& x, const GF2EX& 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
GF2EXModulus data structure and associated routines below for better
performance.

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

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

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

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

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

long InvModStatus(GF2EX& x, const GF2EX& a, const GF2EX& 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
GF2EXModulus 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/GF2EX.h>

void product(GF2EX& x, const vec_GF2EX& v, const GF2EX& f)
{
   GF2EXModulus F(f);
   GF2EX 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一区二区三区免费野_久草精品视频
久久久99久久| 日韩精品一区二区三区视频播放 | 欧美剧在线免费观看网站| 国产ts人妖一区二区| 亚洲精品水蜜桃| 日韩精品一区在线观看| 欧美色图第一页| 91一区二区在线观看| 久久国产夜色精品鲁鲁99| 国产一区二区三区久久久| 一本色道久久综合亚洲精品按摩| 蜜臀精品一区二区三区在线观看| 香蕉久久一区二区不卡无毒影院 | 麻豆91精品视频| 亚洲一区二区三区在线播放 | 丁香天五香天堂综合| 狠狠色狠狠色综合| 开心九九激情九九欧美日韩精美视频电影| 国产欧美一区二区在线观看| 在线观看91av| 日韩一区二区免费在线观看| 欧美日本不卡视频| 欧美视频三区在线播放| 欧美在线观看一区| 国产一区啦啦啦在线观看| 国产欧美日韩卡一| 欧美一区二区在线观看| 精品国产免费视频| 9191久久久久久久久久久| 欧美日韩国产影片| 国产日产精品1区| 日产国产高清一区二区三区| 高清国产午夜精品久久久久久| 日本伦理一区二区| 日本一区二区三区电影| 麻豆精品精品国产自在97香蕉| 99久久久精品| 国产日韩欧美麻豆| 蜜桃91丨九色丨蝌蚪91桃色| 欧美色精品天天在线观看视频| 国产精品麻豆99久久久久久| 激情综合色丁香一区二区| 日韩免费福利电影在线观看| 国产·精品毛片| 欧美丝袜自拍制服另类| 欧美成人精精品一区二区频| 亚洲欧美自拍偷拍| 老汉av免费一区二区三区| 91麻豆蜜桃一区二区三区| 欧美一区二区视频在线观看| 中文字幕一区二区5566日韩| 日韩欧美在线影院| 国产精品二区一区二区aⅴ污介绍| 亚洲一区二区精品3399| 成人动漫在线一区| 精品国产一区二区三区忘忧草| 一区二区欧美在线观看| 白白色 亚洲乱淫| 国产欧美日产一区| 国产一区二区久久| 欧美tickling挠脚心丨vk| 亚洲一本大道在线| 色综合久久中文字幕综合网 | 色婷婷精品大在线视频| wwwwww.欧美系列| 韩国成人在线视频| 欧美精品一区二区三区视频| 麻豆精品视频在线| 精品日韩99亚洲| 另类专区欧美蜜桃臀第一页| 欧美一区二视频| 免费成人在线观看视频| 91麻豆精品国产91久久久久久| 香港成人在线视频| 91麻豆精品国产自产在线观看一区| 亚洲一二三四在线观看| 欧美亚洲国产一卡| 日韩va欧美va亚洲va久久| 日韩欧美国产一区二区在线播放| 蜜臀av性久久久久av蜜臀妖精 | av中文字幕一区| 成人欧美一区二区三区1314| 91久久精品一区二区| 午夜精品久久久久久久| 欧美va亚洲va| 日本伦理一区二区| 日韩av在线播放中文字幕| 久久综合九色综合欧美就去吻| 国产精品亚洲视频| 亚洲人成网站影音先锋播放| 欧美精品一级二级| 六月丁香婷婷色狠狠久久| 国产精品久久久久影院亚瑟 | 一区二区三区中文在线观看| 9191国产精品| 91一区在线观看| 九色综合国产一区二区三区| 亚洲天堂成人在线观看| 日韩一级完整毛片| 色噜噜夜夜夜综合网| 极品少妇xxxx精品少妇偷拍| 亚洲日本在线天堂| xnxx国产精品| 欧美人妇做爰xxxⅹ性高电影| 国产成人h网站| 91蜜桃网址入口| 国产日韩精品一区二区浪潮av| 色狠狠综合天天综合综合| 国产一区二区不卡| 免费成人美女在线观看.| 欧美激情一区二区| 欧美电影免费观看高清完整版在线观看 | 在线电影院国产精品| 91性感美女视频| 丰满亚洲少妇av| 国产福利91精品一区二区三区| 天天综合色天天综合色h| 亚洲人xxxx| 一区二区三区四区不卡在线| 综合精品久久久| 中文字幕一区不卡| 国产精品伦一区二区三级视频| 国产日韩欧美在线一区| 久久久不卡网国产精品一区| 精品国内二区三区| 337p亚洲精品色噜噜噜| 91精品国产综合久久久久久久| 欧美三电影在线| 日韩一级片网址| 欧美一二三区精品| 欧美日韩中文一区| 精品美女被调教视频大全网站| 欧美大黄免费观看| 26uuu色噜噜精品一区二区| 国产日韩欧美电影| 一区二区三区中文字幕电影| 国产麻豆欧美日韩一区| 亚洲国产一区二区在线播放| 一区二区高清视频在线观看| 亚洲五月六月丁香激情| 久久精品国产99久久6| 国产精品一区二区91| 91免费视频大全| 欧美va亚洲va香蕉在线| 成人欧美一区二区三区白人 | 88在线观看91蜜桃国自产| 欧美电影精品一区二区| 国产精品久久看| 麻豆精品视频在线观看免费| 9l国产精品久久久久麻豆| 欧美老年两性高潮| 综合久久国产九一剧情麻豆| 日韩**一区毛片| 色偷偷久久人人79超碰人人澡| 日韩精品一区二区三区四区| 一区二区三区在线观看视频| 国产麻豆一精品一av一免费 | 亚洲国产激情av| 日本亚洲一区二区| 欧美一级理论性理论a| 欧美一区欧美二区| 亚洲午夜视频在线观看| 成人网页在线观看| 欧美日韩一区精品| 亚洲综合在线观看视频| 成人视屏免费看| 精品国一区二区三区| 五月激情综合网| 在线免费av一区| 亚洲一区二区三区爽爽爽爽爽| 国产.欧美.日韩| 国产欧美日韩视频在线观看| 国产一区二区免费看| 日韩三级视频在线看| 一区二区欧美国产| 欧美午夜精品久久久久久超碰| 亚洲欧美色图小说| 97超碰欧美中文字幕| 亚洲欧美国产毛片在线| 色诱亚洲精品久久久久久| 亚洲免费观看高清完整版在线观看| 成人高清av在线| 一区二区三区日韩精品| 91传媒视频在线播放| 日本不卡视频在线| 欧美一区二区三区在线观看 | 亚洲精品在线一区二区| 狠狠色丁香婷婷综合久久片| 久久久电影一区二区三区| 九色综合狠狠综合久久| 中文字幕中文字幕一区| 91国偷自产一区二区开放时间| 亚洲高清免费在线| 91精品国产欧美一区二区成人| 国产一区二区福利| 亚洲一区二区3| 亚洲精品在线三区| 91福利小视频| 麻豆精品国产91久久久久久| 26uuu精品一区二区三区四区在线|