亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
26uuu亚洲| 日韩欧美在线不卡| 成人性生交大片免费看在线播放 | www.亚洲激情.com| 久草这里只有精品视频| 国产一区二区在线看| 亚洲福利一二三区| 日本美女一区二区三区视频| 日本成人中文字幕在线视频| 免费在线观看一区二区三区| 国产原创一区二区| 高清av一区二区| 色偷偷一区二区三区| 欧美天天综合网| 91精品国产色综合久久ai换脸| 麻豆精品视频在线| 国产在线精品国自产拍免费| 国产精品亚洲一区二区三区在线| 亚洲欧美另类久久久精品| 亚洲私人影院在线观看| 亚洲国产wwwccc36天堂| 麻豆精品国产91久久久久久| 成人理论电影网| 欧美人体做爰大胆视频| 国产视频一区二区在线| 亚洲三级在线免费| 麻豆成人91精品二区三区| 成人在线一区二区三区| 欧美视频三区在线播放| 精品美女在线观看| 亚洲欧美日韩人成在线播放| 久久精品理论片| 99vv1com这只有精品| 欧美日韩高清一区二区不卡| 国产欧美日韩另类一区| 亚洲国产欧美在线| 国产成人免费视频一区| 欧美色手机在线观看| 日本一区二区三区国色天香 | 亚洲欧洲综合另类在线| 亚洲观看高清完整版在线观看| 国产欧美精品国产国产专区| 亚洲色图19p| 国内精品免费**视频| 日本高清无吗v一区| 国产亚洲人成网站| 天天操天天色综合| 色噜噜狠狠成人中文综合| 久久久天堂av| 麻豆国产精品官网| 欧美日韩在线直播| 亚洲天堂福利av| 国产精品一区二区黑丝| 日韩视频永久免费| 一区二区日韩av| 99re亚洲国产精品| 日本一区二区三区dvd视频在线| 日韩免费一区二区三区在线播放| 5858s免费视频成人| 椎名由奈av一区二区三区| 国产精一区二区三区| 欧美精品久久一区| 一个色妞综合视频在线观看| 成人毛片视频在线观看| 国产色产综合产在线视频| 国产最新精品免费| 久久久国产午夜精品| 极品少妇一区二区| 久久综合九色欧美综合狠狠| 日本不卡一区二区三区| 欧美放荡的少妇| 日韩和的一区二区| 欧美一区二区三区爱爱| 美女视频黄 久久| 亚洲精品一区二区三区香蕉| 蜜臀精品一区二区三区在线观看| 高清在线不卡av| 久久久蜜臀国产一区二区| 国产一区二区免费视频| 久久蜜桃av一区二区天堂| 久久99国内精品| 久久一日本道色综合| 国产在线精品一区二区夜色| 亚洲精品一区二区三区蜜桃下载 | 91在线观看地址| 《视频一区视频二区| 99国产精品视频免费观看| 国产精品毛片高清在线完整版| 日韩精品一级二级| 日韩美女一区二区三区| 国内久久婷婷综合| 国产精品国产三级国产| 欧美色精品在线视频| 日韩高清电影一区| 久久影院午夜片一区| 99re视频这里只有精品| 无码av免费一区二区三区试看 | 亚洲乱码国产乱码精品精小说| 日韩1区2区3区| 久久先锋影音av鲁色资源网| 国产裸体歌舞团一区二区| 亚洲精品高清在线观看| 日韩视频在线一区二区| 国产高清精品久久久久| 依依成人综合视频| 欧美电影免费提供在线观看| 国产成人精品亚洲777人妖| 亚洲精品国产a| 久久老女人爱爱| 欧美视频一区在线| 国产乱人伦偷精品视频不卡 | 国产欧美日韩精品在线| 色国产精品一区在线观看| 久久国产尿小便嘘嘘尿| 亚洲欧美国产77777| 精品免费日韩av| 91视频免费看| 国产一区二区剧情av在线| 夜夜操天天操亚洲| 国产情人综合久久777777| 337p亚洲精品色噜噜狠狠| av亚洲精华国产精华| 久久99精品国产91久久来源| 性欧美疯狂xxxxbbbb| 国产精品毛片久久久久久久| 精品剧情在线观看| 欧美夫妻性生活| 欧美三级一区二区| 91啪在线观看| 成人福利视频网站| 国产在线不卡一区| 免费久久精品视频| 日韩精品乱码av一区二区| 亚洲综合小说图片| 亚洲摸摸操操av| 中文字幕一区二区三区在线观看| 99久久精品国产网站| 韩国在线一区二区| 日本成人中文字幕| 日本一不卡视频| 舔着乳尖日韩一区| 午夜精品福利一区二区三区蜜桃| 制服丝袜激情欧洲亚洲| 一本一道综合狠狠老| 99精品在线免费| av一区二区三区在线| 成人性生交大片免费看在线播放| 日韩理论片中文av| 国产精品成人一区二区三区夜夜夜| 97精品久久久午夜一区二区三区| 国产精品激情偷乱一区二区∴| 99久久夜色精品国产网站| 精品一区免费av| 国产精品一区二区在线看| 国产成人一级电影| 成人免费视频国产在线观看| 成人一区二区在线观看| 成人av在线资源网站| 成人精品国产福利| 在线精品亚洲一区二区不卡| 色噜噜狠狠一区二区三区果冻| 国内精品自线一区二区三区视频| 国产精品久久久久久久久免费樱桃 | 色综合久久久网| 欧洲激情一区二区| 宅男在线国产精品| 日韩片之四级片| 久久精品夜色噜噜亚洲aⅴ| 国产欧美日韩不卡免费| 亚洲激情校园春色| 日本欧美加勒比视频| 国产精品一区二区你懂的| 成人看片黄a免费看在线| 欧美午夜宅男影院| 26uuu久久天堂性欧美| 亚洲人吸女人奶水| 日本最新不卡在线| 成人激情图片网| 777午夜精品视频在线播放| 久久久国际精品| 亚洲va欧美va人人爽| 国产一区二区精品在线观看| 在线视频国内自拍亚洲视频| 日韩欧美第一区| 亚洲女人小视频在线观看| 视频一区视频二区中文| 国产精品69毛片高清亚洲| 欧美日韩免费不卡视频一区二区三区 | 欧美aⅴ一区二区三区视频| 激情图区综合网| 欧美午夜精品一区| 国产精品人成在线观看免费| 日韩福利视频导航| 成人成人成人在线视频| 欧美一区二区在线视频| 亚洲天堂网中文字| 国产精品一区二区免费不卡| 欧美久久久久中文字幕| ...av二区三区久久精品| 国内成+人亚洲+欧美+综合在线|