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

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

?? tour-gmp.html

?? 一個比較通用的大數運算庫
?? HTML
字號:
<html>
<head>
<title>
A Tour of NTL: Using NTL with GMP  </title>
</head>

<body bgcolor="#fff9e6">

<center>
<a href="tour-impl.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-time.html"> <img src="arrow3.gif" alt="[Next]" align=bottom></a>
</center>

<h1> 
<p align=center>
A Tour of NTL: Using NTL with GMP
</p>
</h1>

<p> <hr> <p>

GMP is the GNU Multi-Precision library.
You can get more information about it, as well as the latest version
from <a href="http://www.swox.com/gmp">here.</a>

<p>

Briefly, GMP is a library for long integer arithmetic.
It has hand-crafted assembly routines for a wide variety
of architectures.
For basic operations, like integer multiplication, it can be 
two to three (and sometimes bit more) times faster than NTL's
traditional long integer package.
The speedup is most dramatic on x86 machines.

<p>
You can choose one of three different ways of implementing
long integer arithmetic in NTL:
<p>
<ol>
<li>
One can use the traditional NTL long integer arithmtic package,
and avoid dealing with GMP entirely.

<p>
<li>
One can use traditional NTL long integer arithmtic package,
but with GMP as a <i>supplemental</i> long integer package.
This gives you many (though not all) of the performance benefits of GMP,
but while still maintaining complete backward compatability.

<p>
<li>
One can use GMP as the primary long integer package.
This gives you essentially all of the performance benefits
of GMP, but there are some minor backward incompatabilities 
<a href="#compat">(see below)</a>.

</ol>

<p>

<p>
The use of GMP as the primary long integer package
is the preferred method of using GMP.
The use of GMP as a supplemental long integer package is intended
primarily for backward compatability.

<p>
Building NTL with GMP (either as a supplemental or primary 
long integer package) takes a few extra minutes work,
and you certainly do not need to use NTL with GMP if you don't want to.
As far as I know, GMP is only available on Unix systems
and on Windows systems using Cygwin tools.

<p>
Even if you do not use GMP as the primary long integer package,
you should still read the <a href="#compat">section below
on backward compatabilty</a>
so that you can write portable code and avoid deprecated constructs.

<p>
<h2>
Downloading and building GMP
</h2>
<p>

Download GMP from <a href="http://www.swox.com/gmp">here.</a>
You will get a file <tt>gmp-XXX.tar.gz</tt>.
<p>
Now do the following:
<pre>
   % gunzip gmp-XXX.tar.gz
   % tar xf gmp-XXX.tar
   % cd gmp-XXX
   % ./configure --disable-shared --prefix=$HOME/sw
   % make
   % make check
   % make install
</pre>
This will build, test, and install GMP in $HOME/sw.
Of course, change $HOME/sw to whatever you want (the default is 
<tt>/usr/local</tt>).
You will find the GMP header files in <tt>$HOME/sw/include</tt> 
and the compiled binary in <tt>$HOME/sw/lib/libgmp.a</tt>.

<p>
The option <tt>--disable-shared</tt> is optional.
It disables the creation of shared libraries,
which simplifies things just a bit (in particular, this documentation).
Shared libraries have their advantages, but the use of
such libraries seems to vary a bit across different Unix flavors.


<p>
Executing <tt>make uninstall</tt> undoes the <tt>make install</tt>.
<p>
Executing <tt>make distclean</tt> removes everything
created by <tt>configure</tt> and <tt>make</tt>.

<p>
<h2>
Building and using NTL with GMP
</h2>
<p>

When building NTL with GMP, you have to tell NTL that you want to
use GMP as the primary long integer package, 
and where the include files and library are.
The easiest way to do this is by passing the argument 
<tt>NTL_GMP_LIP=on</tt> to the NTL configuration script
when you are <a href="tour-unix.html">installing NTL</a>.
Assuming you installed GMP in <tt>$HOME/sw</tt> as above,
and you also want to install NTL in <tt>$HOME/sw</tt>,
you execute:
<pre>
   % ./configure PREFIX=$HOME/sw NTL_GMP_LIP=on  GMP_PREFIX=$HOME/sw
</pre>

<p>
If you installed GMP in <tt>/usr/local</tt> (or some other
standard system directory where your compiler will look by default)
then simply
<pre>
   % ./configure PREFIX=$HOME/sw NTL_GMP_LIP=on
</pre>
does the job.
Moreover, if NTL is also to be installed in <tt>/usr/local</tt>,
then
<pre>
   % ./configure NTL_GMP_LIP=on
</pre>
does the job.

<p>
If instead you want to use GMP as a supplemental long integer package,
you should pass the argument <tt>NTL_GMP_HACK=on</tt> to the configure script,
instead of <tt>NTL_GMP_LIP=on</tt>.
One still has to specify where to find GMP using the <tt>GMP_PREFIX</tt>
variable in the configuration script.

<p>
Instead of passing arguments to the configure script,
you can also just edit the <tt>config.h</tt> and makefile by hand.
The documentation in these files should be self-explanatory.

<p>
When compiling programs that use NTL with GMP,
you need to link with the GMP library.
If GMP is not installed as above in 
<tt>$HOME/sw</tt>, rather than in a standard system directory,
 this just means adding
<tt>-L$HOME/sw/lib -lgmp</tt> to the compilation command.
If you installed GMP in a standard system directory,
then just <tt>-lgmp</tt> does the job.
Note that <tt>-lgmp</tt> must come <i>after</i> <tt>-lntl</tt>
on the command line.

<p>
NTL has been tested and works correctly with GMP versions 3.1,  3.1.1,
and 4.1.4 (among others)
as the primary long integer package.
It is not possible to use versions of GMP prior to 3.1 as the
primary long integer package.

<p>

NTL has been tested and works correctly
with versions 2.0.2, 3.0.1, 3.1, 3.1.1, and 4.1.4
(among otheers) of GMP as a supplemental 
long integer package.
It is not recommended to use versions of GMP prior to 3.1.1,
as these are generally more buggy and less efficient.

<p>
When using NTL with GMP as either primary or supplemental
long integer package, as a user of NTL, you do not need to
know or understand anything about the the GMP library.
So while there is detailed documentation available about how
to use GMP, you do not have to read it.
The programming interface to the long integer package 
completely hides implementation details.


<p>
<h2>
Some implementation details
</h2>
<p>

When using GMP as the primary long integer package, 
the code used by NTL is essentially a layer of <tt>C</tt> routines
that call the low level <tt>mpn</tt> routines in the GMP package.
These NTL wrapper routines provide essentially the same 
functionality of the higher level <tt>mpz</tt> routines in GMP,
but while presenting an interface to the rest of NTL that is almost identical
to that of the
traditional NTL long integer package.
There are, however, some very minor backward incompatabilities 
<a href="#compat">(see below)</a>.

<p>
When using GMP as a supplemental long integer package,
the code employs
a "quick and dirty", yet fairly effective hack.
This quick and dirty
approach converts "on the fly"
between the classic LIP and GMP representations.
This makes the use of GMP <i>completely</i> invisible to higher layer software.
Of course, there is a penalty: converting between representations takes
time.
For operations like addition, conversion would take longer
than performing the operation, and so it is not done.
However, for computationally expensive
operations like multiplication, the "overhead" is not so bad,
at least for numbers that are not too small.
To multiply two 256-bit numbers on a Pentium-II, the extra time
required for the data conversions is just 35% of the time to
do the multiplication in GMP, i.e., the "overhead" is 35%.
For 512-bit numbers, the corresponding opportunity cost is about 14%,
and for 1024-bit numbers, it is less than 10%.
For smaller numbers, the opportunity cost is greater, but
never much worse than about 50%.

<p>
<h2>
<a name="compat">
Backward compatbility
</a>
</h2>
<p>

With version 5.0 of NTL, some aspects of the programming interface
are 'deprecated' so as to allow the use of another long integer package,
such as GMP, as the primary long integer package.

<p>
Prior to version 5.0, the macro <tt>NTL_NBITS</tt> was defined,
along with the macro <tt>NTL_RADIX</tt> defined to be 
<tt>(1L &lt;&lt; NTL_NBITS)</tt>.
While these macros are still available when using NTL's traditional
long integer package (i.e., when <tt>NTL_GMP_LIP</tt> is not set),
they are not available when using the GMP as the primary long integer
package (i.e., when <tt>NTL_GMP_LIP</tt> is set).
Furthermore, when writing portable programs, one should avoid these macros.

<p>


Also, the static function <tt>long ZZ::digit(const ZZ &amp;);</tt>
is defined when using traditional long integer arithmetic,
but is not available when using GMP as the primary long integer package,
and in any case, its use should be avoided when writing portable programs. 


<p>
Instead of the above macros, one should use the followng macros:

<pre>
   NTL_ZZ_NBITS -- number of bits in a zzigit;
                   a ZZ is represented as a sequence of zzigits.

   NTL_SP_NBITS -- max number of bits in a "single-precision" number

   NTL_WSP_NBITS -- max number of bits in a "wide single-precision" number
</pre>
<p>
The following relations hold:
<pre>
   NTL_SP_NBITS &lt;= NTL_WSP_NBITS &lt;= NTL_ZZ_NBITS
   26 &lt;= NTL_SP_NBITS &lt;= min(NTL_BITS_PER_LONG-2, NTL_DOUBLE_PRECISION-3)
   NTL_WSP_NBITS &lt;= NTL_BITS_PER_LONG-2
</pre>

<p>

Note that <tt>NTL_ZZ_NBITS</tt> may be less than, equal to, or greater than
<tt>NTL_BITS_PER_LONG</tt>  -- no particular relationship 
should be assumed to hold.
In particular, expressions like <tt>(1L &lt;&lt; NTL_ZZ_BITS)</tt>
might overflow.

<p>
"single-precision" numbers are meant to be used in conjunction with the
single-precision modular arithmetic routines.

<p>
"wide single-precision" numbers are meant to be used in conjunction
with the <tt>ZZ</tt> arithmetic routines for optimal efficiency.

<p>
Note that when using traditional long integer arithmetic, we have
<pre>
    NTL_ZZ_NBITS = NTL_SP_NBITS = NTL_WSP_NBITS = NTL_NBITS.
</pre>

<p>
The following auxilliary macros are also defined:

<pre>
NTL_FRADIX -- double-precision value of <tt>2^NTL_ZZ_NBITS</tt>
NTL_SP_BOUND -- (1L &lt;&lt; NTL_SP_NBITS)
NTL_WSP_BOUND -- (1L &lt;&lt; NTL_WSP_NBITS)
</pre>

<p>

Note that for a <tt>ZZ</tt> <tt>n</tt>,
<tt>n.size()</tt> returns the number of "zzigits" of <tt>n</tt>.
This is supported with either traditional or GMP integer arithemtic.
Note, however, that some old codes might write <tt>n.size() &lt;= 1</tt>
as a way to test if <tt>NumBits(n) &lt;= NTL_NBITS</tt>.
This is no longer the right thing to do, if one wants portable code
that works with either traditional or GMP long integer arithmetic.
First, one has to decide whether one wants to test if
<tt>NumBits(n)</tt> is bounded by <tt>NTL_ZZ_NBITS</tt>, 
<tt>NTL_SP_NBITS</tt>, or <tt>NTL_WSP_NBITS</tt>.
In the first case, <tt>n.size() &lt;= 1</tt> is still 
the right way to test this.
In the second case, write this as <tt>n.SinglePrecision()</tt>.
In the third case, write this as <tt>n.WideSinglePrecision()</tt>.
The routines <tt>SinglePrecision</tt> and <tt>WideSinglePrecision</tt>
are new to NTL version 5.0.

<p>

Most "high level" applications that use NTL should not be affected
by these changes to NTL's programming interface, and if they are,
changing the programs should be quite easy.


<p> <hr> <p>


<p>

<center>
<a href="tour-impl.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-time.html"> <img src="arrow3.gif" alt="[Next]" align=bottom></a>
</center>


</body>
</html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲精品中文字幕| 日韩精品中午字幕| 国产成人无遮挡在线视频| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲女人的天堂| 亚洲与欧洲av电影| 一区二区理论电影在线观看| 一区二区三区四区视频精品免费| 亚洲精品一二三四区| 亚洲午夜羞羞片| 日韩成人免费在线| 激情综合色播五月| 国产成人高清视频| 91天堂素人约啪| 欧美性色综合网| 欧美亚洲动漫精品| 欧美成人伊人久久综合网| 国产亚洲婷婷免费| 成人免费在线播放视频| 亚洲一区二区三区中文字幕 | 国产v日产∨综合v精品视频| 国产成人免费av在线| 91欧美一区二区| 欧美一区二区不卡视频| 国产欧美日韩综合精品一区二区| 中文字幕在线观看不卡| 亚洲6080在线| 国产sm精品调教视频网站| voyeur盗摄精品| 在线成人av影院| 日本一区二区三区高清不卡| 亚洲国产另类精品专区| 国产成人久久精品77777最新版本| 91在线免费播放| 日韩女优视频免费观看| 亚洲女同女同女同女同女同69| 午夜视频一区二区三区| 粉嫩av一区二区三区在线播放 | 成人av一区二区三区| 欧美日韩午夜在线| 中文字幕不卡三区| 欧美aa在线视频| 欧美亚州韩日在线看免费版国语版| 欧美草草影院在线视频| 一区二区三区在线观看欧美| 国产资源精品在线观看| 欧美精品1区2区3区| 中文字幕一区二区三区在线播放| 久久se这里有精品| 欧美性视频一区二区三区| 国产精品高潮久久久久无| 免费不卡在线视频| 欧美色综合网站| 亚洲色图欧美激情| 成人av资源下载| 欧美国产精品一区二区| 久久精品噜噜噜成人av农村| 欧美区视频在线观看| 亚洲免费在线电影| www.亚洲激情.com| 国产精品视频在线看| 国产乱色国产精品免费视频| 欧美一区二区三区公司| 亚洲一区二区在线免费观看视频| 99国产精品久久久久久久久久 | 中文字幕国产一区二区| 国产综合色视频| 久久伊99综合婷婷久久伊| 青草国产精品久久久久久| 91精品免费在线| 图片区小说区区亚洲影院| 欧美日韩国产影片| 五月激情丁香一区二区三区| 欧美三区在线观看| 亚洲h动漫在线| 欧美一区二区福利视频| 麻豆精品一区二区综合av| 欧美乱妇一区二区三区不卡视频| 亚洲国产一区二区在线播放| 欧美日韩一区二区三区高清| 亚洲一区欧美一区| 在线不卡中文字幕| 精品一区二区三区视频| www日韩大片| 国产精品69久久久久水密桃| 国产视频亚洲色图| 成人a级免费电影| 亚洲国产欧美日韩另类综合 | 一色屋精品亚洲香蕉网站| av在线一区二区| 亚洲影院理伦片| 欧美一级黄色片| 国产激情视频一区二区三区欧美| 国产欧美日韩三区| 色悠久久久久综合欧美99| 午夜精品久久久久久久久久久| 欧美一区二区三区四区久久| 国产综合久久久久久鬼色| 亚洲视频在线观看三级| 欧美日韩国产免费一区二区 | 99久久久国产精品| 亚洲大片在线观看| 久久欧美一区二区| 在线精品观看国产| 久草中文综合在线| 亚洲美女在线国产| 日韩精品一区二区三区在线观看| 成人激情图片网| 美女视频一区二区| 最新日韩av在线| 日韩欧美国产麻豆| 色狠狠一区二区三区香蕉| 黄一区二区三区| 亚洲一区二区三区中文字幕在线 | 一本到不卡免费一区二区| 日韩avvvv在线播放| 综合在线观看色| 精品国产乱码久久久久久老虎| av电影在线观看完整版一区二区| 欧美aaaaaa午夜精品| 亚洲视频综合在线| 久久免费的精品国产v∧| 欧美日韩三级一区二区| 99在线精品视频| 久久66热偷产精品| 婷婷国产在线综合| 综合激情成人伊人| 国产欧美精品一区aⅴ影院| 欧美一级高清片| 欧美午夜电影网| 色婷婷综合久久久久中文 | 欧美性猛交一区二区三区精品| 激情综合网av| 蜜臀av在线播放一区二区三区| 一区二区成人在线观看| 亚洲视频你懂的| 中文字幕视频一区二区三区久| 久久久久国产一区二区三区四区| 欧美一区二区播放| 欧美另类高清zo欧美| 在线观看不卡视频| 欧美日韩一本到| 99re热这里只有精品视频| 日本一区二区综合亚洲| 欧美福利视频一区| 欧美日韩一区二区欧美激情| 欧美午夜一区二区三区免费大片| av不卡在线播放| 成人久久18免费网站麻豆| 国产成人免费xxxxxxxx| 国产乱码精品一区二区三| 国产精品乡下勾搭老头1| 国产在线精品国自产拍免费| 精品一区二区三区不卡| 久久精品国产色蜜蜜麻豆| 激情综合网最新| 国产毛片精品一区| 国产成人亚洲精品青草天美| 国产成人精品三级麻豆| 成人天堂资源www在线| 国产成人免费视频网站高清观看视频 | 欧美丝袜丝nylons| 欧美电影一区二区| 这里只有精品免费| 精品国产乱码久久久久久蜜臀 | 丝袜美腿亚洲色图| 午夜视频在线观看一区二区三区| 日韩电影免费一区| 国产一区二区免费在线| 成人免费av网站| 91麻豆福利精品推荐| 欧美综合在线视频| 91精品中文字幕一区二区三区| 精品免费一区二区三区| 国产日韩一级二级三级| 亚洲综合视频在线| 久久成人免费电影| 99免费精品在线观看| 欧美伦理影视网| 久久久蜜桃精品| 亚洲大尺度视频在线观看| 久久国产精品第一页| 91网站视频在线观看| 欧美一二三区在线观看| 中文字幕制服丝袜成人av| 午夜成人免费电影| 丁香婷婷综合色啪| 91精品福利在线一区二区三区| 国产日韩亚洲欧美综合| 无吗不卡中文字幕| 不卡一区二区中文字幕| 日韩欧美视频在线| 亚洲欧美一区二区不卡| 国产在线视频一区二区| 在线一区二区三区四区五区| 国产日产精品1区| 丝袜美腿亚洲色图| 一本一本大道香蕉久在线精品| 久久综合九色综合欧美98| 亚洲成人你懂的|