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

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

?? gf2x.txt

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

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

MODULE: GF2X

SUMMARY:

The class GF2X implements polynomial arithmetic modulo 2.

Polynomial arithmetic is implemented using a combination of classical
routines and Karatsuba.

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

#include <NTL/GF2.h>
#include <NTL/vec_GF2.h>

class GF2X {
public:

   GF2X(); // initial value 0

   GF2X(const GF2X& a); // copy

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

   ~GF2X(); // destructor

   GF2X(long i, GF2 c); // initialize to X^i*c
   GF2X(long i, long c); 
   
};


// SIZE INVARIANT: for any f in GF2X, def(f)+1 < 2^(NTL_BITS_PER_LONG-4).



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

                                  Comparison

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


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

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

// PROMOTIONS: operators ==, != promote {long, GF2} to GF2X on (a, b)


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

                                   Addition

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

// operator notation:

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

GF2X operator-(const GF2X& a); // unary -

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

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

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

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

// procedural versions:


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

// PROMOTIONS: binary +, - and procedures add, sub promote {long, GF2}
// to GF2X on (a, b).


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

                               Multiplication

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

// operator notation:

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

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

// procedural versions:

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

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

// PROMOTIONS: operator * and procedure mul promote {long, GF2} to GF2X
// on (a, b).


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

                               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:

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

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

// procedural versions:

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

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

void MulByX(GF2X& x, const GF2X& a); 
GF2X MulByX(const GF2X& a); 


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

                                  Division

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

// operator notation:

GF2X operator/(const GF2X& a, const GF2X& b);
GF2X operator%(const GF2X& a, const GF2X& b);

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

GF2X& operator%=(GF2X& x, const GF2X& b);


// procedural versions:


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

void div(GF2X& q, const GF2X& a, const GF2X& b);
// q = a/b

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

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

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

// PROMOTIONS: operator / and procedure div promote {long, GF2} to GF2X
// on (a, b).


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

                                   GCD's

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


void GCD(GF2X& x, const GF2X& a, const GF2X& b);
GF2X GCD(const GF2X& a, const GF2X& b); 
// x = GCD(a, b) (zero if a==b==0).


void XGCD(GF2X& d, GF2X& s, GF2X& t, const GF2X& a, const GF2X& 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 0 or 1, and
a_n not zero (the zero polynomial is [ ]).  On input, the coefficients
may be arbitrary integers which are reduced modulo 2, and leading zeros
stripped.

There is also a more compact hex I/O format.  To output in this
format, set GF2X::HexOutput to a nonzero value.  On input, if the first
non-blank character read is 'x' or 'X', then a hex format is assumed.


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

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


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

                              Some utility routines

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

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

GF2 coeff(const GF2X& a, long i);
// returns the coefficient of X^i, or zero if i not in range

GF2 LeadCoeff(const GF2X& a);
// returns leading term of a, or zero if a == 0

GF2 ConstTerm(const GF2X& a);
// returns constant term of a, or zero if a == 0

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

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

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

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

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


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

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

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


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

// Note that there is also a conversion routine from GF2X to vec_GF2
// that makes the length of the vector match the number of coefficients
// of the polynomial.

long weight(const GF2X& a);
// returns the # of nonzero coefficients in a

void GF2XFromBytes(GF2X& x, const unsigned char *p, long n);
GF2X GF2XFromBytes(const unsigned char *p, long n);
// conversion from byte vector to polynomial.
// x = sum(p[i]*X^(8*i), i = 0..n-1), where the bits of p[i] are interpretted
// as a polynomial in the natural way (i.e., p[i] = 1 is interpretted as 1,
// p[i] = 2 is interpretted as X, p[i] = 3 is interpretted as X+1, etc.).
// In the unusual event that characters are wider than 8 bits,
// only the low-order 8 bits of p[i] are used.

void BytesFromGF2X(unsigned char *p, const GF2X& a, long n);
// conversion from polynomial to byte vector.
// p[0..n-1] are computed so that 
//     a = sum(p[i]*X^(8*i), i = 0..n-1) mod X^(8*n),
// where the values p[i] are interpretted as polynomials as in GF2XFromBytes
// above.

long NumBits(const GF2X& a);
// returns number of bits of a, i.e., deg(a) + 1.

long NumBytes(const GF2X& a);
// returns number of bytes of a, i.e., floor((NumBits(a)+7)/8)




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

                             Random Polynomials

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

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



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

                       Arithmetic mod X^n

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

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

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

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

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

void InvTrunc(GF2X& x, const GF2X& a, long n);
GF2X InvTrunc(const GF2X& a, long n);
// computes x = a^{-1} % X^n.  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
GF2XModulus data structure and associated routines below for better
performance.

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

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

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

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

void InvMod(GF2X& x, const GF2X& a, const GF2X& f);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本中文一区二区三区| 久久精品国产一区二区三| 欧美日韩精品系列| 成人性生交大片免费看在线播放| 亚洲免费在线观看视频| 日韩亚洲欧美一区| av日韩在线网站| 精品一区二区免费视频| 一区二区三区在线看| 久久综合九色综合97婷婷女人 | 亚洲综合一二三区| 久久久久国产成人精品亚洲午夜| 欧美亚洲国产一区二区三区va| 国产激情一区二区三区四区| 免费在线观看视频一区| 亚洲一区电影777| 国产精品国模大尺度视频| 精品欧美黑人一区二区三区| 在线播放亚洲一区| 欧美亚洲综合久久| 一本大道久久a久久综合婷婷| 激情综合网最新| 日韩av电影免费观看高清完整版 | 欧美经典三级视频一区二区三区| 欧美丰满少妇xxxxx高潮对白 | 国产成人午夜精品影院观看视频| 蜜臀91精品一区二区三区| 亚洲成人高清在线| 亚洲国产精品尤物yw在线观看| 日韩一区在线免费观看| 欧美国产一区在线| 亚洲国产精品t66y| 国产精品久久久久影院老司| 久久久精品免费观看| 精品国产sm最大网站| 精品日韩99亚洲| 精品国产伦一区二区三区观看方式| 欧美高清激情brazzers| 在线91免费看| 欧美一级欧美一级在线播放| 欧美日韩成人在线| 欧美日韩综合在线免费观看| 欧美亚洲综合另类| 欧美精品三级日韩久久| 欧美高清激情brazzers| 日韩三级伦理片妻子的秘密按摩| 欧美一区二区三区成人| 日韩一卡二卡三卡| 精品国产亚洲在线| 国产日韩欧美一区二区三区乱码 | 亚洲午夜免费福利视频| 亚洲国产一区视频| 性做久久久久久久久| 五月天一区二区三区| 日韩av一级电影| 极品尤物av久久免费看| 国产成人午夜精品5599| 99精品偷自拍| 欧美日韩一级二级三级| 日韩一区二区在线观看视频| 精品久久久久久最新网址| 久久久亚洲欧洲日产国码αv| 国产精品拍天天在线| 亚洲欧美经典视频| 天堂va蜜桃一区二区三区漫画版 | 国产电影一区二区三区| 99re亚洲国产精品| 欧美三片在线视频观看| 久久综合九色欧美综合狠狠| 国产精品水嫩水嫩| 亚洲国产视频一区| 久久99精品久久久久久久久久久久| 国产一区二区电影| 在线亚洲人成电影网站色www| 欧美精品久久久久久久多人混战 | 国产三级久久久| 有码一区二区三区| 麻豆精品视频在线观看免费| 国产999精品久久久久久绿帽| 色综合欧美在线视频区| 欧美成人精品福利| 最近日韩中文字幕| 美女www一区二区| av不卡在线观看| 欧美一区二区在线观看| 国产精品亲子乱子伦xxxx裸| 婷婷国产在线综合| 粉嫩嫩av羞羞动漫久久久| 欧美日韩午夜影院| 国产偷国产偷亚洲高清人白洁 | 美女脱光内衣内裤视频久久网站 | 国产一区二区三区高清播放| zzijzzij亚洲日本少妇熟睡| 欧美美女喷水视频| 国产精品电影一区二区| 蜜桃久久久久久| 色综合天天综合网天天狠天天| 欧美一区二区三区婷婷月色 | 亚洲国产视频网站| eeuss鲁片一区二区三区在线看| 欧美肥妇bbw| 一区二区三区小说| 国产成人av一区二区| 777a∨成人精品桃花网| 国产精品久久久久久户外露出 | 午夜精品aaa| 99精品偷自拍| 欧美国产日韩精品免费观看| 日本成人中文字幕在线视频| 91美女视频网站| 久久久高清一区二区三区| 午夜免费久久看| 色综合夜色一区| 中文字幕一区在线观看| 国产一区 二区 三区一级| 欧美丰满一区二区免费视频| 一区二区三区精品视频| www.在线欧美| 国产精品毛片大码女人| 国产馆精品极品| 久久久99精品久久| 国内精品久久久久影院薰衣草| 欧美日韩第一区日日骚| 亚洲国产欧美一区二区三区丁香婷| www.日韩在线| 国产精品乱人伦一区二区| 国产一区二区女| 337p日本欧洲亚洲大胆精品| 日本成人在线不卡视频| 91精品一区二区三区在线观看| 亚洲图片欧美综合| 欧美日韩性生活| 午夜精品福利一区二区三区av| 欧美日韩一区 二区 三区 久久精品| 亚洲日本一区二区三区| 色综合激情五月| 亚洲精品乱码久久久久久黑人| 99riav久久精品riav| 国产精品国产三级国产aⅴ原创| 盗摄精品av一区二区三区| 中文字幕国产一区| av一区二区久久| 一区二区三区在线免费播放| 在线欧美一区二区| 亚洲大片免费看| 91精品久久久久久蜜臀| 男女性色大片免费观看一区二区| 91精品国产高清一区二区三区| 免费三级欧美电影| 久久精品一区四区| www.日韩av| 亚洲国产成人91porn| 91精品国产丝袜白色高跟鞋| 麻豆国产一区二区| 久久久久综合网| av激情成人网| 爽爽淫人综合网网站| 精品乱人伦小说| 成人国产精品免费观看动漫| 亚洲欧洲在线观看av| 欧洲日韩一区二区三区| 日韩国产在线观看| 久久精品夜色噜噜亚洲aⅴ| 不卡影院免费观看| 亚洲成人激情av| 久久在线观看免费| 91麻豆产精品久久久久久| 亚洲成人综合网站| 精品播放一区二区| 91小宝寻花一区二区三区| 亚洲午夜在线视频| 久久夜色精品一区| 色呦呦国产精品| 久久精品国产一区二区三| 国产精品免费久久| 欧美日韩成人综合天天影院| 国产乱子轮精品视频| 亚洲视频一二三区| 日韩欧美精品在线视频| 成人av在线一区二区三区| 亚洲成人av电影在线| 国产三级精品视频| 欧美日韩国产电影| 成人午夜大片免费观看| 香蕉成人啪国产精品视频综合网| 久久这里只有精品首页| 欧美色手机在线观看| 国产伦精品一区二区三区在线观看| 亚洲精品免费在线观看| 久久男人中文字幕资源站| 日本丶国产丶欧美色综合| 久久99精品国产.久久久久久| 亚洲少妇30p| 久久欧美一区二区| 欧美老年两性高潮| 不卡区在线中文字幕| 麻豆精品在线播放| 亚洲一区av在线| 国产精品久久国产精麻豆99网站| 欧美一区在线视频|