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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? tour-ex4.html

?? 密碼大家Shoup寫(xiě)的數(shù)論算法c語(yǔ)言實(shí)現(xiàn)
?? HTML
字號(hào):
<html><head><title>A Tour of NTL: Examples: Modular Arithmetic </title></head><body bgcolor="#fff9e6"><center><a href="tour-ex3.html"><img src="arrow1.gif" alt="[Previous]" align=bottom></a> <a href="tour-examples.html"><img src="arrow2.gif" alt="[Up]" align=bottom></a> <a href="tour-ex5.html"> <img src="arrow3.gif" alt="[Next]" align=bottom></a></center><h1> <p align=center>A Tour of NTL: Examples: Modular Arithmetic</p></h1><p> <hr> <p>NTL also supports modular integer arithmetic.The class <tt>ZZ_p</tt>represents the integers mod <tt>p</tt>.Despite the notation, <tt>p</tt> need not in general be prime,except in situations where this is mathematically required.The classes <tt>vec_ZZ_p</tt>, <tt>mat_ZZ_p</tt>,and <tt>ZZ_pX</tt> represent vectors, matrices, and polynomialsmod <tt>p</tt>, and work much the same way as the correspondingclasses for <tt>ZZ</tt>.<p>Here is a program that reads a prime number <tt>p</tt>,and a polynomial <tt>f</tt> modulo <tt>p</tt>, and factors it.<p><pre>#include &lt;NTL/ZZ_pXFactoring.h&gt;int main(){   ZZ p;   cin &gt;&gt; p;   ZZ_p::init(p);   ZZ_pX f;   cin &gt;&gt; f;   vec_pair_ZZ_pX_long factors;   CanZass(factors, f);   cout &lt;&lt; factors &lt;&lt; "\n";   // calls "Cantor/Zassenhaus" algorithm }</pre><p>As a program is running, NTL keeps track of a "current modulus"for the class <tt>ZZ_p</tt>, which can be initialized or changedusing <tt>ZZ_p::init</tt>.This must be done before any variables are declared orcomputations are done that depend on this modulus.<p>Please note that for efficiency reasons,NTL does not make any attempt to ensure thatvariables declared under one modulus are not usedunder a different one.If that happens, the behavior of a program in thiscase is completely unpredictable.<p> <hr> <p>Here are two more examples that illustrate the <tt>ZZ_p</tt>-related classes.The first is a vector addition routine (already supplied by NTL):<p><pre>#include &lt;NTL/vec_ZZ_p.h&gt;void add(vec_ZZ_p&amp; x, const vec_ZZ_p&amp; a, const vec_ZZ_p&amp; b){   long n = a.length();   if (b.length() != n) Error("vector add: dimension mismatch");   x.SetLength(n);   long i;   for (i = 0; i < n; i++)      add(x[i], a[i], b[i]);}</pre><p>The second example is an inner product routine (also supplied by NTL):<p><pre>#include &lt;NTL/vec_ZZ_p.h&gt;void InnerProduct(ZZ_p&amp; x, const vec_ZZ_p&amp; a, const vec_ZZ_p&amp; b){   long n = min(a.length(), b.length());   long i;   ZZ accum, t;   accum = 0;   for (i = 0; i < n; i++) {      mul(t, rep(a[i]), rep(b[i]));      add(accum, accum, t);   }   conv(x, accum);}</pre><p>This second example illustrates two things.First, it illustrates the use of function <tt>rep</tt> whichreturns a read-only reference to the representation of a <tt>ZZ_p</tt>as a <tt>ZZ</tt> between <tt>0</tt> and <tt>p-1</tt>.Second, it illustrates a useful algorithmic technique,whereby one computes over <tt>ZZ</tt>, reducing mod <tt>p</tt>only when necessary.This reduces the number of divisions that need to be performed significantly,leading to much faster execution.<p>The class <tt>ZZ_p</tt> supports all the basic arithmeticoperations in both operator and procedural form.All of the basic operations support a "promotion logic",promoting <tt>long</tt> to <tt>ZZ_p</tt>.<p>Note that the class <tt>ZZ_p</tt> is mainly useful onlywhen you want to work with vectors, matrices, or polynomials mod <tt>p</tt>.If you just want to do some simple modular arithemtic,it is probably easier to just work with <tt>ZZ</tt>s directly.This is especially true if you want to work with many differentmoduli:  modulus switching is supported, but it is a bit awkward.<p>The class <tt>ZZ_pX</tt> supports all the basic arithmeticoperations in both operator and procedural form.All of the basic operations support a "promotion logic",promoting both <tt>long</tt> and <tt>ZZ_p</tt> to <tt>ZZ_pX</tt>.<p>See <a href="ZZ_p.txt"><tt>ZZ_p.txt</tt></a> for details on <tt>ZZ_p</tt>;see <a href="ZZ_pX.txt"><tt>ZZ_pX.txt</tt></a> for details on <tt>ZZ_pX</tt>;see <a href="ZZ_pXFactoring.txt"><tt>ZZ_pXFactoring.txt</tt></a> for details on the routines for factoring polynomials over <tt>ZZ_p</tt>;see <a href="vec_ZZ_p.txt"><tt>vec_ZZ_p.txt</tt></a> for details on <tt>vec_ZZ_p</tt>;see <a href="mat_ZZ_p.txt"><tt>mat_ZZ_p.txt</tt></a> for details on <tt>mat_ZZ_p</tt>.<p> <hr> <p>There is a mechanism for saving and restoring a modulus,which the following example illustrates.This routine takes as input an integer polynomialand a prime, and tests if the polynomial is irreducible modulothe prime.<p><pre>#include &lt;NTL/ZZX.h&gt;#include &lt;NTL/ZZ_pXFactoring.h&gt;long IrredTestMod(const ZZX&amp; f, const ZZ&amp; p){   ZZ_pBak bak;  // save current modulus in bak   bak.save();   ZZ_p::init(p);  // set the current modulus to p   return DetIrredTest(to_ZZ_pX(f));   // old modulus is restored automatically when bak is destroyed   // upon return}</pre><p>The modulus switching mechanism is actually quite a bitmore general and flexible than this example illustrates.<p> The function <tt>to_ZZ_pX</tt> is yet another of NTL's manyconversion functions.We could also have used the equivalent procedural form:<pre>   ZZ_pX f1;   conv(f1, f);   return DetIrredTest(f1);</pre><p> <hr> <p>Suppose in the above example that <tt>p</tt> is known in advanceto be a small, single-precision  prime.In this case, NTL provides a class <tt>zz_p</tt>, thatacts just like <tt>ZZ_p</tt>,along with corresponding classes <tt>vec_zz_p</tt>,<tt>mat_zz_p</tt>, and <tt>zz_pX</tt>.The interfaces to all of the routines are generally identicalto those for <tt>ZZ_p</tt>.However, the routines are much more efficient, in both time and space.<p>For small primes, the routine in the previous example could be codedas follows.<p><pre>#include &lt;NTL/ZZX.h&gt;#include &lt;NTL/lzz_pXFactoring.h&gt;long IrredTestMod(const ZZX&amp; f, long p){   zz_pBak bak;    bak.save();   zz_p::init(p);     return DetIrredTest(to_zz_pX(f));}</pre><p> <hr> <p>The following is a routine (essentially the same as implemented in NTL)for computing the GCD of polynomials with integer coefficients.It uses a "modular" approach:  the GCDs are computed modulo smallprimes, and the results are combined using the Chinese Remainder Theorem (CRT).The small primes are specially chosen "FFT primes", which are ofa special form that allows for particular fast polynomial arithmetic.<p><pre>#include &lt;NTL/ZZX.h&gt;void GCD(ZZX&amp; d, const ZZX&amp; a, const ZZX&amp; b){   if (a == 0) {      d = b;      if (LeadCoeff(d) &lt; 0) negate(d, d);      return;   }   if (b == 0) {      d = a;      if (LeadCoeff(d) &lt; 0) negate(d, d);      return;   }   ZZ c1, c2, c;   ZZX f1, f2;   content(c1, a);   divide(f1, a, c1);   content(c2, b);   divide(f2, b, c2);   GCD(c, c1, c2);   ZZ ld;   GCD(ld, LeadCoeff(f1), LeadCoeff(f2));   ZZX g, res;   ZZ prod;   zz_pBak bak;   bak.save();   long FirstTime = 1;   long i;   for (i = 0; ;i++) {      zz_p::FFTInit(i);      long p = zz_p::modulus();      if (divide(LeadCoeff(f1), p) || divide(LeadCoeff(f2), p)) continue;      zz_pX G, F1, F2;      zz_p  LD;      conv(F1, f1);      conv(F2, f2);      conv(LD, ld);      GCD(G, F1, F2);      mul(G, G, LD);      if (deg(G) == 0) {          res = 1;         break;      }      if (FirstTime || deg(G) &lt; deg(g)) {         prod = 1;         g = 0;         FirstTime = 0;      }      else if (deg(G) &gt; deg(g)) {         continue;      }      if (!CRT(g, prod, G)) {         PrimitivePart(res, g);         if (divide(f1, res) &amp;&amp; divide(f2, res))            break;      }   }   mul(d, res, c);   if (LeadCoeff(d) &lt; 0) negate(d, d);}</pre><p>See <a href="lzz_p.txt"><tt>lzz_p.txt</tt></a> for details on <tt>zz_p</tt>;see <a href="lzz_pX.txt"><tt>lzz_pX.txt</tt></a> for details on <tt>zz_pX</tt>;see <a href="lzz_pXFactoring.txt"><tt>lzz_pXFactoring.txt</tt></a> for details on the routines for factoring polynomials over <tt>zz_p</tt>;see <a href="vec_lzz_p.txt"><tt>vec_lzz_p.txt</tt></a> for details on <tt>vec_zz_p</tt>;see <a href="mat_lzz_p.txt"><tt>mat_lzz_p.txt</tt></a> for details on <tt>mat_zz_p</tt>.<p> <hr> <p>Arithmetic mod 2 is such an important special case that NTLprovides a class <tt>GF2</tt>, thatacts just like <tt>ZZ_p</tt> when <tt>p == 2</tt>,along with corresponding classes <tt>vec_GF2</tt>,<tt>mat_GF2</tt>, and <tt>GF2X</tt>.The interfaces to all of the routines are generally identicalto those for <tt>ZZ_p</tt>.However, the routines are much more efficient, in both time and space.<p>This example illustrates the <tt>GF2X</tt> and <tt>mat_GF2</tt>classes with a simple routine to test if a polynomial over GF(2)is irreducible using linear algebra.NTL's built-in irreducibility test is to be preferred, however.<pre>#include &lt;NTL/GF2X.h&gt;#include &lt;NTL/mat_GF2.h&gt;long MatIrredTest(const GF2X& f){   long n = deg(f);   if (n &lt;= 0) return 0;   if (n == 1) return 1;   if (GCD(f, diff(f)) != 1) return 0;   mat_GF2 M;   M.SetDims(n, n);   GF2X x_squared = GF2X(2, 1);   GF2X g;   g = 1;   for (long i = 0; i &lt; n; i++) {      VectorCopy(M[i], g, n);      M[i][i] += 1;      g = (g * x_squared) % f;   }   long rank = gauss(M);   if (rank == n-1)      return 1;   else      return 0;}</pre><p>Note that the statement <pre>   g = (g * x_squared) % f;</pre>could be replace d by the more efficient code sequence<pre>   MulByXMod(g, g, f);   MulByXMod(g, g, f);</pre>but this would not significantly impact the overallrunning time, since it is the Gaussian elimination that dominates the running time.<p>See <a href="GF2.txt"><tt>GF2.txt</tt></a> for details on <tt>GF2</tt>;see <a href="GF2X.txt"><tt>GF2X.txt</tt></a> for details on <tt>GF2X</tt>;see <a href="GF2XFactoring.txt"><tt>GF2XFactoring.txt</tt></a> for details on the routines for factoring polynomials over <tt>GF2</tt>;see <a href="vec_GF2.txt"><tt>vec_GF2.txt</tt></a> for details on <tt>vec_GF2</tt>;see <a href="mat_GF2.txt"><tt>mat_GF2.txt</tt></a> for details on <tt>mat_GF2</tt>.<p><center><a href="tour-ex3.html"><img src="arrow1.gif" alt="[Previous]" align=bottom></a> <a href="tour-examples.html"><img src="arrow2.gif" alt="[Up]" align=bottom></a> <a href="tour-ex5.html"> <img src="arrow3.gif" alt="[Next]" align=bottom></a></center></body></html>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
136国产福利精品导航| 久久亚洲精品小早川怜子| 日韩美女视频19| 99re6这里只有精品视频在线观看| 欧美韩国日本一区| 91网址在线看| 午夜视黄欧洲亚洲| 精品欧美一区二区三区精品久久 | 538prom精品视频线放| 天堂va蜜桃一区二区三区| 日韩丝袜情趣美女图片| 国产自产v一区二区三区c| 久久久蜜臀国产一区二区| 99视频在线观看一区三区| 亚洲国产中文字幕在线视频综合| 欧美片在线播放| 国产综合久久久久久鬼色| 亚洲欧洲av一区二区三区久久| 欧美亚洲日本一区| 久热成人在线视频| 国产精品麻豆视频| 91精品国产综合久久国产大片| 国产精品99精品久久免费| 亚洲一区二区三区视频在线播放| 在线播放视频一区| 懂色av一区二区三区免费看| 亚洲精品国产一区二区精华液 | 精品粉嫩超白一线天av| av在线不卡网| 免费在线观看视频一区| 中文字幕在线观看一区二区| 欧美日韩三级一区二区| 国产成人啪免费观看软件| 亚洲国产精品一区二区久久恐怖片| 国产亚洲一区二区三区四区| 欧美日韩一区二区三区不卡| 国产老肥熟一区二区三区| 五月天网站亚洲| 中文字幕一区在线| 精品久久久久99| 欧美视频中文字幕| aaa亚洲精品| 国产一区二区不卡老阿姨| 午夜精品福利久久久| 国产精品久久久久精k8| 久久综合999| 91.麻豆视频| 欧美亚洲国产怡红院影院| 国产精品99精品久久免费| 久久精品国产亚洲高清剧情介绍 | 麻豆国产精品官网| 亚洲综合久久久| 亚洲人成亚洲人成在线观看图片| www日韩大片| 日韩三级在线观看| 欧美日韩三级在线| 色88888久久久久久影院按摩 | 亚洲一区二区三区视频在线 | 亚洲国产精品嫩草影院| 国产亚洲精品7777| 欧美哺乳videos| 日韩三级视频在线看| 91精品国产综合久久小美女| 色噜噜狠狠色综合欧洲selulu| 成人va在线观看| 成人激情免费视频| 国产综合色在线视频区| 奇米综合一区二区三区精品视频| 亚洲成人免费看| 亚洲午夜久久久久久久久久久| 亚洲日本在线看| 自拍视频在线观看一区二区| 亚洲欧洲三级电影| 日韩理论片一区二区| 中文在线一区二区| 国产精品乱码一区二区三区软件 | 日韩一区二区三区在线观看| 精品视频999| 91精品国产麻豆| 日韩亚洲欧美成人一区| 欧美sm美女调教| 久久久精品免费网站| 国产精品乱码一区二区三区软件| 中文字幕一区在线观看视频| 亚洲欧洲av一区二区三区久久| 中文字幕一区在线| 一区二区三区在线观看动漫| 亚洲高清免费在线| 免费观看30秒视频久久| 精品亚洲国产成人av制服丝袜| 国产乱码精品一区二区三区五月婷| 国产一区二区精品久久| 成人午夜又粗又硬又大| 色婷婷精品久久二区二区蜜臂av | 成a人片国产精品| 欧美在线免费观看亚洲| 欧美精品九九99久久| 久久一日本道色综合| 国产精品乱码人人做人人爱| 亚洲小说欧美激情另类| 另类人妖一区二区av| 国产精品一品二品| 91福利视频在线| 91精品国产欧美日韩| 国产精品剧情在线亚洲| 亚洲一区二区三区激情| 久国产精品韩国三级视频| 成人免费毛片高清视频| 欧美日韩中文精品| 26uuu久久天堂性欧美| 亚洲三级理论片| 久久99日本精品| 91色在线porny| 欧美成人精品福利| 成人免费一区二区三区在线观看| 五月婷婷欧美视频| 成人精品国产一区二区4080| 欧美日韩另类一区| 国产午夜精品一区二区三区四区 | 国产精品短视频| 日韩国产精品久久久久久亚洲| 国产精品一二二区| 欧美精品一级二级三级| 国产精品进线69影院| 日本视频免费一区| 色综合色狠狠天天综合色| 精品国产精品一区二区夜夜嗨| 亚洲精品老司机| 国产一区二区三区在线观看免费| 久久精品一区蜜桃臀影院| av电影在线观看完整版一区二区| 久久这里只有精品6| 国产精品1024久久| 欧美精品一区二区久久婷婷| 欧美国产成人精品| 爽好多水快深点欧美视频| 91在线观看美女| 国产午夜精品久久| 免费视频最近日韩| 欧美日韩美少妇| 亚洲免费在线看| 国产一区二区按摩在线观看| 91麻豆精品国产91久久久资源速度 | 国产精品二区一区二区aⅴ污介绍| 日韩福利视频网| 在线精品视频免费播放| 中文字幕av一区二区三区高 | 中文字幕av免费专区久久| 2020国产成人综合网| 91尤物视频在线观看| 亚洲一区在线视频观看| 欧美一区二区女人| 毛片不卡一区二区| 色综合久久综合| 欧美日韩国产综合一区二区 | 精品一区二区三区视频 | 欧美日韩国产成人在线免费| 首页欧美精品中文字幕| 亚洲少妇最新在线视频| 亚洲va天堂va国产va久| 欧美艳星brazzers| 亚洲午夜久久久| 97久久精品人人澡人人爽| 国产精品久久久久永久免费观看| 日本欧美一区二区三区| 欧美色视频一区| 天天影视涩香欲综合网| 欧美日韩国产精选| 五月激情六月综合| 亚洲成人精品在线观看| 日韩1区2区日韩1区2区| 中文字幕一区二区日韩精品绯色| 美女性感视频久久| 欧美猛男男办公室激情| 亚洲成av人片www| 色久综合一二码| 亚洲国产视频直播| 欧美人妇做爰xxxⅹ性高电影 | 欧美日韩一区中文字幕| 亚洲精品视频在线看| 色婷婷久久久综合中文字幕| 亚洲高清一区二区三区| 日韩女优电影在线观看| 国产一区二区三区综合| 亚洲国产精品传媒在线观看| 99精品在线观看视频| 亚洲乱码日产精品bd| 欧美日韩午夜精品| 日本欧美久久久久免费播放网| 欧美一级二级三级乱码| 国产成人午夜视频| 亚洲视频在线观看一区| 欧美日韩精品一区二区在线播放| 亚洲在线一区二区三区| 精品久久久网站| 色婷婷综合久久久久中文| 午夜精品福利一区二区蜜股av| 精品国产91亚洲一区二区三区婷婷 | 久久一区二区视频| 99精品欧美一区二区三区综合在线|