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

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

?? zz_px.h

?? 密碼大家Shoup寫的數論算法c語言實現
?? H
?? 第 1 頁 / 共 3 頁
字號:
/*****************************************************************                        Multiplication******************************************************************/void mul(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b);// x = a * bvoid sqr(ZZ_pX& x, const ZZ_pX& a);inline ZZ_pX sqr(const ZZ_pX& a)   { ZZ_pX x; sqr(x, a); NTL_OPT_RETURN(ZZ_pX, x); }// x = a^2void mul(ZZ_pX & x, const ZZ_pX& a, const ZZ_p& b); void mul(ZZ_pX& x, const ZZ_pX& a, long b);inline void mul(ZZ_pX& x, const ZZ_p& a, const ZZ_pX& b)   { mul(x, b, a); }inline void mul(ZZ_pX& x, long a, const ZZ_pX& b)   { mul(x, b, a); }inline ZZ_pX operator*(const ZZ_pX& a, const ZZ_pX& b)   { ZZ_pX x; mul(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX operator*(const ZZ_pX& a, const ZZ_p& b)   { ZZ_pX x; mul(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX operator*(const ZZ_pX& a, long b)   { ZZ_pX x; mul(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX operator*(const ZZ_p& a, const ZZ_pX& b)   { ZZ_pX x; mul(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX operator*(long a, const ZZ_pX& b)   { ZZ_pX x; mul(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX& operator*=(ZZ_pX& x, const ZZ_pX& b)   { mul(x, x, b); return x; }inline ZZ_pX& operator*=(ZZ_pX& x, const ZZ_p& b)   { mul(x, x, b); return x; }inline ZZ_pX& operator*=(ZZ_pX& x, long b)   { mul(x, x, b); return x; }void PlainMul(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b);// always uses the "classical" algorithmvoid PlainSqr(ZZ_pX& x, const ZZ_pX& a);// always uses the "classical" algorithmvoid FFTMul(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b);// always uses the FFTvoid FFTSqr(ZZ_pX& x, const ZZ_pX& a);// always uses the FFTvoid MulTrunc(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b, long n);// x = a * b % X^ninline ZZ_pX MulTrunc(const ZZ_pX& a, const ZZ_pX& b, long n)   { ZZ_pX x; MulTrunc(x, a, b, n); NTL_OPT_RETURN(ZZ_pX, x); }void PlainMulTrunc(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b, long n);void FFTMulTrunc(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b, long n);void SqrTrunc(ZZ_pX& x, const ZZ_pX& a, long n);// x = a^2 % X^ninline ZZ_pX SqrTrunc(const ZZ_pX& a, long n)   { ZZ_pX x; SqrTrunc(x, a, n); NTL_OPT_RETURN(ZZ_pX, x); }void PlainSqrTrunc(ZZ_pX& x, const ZZ_pX& a, long n);void FFTSqrTrunc(ZZ_pX& x, const ZZ_pX& a, long n);void power(ZZ_pX& x, const ZZ_pX& a, long e);inline ZZ_pX power(const ZZ_pX& a, long e)   { ZZ_pX x; power(x, a, e); NTL_OPT_RETURN(ZZ_pX, x); }// The following data structures and routines allow one// to hand-craft various algorithms, using the FFT convolution// algorithms directly.// Look in the file ZZ_pX.c for examples.// FFT representation of polynomialsclass FFTRep {public:   long k;                // a 2^k point representation   long MaxK;             // maximum space allocated   long **tbl;   long NumPrimes;    void SetSize(long NewK);   FFTRep(const FFTRep& R);   FFTRep& operator=(const FFTRep& R);   FFTRep() { k = MaxK = -1; tbl = 0; NumPrimes = 0; }   FFTRep(INIT_SIZE_TYPE, long InitK)    { k = MaxK = -1; tbl = 0; NumPrimes = 0; SetSize(InitK); }   ~FFTRep();};void ToFFTRep(FFTRep& y, const ZZ_pX& x, long k, long lo, long hi);// computes an n = 2^k point convolution of x[lo..hi].inline void ToFFTRep(FFTRep& y, const ZZ_pX& x, long k)   { ToFFTRep(y, x, k, 0, deg(x)); }void RevToFFTRep(FFTRep& y, const vec_ZZ_p& x,                 long k, long lo, long hi, long offset);// computes an n = 2^k point convolution of X^offset*x[lo..hi] mod X^n-1// using "inverted" evaluation points.void FromFFTRep(ZZ_pX& x, FFTRep& y, long lo, long hi);// converts from FFT-representation to coefficient representation// only the coefficients lo..hi are computed// NOTE: this version destroys the data in y// non-destructive versions of the abovevoid NDFromFFTRep(ZZ_pX& x, const FFTRep& y, long lo, long hi, FFTRep& temp);void NDFromFFTRep(ZZ_pX& x, const FFTRep& y, long lo, long hi);void RevFromFFTRep(vec_ZZ_p& x, FFTRep& y, long lo, long hi);   // converts from FFT-representation to coefficient representation   // using "inverted" evaluation points.   // only the coefficients lo..hi are computedvoid FromFFTRep(ZZ_p* x, FFTRep& y, long lo, long hi);// convert out coefficients lo..hi of y, store result in x.// no normalization is done.// direct manipulation of FFT repsvoid mul(FFTRep& z, const FFTRep& x, const FFTRep& y);void sub(FFTRep& z, const FFTRep& x, const FFTRep& y);void add(FFTRep& z, const FFTRep& x, const FFTRep& y);void reduce(FFTRep& x, const FFTRep& a, long k);// reduces a 2^l point FFT-rep to a 2^k point FFT-repvoid AddExpand(FFTRep& x, const FFTRep& a);//  x = x + (an "expanded" version of a)// This data structure holds unconvoluted modular representations// of polynomialsclass ZZ_pXModRep {private:   ZZ_pXModRep(const ZZ_pXModRep&); // disabled   void operator=(const ZZ_pXModRep&); // disabledpublic:   long n;   long MaxN;   long **tbl;   long NumPrimes;    void SetSize(long NewN);   ZZ_pXModRep() { n = MaxN = 0; tbl = 0; NumPrimes = 0; }   ZZ_pXModRep(INIT_SIZE_TYPE, long k)    { n = MaxN = 0; tbl = 0; NumPrimes = 0; SetSize(k); }   ~ZZ_pXModRep();};void ToZZ_pXModRep(ZZ_pXModRep& x, const ZZ_pX& a, long lo, long hi);void ToFFTRep(FFTRep& x, const ZZ_pXModRep& a, long k, long lo, long hi);// converts coefficients lo..hi to a 2^k-point FFTRep.// must have hi-lo+1 < 2^k/*************************************************************                      Division**************************************************************/void DivRem(ZZ_pX& q, ZZ_pX& r, const ZZ_pX& a, const ZZ_pX& b);// q = a/b, r = a%bvoid div(ZZ_pX& q, const ZZ_pX& a, const ZZ_pX& b);// q = a/bvoid div(ZZ_pX& q, const ZZ_pX& a, const ZZ_p& b);void div(ZZ_pX& q, const ZZ_pX& a, long b);void rem(ZZ_pX& r, const ZZ_pX& a, const ZZ_pX& b);// r = a%blong divide(ZZ_pX& q, const ZZ_pX& a, const ZZ_pX& b);// if b | a, sets q = a/b and returns 1; otherwise returns 0long divide(const ZZ_pX& a, const ZZ_pX& b);// if b | a, sets q = a/b and returns 1; otherwise returns 0void InvTrunc(ZZ_pX& x, const ZZ_pX& a, long m);// computes x = a^{-1} % X^m // constant term must be non-zeroinline ZZ_pX InvTrunc(const ZZ_pX& a, long m)   { ZZ_pX x; InvTrunc(x, a, m); NTL_OPT_RETURN(ZZ_pX, x); }// These always use "classical" arithmeticvoid PlainDivRem(ZZ_pX& q, ZZ_pX& r, const ZZ_pX& a, const ZZ_pX& b);void PlainDiv(ZZ_pX& q, const ZZ_pX& a, const ZZ_pX& b);void PlainRem(ZZ_pX& r, const ZZ_pX& a, const ZZ_pX& b);void PlainRem(ZZ_pX& r, const ZZ_pX& a, const ZZ_pX& b, ZZVec& tmp);void PlainDivRem(ZZ_pX& q, ZZ_pX& r, const ZZ_pX& a, const ZZ_pX& b,                 ZZVec& tmp);// These always use FFT arithmeticvoid FFTDivRem(ZZ_pX& q, ZZ_pX& r, const ZZ_pX& a, const ZZ_pX& b);void FFTDiv(ZZ_pX& q, const ZZ_pX& a, const ZZ_pX& b);void FFTRem(ZZ_pX& r, const ZZ_pX& a, const ZZ_pX& b);void PlainInvTrunc(ZZ_pX& x, const ZZ_pX& a, long m);// always uses "classical" algorithm// ALIAS RESTRICTION: input may not alias outputvoid NewtonInvTrunc(ZZ_pX& x, const ZZ_pX& a, long m);// uses a Newton Iteration with the FFT.// ALIAS RESTRICTION: input may not alias outputinline ZZ_pX operator/(const ZZ_pX& a, const ZZ_pX& b)   { ZZ_pX x; div(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX operator/(const ZZ_pX& a, const ZZ_p& b)   { ZZ_pX x; div(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX operator/(const ZZ_pX& a, long b)   { ZZ_pX x; div(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX& operator/=(ZZ_pX& x, const ZZ_p& b)   { div(x, x, b); return x; }inline ZZ_pX& operator/=(ZZ_pX& x, long b)   { div(x, x, b); return x; }inline ZZ_pX& operator/=(ZZ_pX& x, const ZZ_pX& b)   { div(x, x, b); return x; }inline ZZ_pX operator%(const ZZ_pX& a, const ZZ_pX& b)   { ZZ_pX x; rem(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }inline ZZ_pX& operator%=(ZZ_pX& x, const ZZ_pX& b)   { rem(x, x, b); return x; }/***********************************************************                         GCD's************************************************************/void GCD(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b);// x = GCD(a, b),  x is always monic (or zero if a==b==0).inline ZZ_pX GCD(const ZZ_pX& a, const ZZ_pX& b)   { ZZ_pX x; GCD(x, a, b); NTL_OPT_RETURN(ZZ_pX, x); }void XGCD(ZZ_pX& d, ZZ_pX& s, ZZ_pX& t, const ZZ_pX& a, const ZZ_pX& b);// d = gcd(a,b), a s + b t = d void PlainXGCD(ZZ_pX& d, ZZ_pX& s, ZZ_pX& t, const ZZ_pX& a, const ZZ_pX& b);// same as above, but uses classical algorithmvoid PlainGCD(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b);// always uses "cdlassical" arithmeticclass ZZ_pXMatrix {private:   ZZ_pXMatrix(const ZZ_pXMatrix&);  // disable   ZZ_pX elts[2][2];public:   ZZ_pXMatrix() { }   ~ZZ_pXMatrix() { }   void operator=(const ZZ_pXMatrix&);   ZZ_pX& operator() (long i, long j) { return elts[i][j]; }   const ZZ_pX& operator() (long i, long j) const { return elts[i][j]; }};void HalfGCD(ZZ_pXMatrix& M_out, const ZZ_pX& U, const ZZ_pX& V, long d_red);// deg(U) > deg(V),   1 <= d_red <= deg(U)+1.//// This computes a 2 x 2 polynomial matrix M_out such that//    M_out * (U, V)^T = (U', V')^T,// where U', V' are consecutive polynomials in the Euclidean remainder// sequence of U, V, and V' is the polynomial of highest degree// satisfying deg(V') <= deg(U) - d_red.void XHalfGCD(ZZ_pXMatrix& M_out, ZZ_pX& U, ZZ_pX& V, long d_red);// same as above, except that U is replaced by U', and V by V'/*************************************************************             Modular Arithmetic without pre-conditioning**************************************************************/// arithmetic mod f.// all inputs and outputs are polynomials of degree less than deg(f).// ASSUMPTION: f is assumed monic, and deg(f) > 0.// NOTE: if you want to do many computations with a fixed f,//       use the ZZ_pXModulus data structure and associated routines below.void MulMod(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& b, const ZZ_pX& f);// x = (a * b) % finline ZZ_pX MulMod(const ZZ_pX& a, const ZZ_pX& b, const ZZ_pX& f)   { ZZ_pX x; MulMod(x, a, b, f); NTL_OPT_RETURN(ZZ_pX, x); }void SqrMod(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& f);// x = a^2 % finline ZZ_pX SqrMod(const ZZ_pX& a,  const ZZ_pX& f)   { ZZ_pX x; SqrMod(x, a, f); NTL_OPT_RETURN(ZZ_pX, x); }void MulByXMod(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& f);// x = (a * X) mod finline ZZ_pX MulByXMod(const ZZ_pX& a,  const ZZ_pX& f)   { ZZ_pX x; MulByXMod(x, a, f); NTL_OPT_RETURN(ZZ_pX, x); }void InvMod(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& f);// x = a^{-1} % f, error is a is not invertibleinline ZZ_pX InvMod(const ZZ_pX& a,  const ZZ_pX& f)   { ZZ_pX x; InvMod(x, a, f); NTL_OPT_RETURN(ZZ_pX, x); }long InvModStatus(ZZ_pX& x, const ZZ_pX& a, const ZZ_pX& 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_pXModulus F for f.  This pre-computes information about f// that speeds up the computation a great deal.class ZZ_pXModulus {public:   ZZ_pXModulus() : UseFFT(0), n(-1)  { }   ~ZZ_pXModulus() { }      // the following members may become private in future   ZZ_pX f;   // the modulus   long UseFFT;// flag indicating whether FFT should be used.   long n;     // n = deg(f)   long k;     // least k s/t 2^k >= n   long l;     // least l s/t 2^l >= 2n-3   FFTRep FRep; // 2^k point rep of f                // H = rev((rev(f))^{-1} rem X^{n-1})   FFTRep HRep; // 2^l point rep of H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av一区二区在线免费观看| 国产精品白丝在线| 99国产精品久久| 免费观看日韩电影| 亚洲伊人色欲综合网| 精品福利一二区| 欧美日韩视频专区在线播放| 国产丶欧美丶日本不卡视频| 日本成人超碰在线观看| 亚洲女同一区二区| 中文字幕国产一区| 日韩免费电影网站| 欧美美女直播网站| 99久久久久久| 成人污污视频在线观看| 极品尤物av久久免费看| 日韩激情一区二区| 亚洲成人精品一区| 一区二区三区在线看| |精品福利一区二区三区| 久久蜜桃一区二区| 精品免费99久久| 日韩欧美中文一区二区| 欧美日韩精品一区二区三区蜜桃 | 国产91丝袜在线播放0| 免费成人在线观看视频| 亚洲不卡一区二区三区| 亚洲一区二区三区三| 亚洲欧美日韩在线播放| 最新国产成人在线观看| 中文字幕一区在线观看| 中文字幕av在线一区二区三区| 26uuu国产一区二区三区| 日韩一区二区免费视频| 日韩视频免费观看高清在线视频| 在线播放中文字幕一区| 欧美一区二区免费观在线| 欧美精品1区2区3区| 91精品国产91综合久久蜜臀| 在线不卡中文字幕播放| 69精品人人人人| 91麻豆精品国产自产在线观看一区| 欧美日韩国产一二三| 在线播放国产精品二区一二区四区 | 国产精品影视天天线| 国产高清在线精品| www.欧美日韩| 91浏览器在线视频| 欧美日韩视频在线观看一区二区三区 | 最新热久久免费视频| 亚洲黄色片在线观看| 亚洲18女电影在线观看| 日本三级亚洲精品| 精品一二三四区| 丁香婷婷综合激情五月色| 成人国产电影网| 在线观看www91| 日韩午夜三级在线| 国产亚洲欧洲997久久综合| 国产精品免费久久| 亚洲国产成人精品视频| 免费观看成人av| 国产·精品毛片| 在线中文字幕一区| 日韩一级大片在线观看| 久久久久久久久久久久电影| 亚洲欧美一区二区在线观看| 亚洲成人激情自拍| 国产一区二区视频在线播放| 99综合电影在线视频| 欧美色图12p| 久久久久久久久岛国免费| 综合av第一页| 天天影视网天天综合色在线播放 | 国产69精品久久久久毛片| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美日韩一级大片网址| 久久女同精品一区二区| 亚洲专区一二三| 国产一区二区中文字幕| 在线视频一区二区三| 久久综合色天天久久综合图片| 亚洲丝袜另类动漫二区| 极品美女销魂一区二区三区免费| 成人av在线电影| 欧美一级二级在线观看| 日韩理论在线观看| 麻豆精品一区二区三区| 91社区在线播放| 精品国产乱码久久久久久牛牛 | 亚洲午夜一二三区视频| 亚洲成av人影院在线观看网| 久久成人麻豆午夜电影| av在线不卡网| 日韩精品自拍偷拍| 午夜视频在线观看一区| 国产精品一品二品| 91精品国产综合久久香蕉麻豆| 国产亚洲美州欧州综合国| 久久99国产乱子伦精品免费| 亚洲国产精品嫩草影院| 国产成人综合在线观看| 9191精品国产综合久久久久久| 中文字幕色av一区二区三区| 国内精品自线一区二区三区视频| 在线观看欧美日本| 国产精品理论片在线观看| 国产综合色产在线精品| 欧美一区二区三区婷婷月色| 中文字幕日本不卡| 风流少妇一区二区| 久久综合色播五月| 美国十次综合导航| 欧美剧情片在线观看| 亚洲精品大片www| 99精品欧美一区| 国产精品久久久一本精品| 国产精品99久久久| 久久婷婷国产综合精品青草| 久久精品国产99国产| 制服丝袜国产精品| 五月婷婷综合网| 欧洲一区二区三区在线| 亚洲免费观看高清完整版在线观看熊 | 成a人片国产精品| 久久欧美一区二区| 久久99热这里只有精品| 日韩欧美在线影院| 久久精品国产99国产| 精品国产乱码久久久久久1区2区| 免费成人av资源网| 欧美第一区第二区| 麻豆国产欧美日韩综合精品二区| 91精品国产综合久久久久久久久久 | 久久99精品国产麻豆婷婷洗澡| 欧美一区永久视频免费观看| 日韩极品在线观看| 欧美一区二区视频免费观看| 日韩电影在线观看电影| 欧美一级爆毛片| 国内精品国产成人国产三级粉色 | 国产精品盗摄一区二区三区| 99久久国产免费看| 亚洲综合免费观看高清完整版在线 | 日韩一区欧美二区| 日韩精品一区二区三区老鸭窝| 六月丁香婷婷色狠狠久久| 精品国产一区二区三区不卡| 国产一区二区三区观看| 国产午夜精品理论片a级大结局| 成人高清av在线| 亚洲一区视频在线| 日韩午夜激情电影| 国产精品亚洲第一区在线暖暖韩国| 国产亚洲制服色| 日本韩国一区二区三区| 天堂久久一区二区三区| 欧美成人一区二区三区片免费| 国产大片一区二区| 亚洲欧美日韩国产一区二区三区 | 国产九色sp调教91| 国产精品福利在线播放| 欧美色窝79yyyycom| 精品一二三四在线| 成人免费在线播放视频| 欧美精品在线一区二区| 国产一区二区三区不卡在线观看| 国产精品成人在线观看| 555www色欧美视频| 国产xxx精品视频大全| 一区二区成人在线| 精品999在线播放| 色综合久久久久久久久| 另类小说色综合网站| 自拍偷自拍亚洲精品播放| 欧美一区中文字幕| 99国产精品久久久久久久久久| 日韩中文字幕区一区有砖一区| 久久久综合视频| 在线观看亚洲一区| 国产成人在线看| 亚洲.国产.中文慕字在线| 久久久精品人体av艺术| 欧美日韩综合不卡| 国产成人综合在线播放| 亚洲成av人片www| 中文字幕在线一区免费| 7777女厕盗摄久久久| 91在线免费看| 国产美女精品在线| 日本美女视频一区二区| 亚洲精品视频在线| 国产亚洲成aⅴ人片在线观看| 欧美精品久久一区二区三区| 99精品国产视频| 国产一区日韩二区欧美三区| 天天色 色综合| 一区二区三区色| 国产精品情趣视频| 久久综合网色—综合色88|