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

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

?? lzz_px.txt

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


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

class zz_pXModulus {
public:
   zz_pXModulus(); // initially in an unusable state
   ~zz_pXModulus();

   zz_pXModulus(const zz_pXModulus&);  // copy

   zz_pXModulus& operator=(const zz_pXModulus&);  // assignment

   zz_pXModulus(const zz_pX& f); // initialize with f, deg(f) > 0

   operator const zz_pX& () const; 
   // read-only access to f, implicit conversion operator

   const zz_pX& val() const; 
   // read-only access to f, explicit notation

};

void build(zz_pXModulus& F, const zz_pX& f);
// pre-computes information about f and stores it in F.
// Note that the declaration zz_pXModulus F(f) is equivalent to
// zz_pXModulus F; build(F, f).

// In the following, f refers to the polynomial f supplied to the
// build routine, and n = deg(f).

long deg(const zz_pXModulus& F);  // return deg(f)

void MulMod(zz_pX& x, const zz_pX& a, const zz_pX& b, const zz_pXModulus& F);
zz_pX MulMod(const zz_pX& a, const zz_pX& b, const zz_pXModulus& F);
// x = (a * b) % f; deg(a), deg(b) < n

void SqrMod(zz_pX& x, const zz_pX& a, const zz_pXModulus& F);
zz_pX SqrMod(const zz_pX& a, const zz_pXModulus& F);
// x = a^2 % f; deg(a) < n

void PowerMod(zz_pX& x, const zz_pX& a, const ZZ& e, const zz_pXModulus& F);
zz_pX PowerMod(const zz_pX& a, const ZZ& e, const zz_pXModulus& F);

void PowerMod(zz_pX& x, const zz_pX& a, long e, const zz_pXModulus& F);
zz_pX PowerMod(const zz_pX& a, long e, const zz_pXModulus& F);

// x = a^e % f; deg(a) < n (e may be negative)

void PowerXMod(zz_pX& x, const ZZ& e, const zz_pXModulus& F);
zz_pX PowerXMod(const ZZ& e, const zz_pXModulus& F);

void PowerXMod(zz_pX& x, long e, const zz_pXModulus& F);
zz_pX PowerXMod(long e, const zz_pXModulus& F);

// x = X^e % f (e may be negative)

void PowerXPlusAMod(zz_pX& x, const zz_p& a, const ZZ& e, 
                    const zz_pXModulus& F);

zz_pX PowerXPlusAMod(const zz_p& a, const ZZ& e, 
                           const zz_pXModulus& F);

void PowerXPlusAMod(zz_pX& x, const zz_p& a, long e, 
                    const zz_pXModulus& F);

zz_pX PowerXPlusAMod(const zz_p& a, long e, 
                           const zz_pXModulus& F);

// x = (X + a)^e % f (e may be negative)


void rem(zz_pX& x, const zz_pX& a, const zz_pXModulus& F);
// x = a % f

void DivRem(zz_pX& q, zz_pX& r, const zz_pX& a, const zz_pXModulus& F);
// q = a/f, r = a%f

void div(zz_pX& q, const zz_pX& a, const zz_pXModulus& F);
// q = a/f

// operator notation:

zz_pX operator/(const zz_pX& a, const zz_pXModulus& F);
zz_pX operator%(const zz_pX& a, const zz_pXModulus& F);

zz_pX& operator/=(zz_pX& x, const zz_pXModulus& F);
zz_pX& operator%=(zz_pX& x, const zz_pXModulus& F);




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


                        More Pre-Conditioning

If you need to compute a * b % f for a fixed b, but for many a's, it
is much more efficient to first build a zz_pXMultiplier B for b, and
then use the MulMod routine below.

Here is an example that multiplies each element of a vector by a fixed
polynomial modulo f.

#include "zz_pX.h"

void mul(vec_zz_pX& v, const zz_pX& b, const zz_pX& f)
{
   zz_pXModulus F(f);
   zz_pXMultiplier B(b, F);
   long i;
   for (i = 0; i < v.length(); i++)
      MulMod(v[i], v[i], B, F);
}

Note that a (trivial) conversion operator from zz_pXMultiplier to zz_pX
is provided, so that a zz_pXMultiplier can be used in a context
where a zz_pX is required.


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


class zz_pXMultiplier {
public:
   zz_pXMultiplier(); // initially zero

   zz_pXMultiplier(const zz_pX& b, const zz_pXModulus& F);
      // initializes with b mod F, where deg(b) < deg(F)

   zz_pXMultiplier(const zz_pXMultiplier&);
   zz_pXMultiplier& operator=(const zz_pXMultiplier&);

   ~zz_pXMultiplier();

   const zz_pX& val() const; // read-only access to b

};

void build(zz_pXMultiplier& B, const zz_pX& b, const zz_pXModulus& F);
// pre-computes information about b and stores it in B; deg(b) <
// deg(F)

void MulMod(zz_pX& x, const zz_pX& a, const zz_pXMultiplier& B,
                                      const zz_pXModulus& F);

zz_pX MulMod(const zz_pX& a, const zz_pXMultiplier& B, 
             const zz_pXModulus& F);

// x = (a * b) % F; deg(a) < deg(F)

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

                             vectors of zz_pX's

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

NTL_vector_decl(zz_pX,vec_zz_pX)
// vec_zz_pX

NTL_eq_vector_decl(zz_pX,vec_zz_pX)
// == and !=

NTL_io_vector_decl(zz_pX,vec_zz_pX)
// I/O operators


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

                              Modular Composition

Modular composition is the problem of computing g(h) mod f for
polynomials f, g, and h.

The algorithm employed is that of Brent & Kung (Fast algorithms for
manipulating formal power series, JACM 25:581-595, 1978), which uses
O(n^{1/2}) modular polynomial multiplications, and O(n^2) scalar
operations.



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

void CompMod(zz_pX& x, const zz_pX& g, const zz_pX& h, const zz_pXModulus& F);
zz_pX CompMod(const zz_pX& g, const zz_pX& h, const zz_pXModulus& F);
// x = g(h) mod f; deg(h) < n

void Comp2Mod(zz_pX& x1, zz_pX& x2, const zz_pX& g1, const zz_pX& g2,
              const zz_pX& h, const zz_pXModulus& F);
// xi = gi(h) mod f (i=1,2), deg(h) < n.

void CompMod3(zz_pX& x1, zz_pX& x2, zz_pX& x3, 
              const zz_pX& g1, const zz_pX& g2, const zz_pX& g3,
              const zz_pX& h, const zz_pXModulus& F);
// xi = gi(h) mod f (i=1..3), deg(h) < n


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

                     Composition with Pre-Conditioning

If a single h is going to be used with many g's then you should build
a zz_pXArgument for h, and then use the compose routine below.  The
routine build computes and stores h, h^2, ..., h^m mod f.  After this
pre-computation, composing a polynomial of degree roughly n with h
takes n/m multiplies mod f, plus n^2 scalar multiplies.  Thus,
increasing m increases the space requirement and the pre-computation
time, but reduces the composition time.

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


struct zz_pXArgument {
   vec_zz_pX H;
};

void build(zz_pXArgument& H, const zz_pX& h, const zz_pXModulus& F, long m);
// Pre-Computes information about h.  m > 0, deg(h) < n

void CompMod(zz_pX& x, const zz_pX& g, const zz_pXArgument& H, 
             const zz_pXModulus& F);

zz_pX CompMod(const zz_pX& g, const zz_pXArgument& H, 
             const zz_pXModulus& F);


extern long zz_pXArgBound;

// Initially 0.  If this is set to a value greater than zero, then
// composition routines will allocate a table of no than about
// zz_pXArgBound KB.  Setting this value affects all compose routines
// and the power projection and minimal polynomial routines below, 
// and indirectly affects many routines in zz_pXFactoring.

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

                     power projection routines

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

void project(zz_p& x, const zz_pVector& a, const zz_pX& b);
zz_p project(const zz_pVector& a, const zz_pX& b);
// x = inner product of a with coefficient vector of b


void ProjectPowers(vec_zz_p& x, const vec_zz_p& a, long k,
                   const zz_pX& h, const zz_pXModulus& F);

vec_zz_p ProjectPowers(const vec_zz_p& a, long k,
                   const zz_pX& h, const zz_pXModulus& F);

// Computes the vector

//    project(a, 1), project(a, h), ..., project(a, h^{k-1} % f).  

// This operation is the "transpose" of the modular composition operation.
// Input and output may have "high order" zeroes stripped.

void ProjectPowers(vec_zz_p& x, const vec_zz_p& a, long k,
                   const zz_pXArgument& H, const zz_pXModulus& F);

vec_zz_p ProjectPowers(const vec_zz_p& a, long k,
                   const zz_pXArgument& H, const zz_pXModulus& F);

// same as above, but uses a pre-computed zz_pXArgument


void UpdateMap(vec_zz_p& x, const vec_zz_p& a,
               const zz_pXMultiplier& B, const zz_pXModulus& F);

vec_zz_p UpdateMap(const vec_zz_p& a,
               const zz_pXMultiplier& B, const zz_pXModulus& F);

// Computes the vector

//    project(a, b), project(a, (b*X)%f), ..., project(a, (b*X^{n-1})%f)

// Restriction: a.length() <= deg(F).
// This is "transposed" MulMod by B.
// Input vector may have "high order" zeroes striped.
// The output will always have high order zeroes stripped.


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

                              Minimum Polynomials

These routines should be used with prime p.

All of these routines implement the algorithm from [Shoup, J. Symbolic
Comp. 17:371-391, 1994] and [Shoup, J. Symbolic Comp. 20:363-397,
1995], based on transposed modular composition and the
Berlekamp/Massey algorithm.

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


void MinPolySeq(zz_pX& h, const vec_zz_p& a, long m);
// computes the minimum polynomial of a linealy generated sequence; m
// is a bound on the degree of the polynomial; required: a.length() >=
// 2*m

void ProbMinPolyMod(zz_pX& h, const zz_pX& g, const zz_pXModulus& F, long m);
zz_pX ProbMinPolyMod(const zz_pX& g, const zz_pXModulus& F, long m);

void ProbMinPolyMod(zz_pX& h, const zz_pX& g, const zz_pXModulus& F);
zz_pX ProbMinPolyMod(const zz_pX& g, const zz_pXModulus& F);

// computes the monic minimal polynomial if (g mod f).  m = a bound on
// the degree of the minimal polynomial; in the second version, this
// argument defaults to n.  The algorithm is probabilistic, always
// returns a divisor of the minimal polynomial, and returns a proper
// divisor with probability at most m/p.

void MinPolyMod(zz_pX& h, const zz_pX& g, const zz_pXModulus& F, long m);
zz_pX MinPolyMod(const zz_pX& g, const zz_pXModulus& F, long m);

void MinPolyMod(zz_pX& h, const zz_pX& g, const zz_pXModulus& F);
zz_pX MinPolyMod(const zz_pX& g, const zz_pXModulus& F);
// same as above, but guarantees that result is correct

void IrredPoly(zz_pX& h, const zz_pX& g, const zz_pXModulus& F, long m);
zz_pX IrredPoly(const zz_pX& g, const zz_pXModulus& F, long m);

void IrredPoly(zz_pX& h, const zz_pX& g, const zz_pXModulus& F);
zz_pX IrredPoly(const zz_pX& g, const zz_pXModulus& F);

// same as above, but assumes that f is irreducible, or at least that
// the minimal poly of g is itself irreducible.  The algorithm is
// deterministic (and is always correct).


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

                   Traces, norms, resultants

These routines should be used with prime p.

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


void TraceMod(zz_p& x, const zz_pX& a, const zz_pXModulus& F);
zz_p TraceMod(const zz_pX& a, const zz_pXModulus& F);

void TraceMod(zz_p& x, const zz_pX& a, const zz_pX& f);
zz_p TraceMod(const zz_pX& a, const zz_pXModulus& f);
// x = Trace(a mod f); deg(a) < deg(f)


void TraceVec(vec_zz_p& S, const zz_pX& f);
vec_zz_p TraceVec(const zz_pX& f);
// S[i] = Trace(X^i mod f), i = 0..deg(f)-1; 0 < deg(f)

// The above routines implement the asymptotically fast trace
// algorithm from [von zur Gathen and Shoup, Computational Complexity,
// 1992].

void NormMod(zz_p& x, const zz_pX& a, const zz_pX& f);
zz_p NormMod(const zz_pX& a, const zz_pX& f);
// x = Norm(a mod f); 0 < deg(f), deg(a) < deg(f)


void resultant(zz_p& x, const zz_pX& a, const zz_pX& b);
zz_pX resultant(zz_p& x, const zz_pX& a, const zz_pX& b);
// x = resultant(a, b)


void CharPolyMod(zz_pX& g, const zz_pX& a, const zz_pX& f);
zz_pX CharPolyMod(const zz_pX& a, const zz_pX& f);
// g = charcteristic polynomial of (a mod f); 0 < deg(f), deg(g) <
// deg(f).  This routine works for arbitrary f.  For irreducible f,
// is it faster to use IrredPolyMod, and then exponentiate as
// necessary, since in this case the characterstic polynomial
// is a power of the minimal polynomial.


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

                           Miscellany

A zz_pX f is represented as a vec_zz_p, which can be accessed as
f.rep.  The constant term is f.rep[0] and the leading coefficient is
f.rep[f.rep.length()-1], except if f is zero, in which case
f.rep.length() == 0.  Note that the leading coefficient is always
nonzero (unless f is zero).  One can freely access and modify f.rep,
but one should always ensure that the leading coefficient is nonzero,
which can be done by invoking f.normalize().


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


void clear(zz_pX& x) // x = 0
void set(zz_pX& x); // x = 1

void zz_pX::normalize();  
// f.normalize() strips leading zeros from f.rep.

void zz_pX::SetMaxLength(long n);
// f.SetMaxLength(n) pre-allocate spaces for n coefficients.  The
// polynomial that f represents is unchanged.

void zz_pX::kill();
// f.kill() sets f to 0 and frees all memory held by f.  Equivalent to
// f.rep.kill().

zz_pX::zz_pX(INIT_SIZE_TYPE, long n);
// zz_pX(INIT_SIZE, n) initializes to zero, but space is pre-allocated
// for n coefficients

static const zz_pX& zero();
// zz_pX::zero() is a read-only reference to 0

void swap(zz_pX& x, zz_pX& y); 
// swap x and y (via "pointer swapping")

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人中文字幕在线| 色综合天天综合狠狠| 国产精品高潮久久久久无| 欧洲精品中文字幕| 韩国欧美国产1区| 中文一区在线播放| 欧美电视剧免费观看| 一本久久综合亚洲鲁鲁五月天| 蜜臀国产一区二区三区在线播放 | www.在线成人| 狠狠色丁香婷综合久久| 亚洲午夜影视影院在线观看| 久久久久久久久久久久久女国产乱 | 91精品国产高清一区二区三区| 成人小视频在线| 激情小说欧美图片| 蜜芽一区二区三区| 亚洲bt欧美bt精品| 亚洲精品乱码久久久久久日本蜜臀| 久久久精品国产99久久精品芒果 | 久久一夜天堂av一区二区三区| 欧美日韩一区二区在线观看视频 | 国内一区二区在线| 久久精品国内一区二区三区| 天堂成人免费av电影一区| 亚洲免费观看高清在线观看| 国产欧美一二三区| 精品国产一区二区三区久久久蜜月 | 99久久99久久精品免费看蜜桃 | 国产经典欧美精品| 久久99精品久久只有精品| 调教+趴+乳夹+国产+精品| 亚洲一区在线播放| 亚洲精品免费视频| 亚洲精品成人天堂一二三| 亚洲人xxxx| 悠悠色在线精品| 亚洲综合色区另类av| 亚洲激情图片小说视频| 亚洲三级在线看| 亚洲激情自拍偷拍| 亚洲综合色成人| 亚洲无人区一区| 日韩成人一区二区| 麻豆精品久久精品色综合| 日本成人在线网站| 精品午夜一区二区三区在线观看| 另类人妖一区二区av| 精品一区二区三区视频在线观看| 国产一区二区三区四区五区入口 | 91蝌蚪国产九色| 色综合久久综合网| 欧美性感一区二区三区| 欧美日韩视频第一区| 日韩亚洲欧美高清| 久久中文字幕电影| 国产精品免费免费| 亚洲日本在线天堂| 尤物av一区二区| 日韩国产精品91| 国产一区二区精品久久| 波多野结衣91| 欧美自拍偷拍一区| 日韩三级精品电影久久久| 久久久蜜桃精品| 中文字幕一区二区三区在线观看 | 日韩精品一区二区三区视频播放 | 精彩视频一区二区三区| 丁香五精品蜜臀久久久久99网站| 91免费看`日韩一区二区| 欧美日韩精品欧美日韩精品一| 日韩欧美高清dvd碟片| 国产亚洲自拍一区| 亚洲午夜精品一区二区三区他趣| 久久成人羞羞网站| 色综合一区二区| 日韩免费高清电影| 国产精品久久久久精k8| 婷婷国产在线综合| 高清视频一区二区| 欧美日本不卡视频| 国产精品亲子伦对白| 亚洲国产成人av网| 国产91丝袜在线观看| 欧美影院精品一区| 久久久亚洲综合| 亚洲一区二区三区国产| 国产精品资源在线观看| 日本二三区不卡| 国产欧美一二三区| 免费观看日韩电影| 91国产福利在线| 国产夜色精品一区二区av| 偷偷要91色婷婷| 99re在线精品| 久久日韩粉嫩一区二区三区| 亚洲网友自拍偷拍| 成人激情电影免费在线观看| 日韩欧美一区二区免费| 亚洲乱码中文字幕综合| 国产成人精品在线看| 日韩一区和二区| 亚洲精品五月天| 国产成人av一区| 欧美一区二区免费观在线| 亚洲欧美日韩系列| 国产高清一区日本| 日韩一级片在线观看| 亚洲一区二区三区四区不卡| 成人国产免费视频| 精品国产乱码久久久久久蜜臀| 亚洲成av人片在www色猫咪| 波波电影院一区二区三区| 亚洲精品在线电影| 日韩精品乱码免费| 欧美午夜寂寞影院| 亚洲精品日日夜夜| jizzjizzjizz欧美| 国产欧美一区二区精品忘忧草 | 国产亚洲精品超碰| 国产一区二区三区精品欧美日韩一区二区三区| 欧美在线免费视屏| 亚洲一区视频在线观看视频| 成人开心网精品视频| 久久精品夜色噜噜亚洲a∨| 麻豆精品在线播放| 日韩亚洲欧美一区| 欧美aaa在线| 日韩视频不卡中文| 秋霞电影网一区二区| 91成人在线免费观看| 一区二区三区影院| 97精品久久久久中文字幕| 中文字幕日韩欧美一区二区三区| 成人黄色软件下载| 国产精品第四页| 99视频精品在线| 综合久久国产九一剧情麻豆| 日韩欧美三级在线| 日韩经典一区二区| 5858s免费视频成人| 日韩精品一级中文字幕精品视频免费观看| 91国偷自产一区二区三区成为亚洲经典 | 蜜臀av亚洲一区中文字幕| 5月丁香婷婷综合| 久久电影网电视剧免费观看| 久久亚洲春色中文字幕久久久| 蜜桃av一区二区在线观看| 日韩免费看网站| 国产乱码一区二区三区| 国产精品久久久久久久浪潮网站| 91污在线观看| 亚洲成人动漫在线观看| 7777女厕盗摄久久久| 国内精品免费在线观看| 久久久国产精品麻豆| 欧美色综合网站| 99精品视频一区二区| 亚洲欧美日本韩国| 欧美久久久久久久久久| 国产主播一区二区| 中文字幕中文字幕在线一区| 在线免费观看成人短视频| 日韩成人一区二区三区在线观看| 日韩美女主播在线视频一区二区三区| 国产成人综合亚洲网站| 亚洲精品视频在线| 日韩手机在线导航| 成人精品视频一区| 性欧美疯狂xxxxbbbb| www成人在线观看| 91在线视频官网| 蜜臀av在线播放一区二区三区 | 精品成人a区在线观看| 成人激情综合网站| 丝袜a∨在线一区二区三区不卡| 日韩欧美亚洲另类制服综合在线| 处破女av一区二区| 三级一区在线视频先锋| 久久久国产精品麻豆 | 久久精品亚洲精品国产欧美kt∨| 色综合天天综合网国产成人综合天| 亚洲va欧美va人人爽| 国产精品网曝门| 91精品国产综合久久久蜜臀粉嫩| 国产九九视频一区二区三区| 伊人色综合久久天天| 久久影院视频免费| 欧美三级视频在线| 国产精品一区2区| 一区二区三区四区中文字幕| 26uuu久久综合| 精品视频1区2区| www.色综合.com| 狠狠色丁香婷综合久久| 亚洲国产成人91porn| 国产精品亲子乱子伦xxxx裸| 欧美变态口味重另类| 欧美日韩午夜精品| 91在线视频网址|