亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲视频一区二区在线| 久久成人麻豆午夜电影| 日本成人在线不卡视频| 99久久99久久精品国产片果冻| 欧美婷婷六月丁香综合色| 久久久久国产成人精品亚洲午夜| 亚洲成人福利片| 99久久99久久精品免费观看| 久久久久久久久伊人| 日韩电影网1区2区| 色综合久久综合网97色综合| 久久噜噜亚洲综合| 久久国内精品自在自线400部| 欧美日韩一区二区三区不卡| 日韩一区在线看| 粉嫩久久99精品久久久久久夜| 91精品国产色综合久久ai换脸 | 色哟哟一区二区三区| 国产日本欧美一区二区| 黑人巨大精品欧美黑白配亚洲| 欧美影视一区在线| 成人欧美一区二区三区白人| 丁香激情综合五月| 国产性天天综合网| 国产精品996| 国产欧美视频一区二区| 国产精品一品视频| 日本一区二区三区电影| 国产白丝网站精品污在线入口| 精品成人免费观看| 国产乱码精品一区二区三区忘忧草| 日韩精品专区在线| 九九精品一区二区| 久久综合99re88久久爱| 国产一区二区精品在线观看| 久久色成人在线| 国产一区二区三区高清播放| 2019国产精品| 国产宾馆实践打屁股91| 国产亚洲成av人在线观看导航| 高清国产一区二区三区| 欧美经典三级视频一区二区三区| 国产91精品一区二区| 国产精品无圣光一区二区| www.欧美日韩国产在线| 亚洲男女毛片无遮挡| 欧美亚州韩日在线看免费版国语版| 亚洲国产综合91精品麻豆| 欧洲av在线精品| 日韩1区2区3区| 欧美一区二区二区| 国产乱码精品一区二区三| 国产精品久久久久久久久免费桃花 | 欧美一区二区三区视频免费| 久久成人久久爱| 国产农村妇女精品| 色婷婷综合久久久久中文一区二区| 亚洲综合男人的天堂| 欧美一区二区精品久久911| 国产揄拍国内精品对白| 中文字幕亚洲一区二区av在线| 欧美特级限制片免费在线观看| 美女一区二区三区| 国产片一区二区三区| 在线精品亚洲一区二区不卡| 精品一区二区三区久久| 国产精品少妇自拍| 欧美挠脚心视频网站| 国产福利一区二区| 午夜亚洲福利老司机| 国产欧美精品国产国产专区| 色噜噜狠狠色综合中国| 久久 天天综合| 亚洲综合色区另类av| 2023国产精品自拍| 欧美视频一区二区三区四区| 国产盗摄一区二区三区| 日韩福利电影在线| 国产精品盗摄一区二区三区| 欧美日韩电影在线播放| 成人午夜短视频| 九九国产精品视频| 亚洲一区在线观看视频| 国产视频911| 日韩欧美中文字幕公布| 欧美影片第一页| 99re成人在线| 国产成人精品免费看| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲女爱视频在线| 欧美激情在线看| 日韩欧美一区电影| 制服.丝袜.亚洲.另类.中文| 日本道在线观看一区二区| 国产福利精品导航| 国产最新精品精品你懂的| 图片区小说区国产精品视频| 亚洲激情一二三区| 亚洲色图欧美在线| 国产精品久久看| 欧美激情一区二区| 国产三区在线成人av| xnxx国产精品| 日韩精品专区在线| 欧美videossexotv100| 欧美一区二区三区在线| 欧美军同video69gay| 欧美曰成人黄网| 欧美艳星brazzers| 在线一区二区三区| 色88888久久久久久影院野外| eeuss鲁片一区二区三区| 成人一区在线观看| 成人福利视频在线| 91网站在线播放| 色爱区综合激月婷婷| 色婷婷综合视频在线观看| 91福利视频久久久久| 欧美综合欧美视频| 欧美日韩dvd在线观看| 欧美日韩精品一区二区三区| 欧美日韩不卡一区| 日韩精品一区在线观看| 精品国产乱码久久| 久久久久久夜精品精品免费| 国产三级欧美三级日产三级99| 国产视频一区不卡| 亚洲色图在线看| 五月激情六月综合| 精品一区二区三区免费观看| 国产成人精品免费在线| 色视频欧美一区二区三区| 欧美视频在线不卡| 日韩限制级电影在线观看| xf在线a精品一区二区视频网站| 国产精品无人区| 亚洲综合小说图片| 极品销魂美女一区二区三区| 成人激情午夜影院| 欧美亚洲日本国产| 精品成人一区二区三区| 亚洲私人黄色宅男| 日本欧美大码aⅴ在线播放| 国产成人亚洲综合a∨婷婷| 色综合天天综合网天天看片| 欧美精品久久久久久久多人混战| 精品国产一区二区三区av性色| 中文字幕中文乱码欧美一区二区| 亚洲国产精品久久一线不卡| 国模无码大尺度一区二区三区| 色综合久久久久综合99| 日韩午夜中文字幕| 亚洲私人黄色宅男| 精品在线免费观看| 色婷婷久久久综合中文字幕| 日韩欧美不卡一区| 亚洲精品国产成人久久av盗摄 | 日韩免费视频一区二区| 国产精品视频你懂的| 日韩福利视频导航| 91香蕉视频在线| 久久综合九色综合久久久精品综合| 亚洲欧美视频在线观看视频| 韩国精品免费视频| 在线观看区一区二| 欧美国产日韩精品免费观看| 婷婷成人激情在线网| 99精品一区二区| 久久精品人人做人人爽人人| 天天色 色综合| 色婷婷一区二区| 日本一区二区三区电影| 久久99日本精品| 欧美美女黄视频| 亚洲黄色在线视频| 丁香桃色午夜亚洲一区二区三区 | 欧美三级一区二区| 国产精品国产三级国产aⅴ入口| 日韩电影一区二区三区| 欧洲激情一区二区| 亚洲免费在线视频一区 二区| 国产成人亚洲精品青草天美| 精品久久人人做人人爽| 日韩高清一区在线| 欧美久久久久免费| 亚洲一区二区三区四区在线免费观看| 99视频一区二区| 欧美国产国产综合| 国产a精品视频| 欧美国产欧美亚州国产日韩mv天天看完整| 日韩成人免费电影| 欧美日本在线观看| 亚洲主播在线播放| 欧美性色欧美a在线播放| 亚洲黄色录像片| 91福利资源站| 亚洲成av人片在www色猫咪| 欧洲精品一区二区三区在线观看| 一区二区三区欧美久久| 精品视频免费看|