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

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

?? tour-struct.html

?? 一個比較通用的大數運算庫
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<html>
<head>
<title>
A Tour of NTL: Programming Interface </title>
</head>

<body bgcolor="#fff9e6">
<center>
<a href="tour-examples.html"><img src="arrow1.gif" alt="[Previous]" align=bottom></a>
 <a href="tour.html"><img src="arrow2.gif" alt="[Up]" align=bottom></a> 
<a href="tour-modules.html"> <img src="arrow3.gif" alt="[Next]" align=bottom></a>
</center>

<h1> 
<p align=center>
A Tour of NTL: Programming Interface 
</p>
</h1>

<p> <hr> <p>

In this section, we give a general overview of the 
NTL's programming interface.

<p>
<p>
<h3>
Basic Ring Classes
</h3>
<p>

The basic ring classes are:
<ul>
<li>
<tt>ZZ</tt>: big integers
<li>
<tt>ZZ_p</tt>: big integers modulo <tt>p</tt>
<li>
<tt>zz_p</tt>: integers mod "single precision" <tt>p</tt>
<li>
<tt>GF2</tt>: integers mod 2
<li>
<tt>ZZX</tt>: univariate polynomials over <tt>ZZ</tt>
<li>
<tt>ZZ_pX</tt>: univariate polynomials over <tt>ZZ_p</tt>
<li>
<tt>zz_pX</tt>: univariate polynomials over <tt>zz_p</tt>
<li>
<tt>GF2X</tt>: polynomials over GF2
<li>
<tt>ZZ_pE</tt>: ring/field extension over ZZ_p
<li>
<tt>zz_pE</tt>: ring/field extension over zz_p
<li>
<tt>GF2E</tt>: ring/field extension over GF2
<li>
<tt>ZZ_pEX</tt>: univariate polynomials over <tt>ZZ_pE</tt>
<li>
<tt>zz_pEX</tt>: univariate polynomials over <tt>zz_pE</tt>
<li>
<tt>GF2EX</tt>: univariate polynomials over <tt>GF2E</tt>
</ul>

<p>
All these classes all support basic
arithmetic operators
<pre>
   +, -, (unary) -, +=, -=, ++, --, 
   *, *=, /, /=, %, %=.
</pre>

<p>
However, the operations 
<pre>
   %, %=
</pre>
only exist for integer and polynomial classes, and 
do not exist
for classes 
<pre>
  ZZ_p, zz_p, GF2, ZZ_pE, zz_pE, GF2E.
</pre>

<p>
The standard equality operators (<tt>==</tt> and <tt>!=</tt>)
are provided for each class.
In addition, the class <tt>ZZ</tt>
supports the usual inequality
operators.

<p>
The integer and polynomial classes also support "shift operators"
for left and right shifting.
For polynomial classes, this means multiplication or division
by a power of <tt>X</tt>.

<p>
<p>
<h3>
Floating Point Classes
</h3>
<p>

In addition to the above ring classes, NTL also provides three
different floating point classes: 
<ul>
<li>
<tt>xdouble</tt>: "double precision" floating point with
extended exponent range (for very large numbers);
<li>
<tt>quad_float</tt>: "quasi" quadruple-precision floating point;
<li>
<tt>RR</tt>: aribitrary precision floating point.
</ul>


<p>
<p>
<h3>
Vectors and Matrices
</h3>
<p>

There are also vectors and matrices over 
<pre>
   ZZ ZZ_p zz_p GF2 ZZ_pE zz_pE GF2E RR
</pre>
which support the usual arithmetic operations.

<p>
<p>
<h3>
Functional and Procedural forms
</h3>
<p>

Generally, for any function defined by NTL, there is 
a functional form, and a procedural form.
For example:

<pre>
   ZZ x, a, n;
   x = InvMod(a, n);  // functional form
   InvMod(x, a, n);   // procedural form
</pre>

<p>
This example illustrates the normal way these two forms differ
syntactically.
However, there are exceptions.

First, if there is a operator that can play the role of the
functional form, that is the notation used:

<pre>
   ZZ x, a, b;
   x = a + b;    // functional form
   add(x, a, b); // procedural form
</pre>

Second, if the functional form's name would be ambiguous,
the return type is simply appended to its name:

<pre>
   ZZ_p x;
   x = random_ZZ_p();  // functional form
   random(x);          // procedural form
</pre>

Third, there are a number of conversion functions (see below), whose name
in procedural form is <tt>conv</tt>, but whose name in 
functioanl form is <tt>to_T</tt>, where <tt>T</tt> is the return type:

<pre>
   ZZ x;  
   double a;

   x = to_ZZ(a);  // functional form
   conv(x, a);    // procedural form
</pre>



<p>
The use of the procedural form may be more efficient,
since it will generally avoid the creation of a temporary object
to store its result.
However, it is generally silly to get too worked up about
such efficiencies, and the functional form is usually preferable
because the resulting code is usually easier to understand.

<p>
The above rules converning procedural and functional forms apply
to essentially all of the arithmetic classes supported by NTL,
with the exception of
<tt>xdouble</tt> and <tt>quad_float</tt>.
These two classes only support the functional/operator notation
for arithmetic operations (but do support both forms for conversion).




<p>
<p>
<h3>
Conversions and Promotions
</h3>
<p>

NTL does not provide automatic conversions from, say,
<tt>int</tt> to <tt>ZZ</tt>.
Most <tt>C++</tt> experts consider such automatic conversions
bad form in library design, and I would agree with them.
Some earlier versions of NTL had automatic conversions,
but they caused too much trouble, so I took them out.
Indeed, combining function overloading and automatic conversions
is generally considered  by programming language experts
to be a bad idea (but that did not stop
the designers of <tt>C++</tt> from doing it).
It makes it very difficult to figure out which function
ought to be called.
<tt>C++</tt> has an incredibly complex set of rules for doing this;
moreover, these rules have been changing over time,
and no two compilers seem to implement exactly the same
set of rules.
And if a compiler has a hard time doing this, imagine what it
is like for a programmer.
In fact, the rules have become so complicated, that the latest
edition of Stroustrup's <tt>C++</tt> book does not even explain them,
although
earlier verisons did.
Possible explanations:
<em>(a)</em> Stroustrup thinks his readers are 
too stupid to understand the rules, or
<em>(b)</em> Stroustrup does not understand the rules, or
<em>(c)</em> the rules are so complicated that Stroustrup finds it embarassing
to talk about them.

<p>
Now it should be more clear why I didn't just implement,
say, the <tt>int</tt> to <tt>ZZ</tt> conversion function
as a <tt>ZZ</tt> constructor taking an argument of type <tt>int</tt>,
instead of calling it <tt>to_ZZ</tt>.
This would have introduced an automatic conversion, which I
wanted to avoid for the reasons explained above.
"OK.  But why not make the constructor <tt>explict</tt>?" you ask.
The main reason is that this is a fairly recently introduced
language feature that is not universally available.
And even if it were, what about, say, the <tt>ZZ</tt> to <tt>int</tt>
conversion routine?
How would you name <em>that</em>?
The strategy I chose is simple, consistent, and portable.


<p>

As mentioned above, there are numerous explicit conversion routines,
which come in both functional and procedural forms.
A complete list of these can be found in 
<a href="conversions.txt">conversions.txt</a>.
This is the only place these are documented; they do not appear
in the ".txt" files.

<p>

Even though there are no automatic conversions, users
of NTL can still have most of their benefits, while
avoiding their pitfalls.
This is because all of the basic arithmetic operations 
(in both their functional and procedural forms),
comparison operators, and assignment are overloaded
to get the effect of automatic "promotions".
For example:

<pre>
   ZZ x, a;

   x = a + 1;
   if (x &lt; 0) 
      mul(x, 2, a);
   else
      x = -1;
</pre>

<p>

These promotions are documented in the ".txt" files, 
usually using a kind of "short hand" notation.
For example:

<pre>
ZZ operator+(const ZZ&amp; a, const ZZ&amp; b);

// PROMOTIONS: operator + promotes long to ZZ on (a, b).
</pre>

This means that in addition to the declared function, there
are two other functions that are logically equivalent to the following:
<pre>
ZZ operator+(long a, const ZZ&amp; b) { return to_ZZ(a) + b; }
ZZ operator+(const ZZ&amp; a, long b) { return a + to_ZZ(b); }
</pre>

<p>
Note that this is not how NTL actually implements these functions.
It is in generally more efficient to write
<pre>
   x = y + 2;
</pre>
than it is to write
<pre>
   x = y + to_ZZ(2);
</pre>
The former notation avoids the creation and destruction
of a temporary <tt>ZZ</tt>
object to hold the value 2.

<p>
Also, don't have any inhibitions about writing tests like
<pre>
   if (x == 0) ...
</pre>
and assignments like
<pre>
   x = 1; 
</pre>
These are all optimized, and  do not execute significaltly slower
than the "lower level"  (and much less natural) 
<pre>
   if (IsZero(x)) ...
</pre>
and
<pre>
   set(x);
</pre>

<p>
Some types have even more promotions.
For example, the type <tt>ZZ_pX</tt> has promotions
from <tt>long</tt> and <tt>ZZ_p</tt>.
Thus, the <tt>add</tt> function for <tt>ZZ_pX</tt> takes the following 
argument types:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品无码三级在线观看视频| 亚洲品质自拍视频| 综合色中文字幕| 激情综合网av| 欧美日韩成人综合在线一区二区| 国产日韩高清在线| 日本美女视频一区二区| 欧美在线一二三四区| 国产精品九色蝌蚪自拍| 久久精品国产99国产| 欧美日韩国产经典色站一区二区三区 | 亚洲大型综合色站| 91亚洲精品乱码久久久久久蜜桃| 精品福利一区二区三区| 日本不卡123| 欧美人妇做爰xxxⅹ性高电影 | 欧美刺激午夜性久久久久久久| 亚洲激情五月婷婷| 99这里只有久久精品视频| 久久久久青草大香线综合精品| 日韩不卡一区二区| 欧美理论片在线| 亚洲最快最全在线视频| 99精品国产91久久久久久| 国产日韩欧美精品一区| 国产精品亚洲视频| 国产午夜一区二区三区| 国产精品99久久不卡二区| 精品国产麻豆免费人成网站| 日本vs亚洲vs韩国一区三区二区 | 国产69精品久久久久777| 久久久久久综合| 国内精品久久久久影院薰衣草| 日韩一级片网址| 日本aⅴ精品一区二区三区| 91精品国产欧美一区二区成人| 亚洲一区二区在线免费看| 91国偷自产一区二区开放时间| 亚洲蜜桃精久久久久久久| 91免费在线播放| 中文字幕一区二区三区在线播放| 成人黄色国产精品网站大全在线免费观看 | 国产一区美女在线| 久久久久久久网| 国产成人av影院| 国产精品女同互慰在线看| www.日韩大片| 亚洲免费观看高清在线观看| 日本久久电影网| 亚洲国产毛片aaaaa无费看| 欧美色老头old∨ideo| 日韩主播视频在线| 日韩午夜小视频| 久久99精品国产麻豆不卡| 欧美精品一区二区久久久| 国产麻豆欧美日韩一区| 日本一区二区久久| 91丨九色丨国产丨porny| 亚洲综合丁香婷婷六月香| 欧美日韩精品一区二区三区 | 国产精品女人毛片| 色av一区二区| 蜜桃精品在线观看| 亚洲国产成人一区二区三区| 99精品欧美一区二区蜜桃免费| 亚洲综合区在线| 日韩欧美美女一区二区三区| 狠狠色综合日日| 18涩涩午夜精品.www| 欧美午夜一区二区三区| 久久国产麻豆精品| 亚洲国产高清在线| 欧美色图第一页| 久久国产夜色精品鲁鲁99| 亚洲国产成人午夜在线一区| 欧美亚州韩日在线看免费版国语版| 日本女优在线视频一区二区 | 欧美精选一区二区| 老司机精品视频线观看86| 国产精品成人免费| 欧美日韩国产高清一区二区| 国产在线精品不卡| 亚洲激情综合网| 欧美成人一区二区三区在线观看| 高清不卡一区二区| 亚洲高清视频在线| 26uuu精品一区二区| 一本大道综合伊人精品热热| 成人午夜免费视频| 亚洲va韩国va欧美va| 国产欧美日韩麻豆91| 欧美日韩一二三区| 成人免费高清在线| 日产欧产美韩系列久久99| 国产精品视频麻豆| 欧美高清精品3d| a级精品国产片在线观看| 日本三级亚洲精品| 自拍偷拍亚洲欧美日韩| 欧美电影免费观看高清完整版在线| av在线一区二区| 久久99国内精品| 一区二区免费看| 国产欧美精品日韩区二区麻豆天美| 欧美偷拍一区二区| 成人av动漫网站| 日韩不卡一区二区三区| 亚洲人成人一区二区在线观看| 日韩精品中午字幕| 欧美体内she精视频| 国产91富婆露脸刺激对白| 日韩av一级电影| 艳妇臀荡乳欲伦亚洲一区| 国产欧美一区二区精品婷婷| 91精品欧美福利在线观看| 一本一道久久a久久精品 | 亚洲一区免费观看| 国产精品三级av| 久久久亚洲精华液精华液精华液| 欧美日韩高清不卡| 欧洲人成人精品| voyeur盗摄精品| 国产精品99久久久久| 美女性感视频久久| 亚洲成av人片| 亚洲美女免费在线| 国产精品超碰97尤物18| 久久九九久久九九| 26uuu亚洲| 欧美大胆人体bbbb| 欧美精品少妇一区二区三区| 色吧成人激情小说| 色综合天天狠狠| 成人黄色777网| 成人黄色av电影| 成人性生交大合| 国产99久久久久| 国产精品综合网| 国产精品一区免费在线观看| 另类小说图片综合网| 免费不卡在线视频| 日韩国产欧美在线播放| 亚洲va韩国va欧美va精品| 亚洲在线视频网站| 亚洲综合色婷婷| 亚洲一区二区三区四区的| 一区二区在线免费观看| 亚洲欧美色综合| 亚洲女同一区二区| 亚洲男女毛片无遮挡| 亚洲同性同志一二三专区| 亚洲欧美日韩国产成人精品影院| 中文字幕永久在线不卡| 日韩一区中文字幕| 亚洲欧美成人一区二区三区| 综合婷婷亚洲小说| 一区二区三区在线高清| 亚洲一区视频在线观看视频| 亚洲图片自拍偷拍| 日韩和欧美的一区| 琪琪久久久久日韩精品| 久久精品久久99精品久久| 久草在线在线精品观看| 久久成人羞羞网站| 国产精品性做久久久久久| 国产不卡免费视频| 成人av在线资源网站| 91网站在线播放| 欧美色精品天天在线观看视频| 欧美男人的天堂一二区| 欧美一级午夜免费电影| 精品国产一区二区在线观看| 国产亚洲一二三区| 亚洲三级电影网站| 午夜精品在线看| 久久国产精品露脸对白| 高清日韩电视剧大全免费| 91网站黄www| 欧美精品久久久久久久久老牛影院 | 免费在线观看一区| 国产高清成人在线| 色偷偷一区二区三区| 欧美久久久影院| 精品国产乱码久久久久久免费| 2014亚洲片线观看视频免费| 中文av一区二区| 一区二区欧美国产| 久99久精品视频免费观看| 成人午夜激情视频| 欧美主播一区二区三区美女| 日韩天堂在线观看| 国产精品久久99| 日韩影院在线观看| 国产成人综合视频| 在线亚洲高清视频| 欧美精品一区在线观看| 亚洲卡通动漫在线| 美女任你摸久久| jlzzjlzz亚洲女人18| 欧美精品成人一区二区三区四区|