wayne 发表于 2012-1-31 12:20:21

NTL----数论C++库

以前和无心人 在 arch linux下用gcc 4.5编译NTL 编译不过去,
今天,还是arch linux,kernel 3.2.2, gcc 4.6.2 ,编译过来了。
# yaourt -S ntl --tmp /root/build/

==> Downloading ntl PKGBUILD from AUR...
x PKGBUILD

Comment by: remyoudompheng on Sun, 20 Jun 2010 17:58:35 +0000
Could you add SHARED=on to the ./configure invocation line ?       

Comment by: B-Con on Fri, 08 Oct 2010 01:14:27 +0000
Updated to pkgrel 3, to address the requests by remyoudompheng and vicencb below.       

Comment by: StefanHusmann on Mon, 18 Oct 2010 13:13:59 +0000
Users of old i686 hardware not supporting sse2 may have problems to build gf2x, and so also ntl. See my comment on g2x comment page.       

First Submitted: Sat, 01 Mar 2008 17:01:56 +0000       
ntl 5.5.2-3
( Unsupported package: Potentially dangerous ! )
==> Edit PKGBUILD ? ("A" to abort)
==> ------------------------------------
==>


这是官网的例子:
http://www.shoup.net/ntl/doc/tour-ex1.html#include <NTL/ZZ.h>
NTL_CLIENT
int main()
{
   ZZ a, b, c;

   cin >> a;
   cin >> b;
   c = (a+1)*(b+1);
   cout << c << "\n";
}

〇〇 发表于 2012-1-31 12:22:00

ZZ是什么数

wayne 发表于 2012-1-31 12:23:16

\$ g++ ntl.cpp -lntl
\$ ./a.out
1234567890987654321
1234567890987654322
1524157877457704726931870110752934006
\$ gcc --version
gcc (GCC) 4.6.2 20120120 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

\$ uname -a
Linux myarch 3.2.2-1-ARCH #1 SMP PREEMPT Thu Jan 26 08:28:27 UTC 2012 i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz GenuineIntel GNU/Linux
$

wayne 发表于 2012-1-31 12:30:03

ZZ是什么数
〇〇 发表于 2012-1-31 12:22 http://bbs.emath.ac.cn/images/common/back.gif
:)
好快的速度啊!
可以看看官网文档:
http://www.shoup.net/ntl/doc/tour-struct.html
Basic Ring Classes
    ZZ: big integers
    ZZ_p: big integers modulo p
    zz_p: integers mod "single precision" p
    GF2: integers mod 2
    ZZX: univariate polynomials over ZZ
    ZZ_pX: univariate polynomials over ZZ_p
    zz_pX: univariate polynomials over zz_p
    GF2X: polynomials over GF2
    ZZ_pE: ring/field extension over ZZ_p
    zz_pE: ring/field extension over zz_p
    GF2E: ring/field extension over GF2
    ZZ_pEX: univariate polynomials over ZZ_pE
    zz_pEX: univariate polynomials over zz_pE
    GF2EX: univariate polynomials over GF2E

wayne 发表于 2012-1-31 12:32:07

依赖包 gf2x 也很有背景,不可小觑
页: [1]
查看完整版本: NTL----数论C++库