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

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

?? gf2ex.txt

?? 大數(shù)運算類
?? 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一区二区三区免费野_久草精品视频
制服丝袜av成人在线看| 日韩欧美一区二区久久婷婷| 欧美日韩在线播放一区| 欧美日韩国产精品自在自线| 久久精品视频在线看| 亚洲一线二线三线视频| 国产电影一区在线| 欧美日本视频在线| 亚洲mv在线观看| 色一情一伦一子一伦一区| 中日韩av电影| 成人免费毛片a| 久久久久久日产精品| 亚洲第一电影网| 欧美一卡二卡三卡| 国产精品亚洲综合一区在线观看| 国产亚洲1区2区3区| 成人av午夜电影| 亚洲欧洲三级电影| 欧美日韩大陆在线| 久久国产精品第一页| 精品国产91洋老外米糕| av一本久道久久综合久久鬼色| 久久综合色一综合色88| 高清av一区二区| 亚洲精品国产一区二区精华液| 欧美综合天天夜夜久久| 久久不见久久见免费视频1| 专区另类欧美日韩| 懂色av噜噜一区二区三区av| 中文字幕免费在线观看视频一区| 91激情五月电影| 国内久久精品视频| 一区二区国产盗摄色噜噜| 日韩视频国产视频| 91麻豆.com| 国内外成人在线视频| 日韩一区二区三区免费看 | 成人av资源站| 五月天一区二区| 亚洲欧美日韩国产另类专区| 日韩精品一区二| 色综合久久久久综合| 国产成人亚洲综合a∨猫咪| 亚洲男人天堂av| 亚洲日本va午夜在线影院| 国产欧美日韩卡一| 欧美一级淫片007| 欧美亚洲一区二区在线| 成人美女视频在线观看18| 国产一区在线看| 美女视频网站黄色亚洲| 欧美少妇xxx| 成+人+亚洲+综合天堂| 天堂影院一区二区| 亚洲一区免费观看| 亚洲成人久久影院| 亚洲欧美日本在线| 一区二区三区不卡视频| 欧美成人综合网站| 欧美成人艳星乳罩| 欧美视频一区二区三区| 91国内精品野花午夜精品| 狠狠狠色丁香婷婷综合久久五月| 免费久久99精品国产| 麻豆国产一区二区| 免费观看日韩av| 激情小说欧美图片| 99久久99久久免费精品蜜臀| 色综合久久99| 日韩一二在线观看| 国产三级欧美三级| 亚洲一区二区欧美| 蜜桃视频一区二区| 国产不卡高清在线观看视频| 91尤物视频在线观看| 欧美午夜精品久久久久久超碰 | 久久综合九色综合97婷婷| 久久久精品日韩欧美| 亚洲精品在线观看视频| 一区二区三区免费看视频| 老司机免费视频一区二区| 成人黄色av电影| 欧美人与z0zoxxxx视频| 久久久噜噜噜久噜久久综合| 午夜久久久久久久久久一区二区| 视频精品一区二区| 青椒成人免费视频| 色噜噜狠狠色综合欧洲selulu| 日韩一区二区三区免费看| 一区二区不卡在线播放| 国产成人h网站| 91精品国产综合久久久久| 中文字幕在线不卡| 天堂精品中文字幕在线| 一本到一区二区三区| 中文字幕制服丝袜成人av| 久久99精品国产麻豆婷婷 | 久久综合精品国产一区二区三区| 亚洲影视资源网| 欧美在线不卡视频| 一区二区三区资源| 91国偷自产一区二区三区观看| 国产精品国产自产拍高清av| 国产成人av自拍| 国产精品免费视频网站| 成人国产精品免费观看动漫| 中文字幕av一区二区三区免费看| 黑人精品欧美一区二区蜜桃| 欧美精品久久天天躁| 亚洲天堂免费在线观看视频| 国产精品99久久久久久久女警| 国产亚洲精品福利| 不卡欧美aaaaa| 一区二区三区欧美在线观看| 欧美在线999| 日韩在线播放一区二区| 日韩亚洲国产中文字幕欧美| 久久99精品国产| 中文字幕视频一区| 色播五月激情综合网| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美日韩一区不卡| 青青草97国产精品免费观看无弹窗版| 欧美二区在线观看| 波多野结衣91| 老司机午夜精品99久久| 国产欧美一区二区精品秋霞影院| 亚洲va欧美va人人爽午夜| 久久久久国产精品厨房| 91国偷自产一区二区三区成为亚洲经典 | 色一区在线观看| 国产精品拍天天在线| 在线观看视频欧美| 成人国产亚洲欧美成人综合网 | 在线不卡欧美精品一区二区三区| 久久精品国产秦先生| 欧美精品一区二区三区蜜桃视频 | 这里只有精品视频在线观看| 老司机一区二区| 一区二区在线观看免费| 欧美经典三级视频一区二区三区| 欧美日韩视频在线观看一区二区三区 | 视频精品一区二区| 九九国产精品视频| 免费观看一级特黄欧美大片| 国产欧美日韩激情| 麻豆一区二区在线| 91精品国产综合久久小美女| 日本高清成人免费播放| 国产剧情一区二区| 美女网站色91| 看片网站欧美日韩| 国产麻豆视频一区| 欧美96一区二区免费视频| 婷婷成人综合网| 丝袜亚洲另类丝袜在线| 亚洲成人精品在线观看| 午夜亚洲国产au精品一区二区| 亚洲人妖av一区二区| 亚洲欧美日本韩国| 亚洲成人免费观看| 久色婷婷小香蕉久久| 久久99精品一区二区三区| 久久国产精品99久久人人澡| 日本不卡在线视频| 国产一区二区调教| 成人午夜av在线| 欧美视频日韩视频在线观看| 91麻豆精品国产91| 精品噜噜噜噜久久久久久久久试看 | 亚洲二区在线视频| 蜜臀精品久久久久久蜜臀| 久久99热国产| jizzjizzjizz欧美| 在线不卡欧美精品一区二区三区| 久久久一区二区三区捆绑**| 最新国产精品久久精品| 激情成人午夜视频| 欧美性受xxxx| 国产精品久久久久天堂| 亚洲婷婷在线视频| 国产一区二区三区四| 色婷婷综合久久久| 中文在线资源观看网站视频免费不卡 | 色哟哟一区二区| 国产精品久久一卡二卡| 蜜臀精品一区二区三区在线观看| 国产v综合v亚洲欧| 在线观看免费成人| 中文字幕一区二区不卡| 久久国产精品99久久久久久老狼| 一本到不卡精品视频在线观看| 久久精品人人做人人综合| 国产麻豆一精品一av一免费 | 制服丝袜中文字幕一区| 一片黄亚洲嫩模| 不卡视频一二三四| 亚洲精品乱码久久久久久久久| 国产成人亚洲综合色影视|