找回密码
 欢迎注册
查看: 12964|回复: 4

[原创] NTL----数论C++库

[复制链接]
发表于 2012-1-31 12:20:21 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?欢迎注册

×
以前和无心人 在 arch linux下用gcc 4.5编译NTL 编译不过去,
今天,还是arch linux,kernel 3.2.2, gcc 4.6.2 ,编译过来了。
[root@myarch ~]# 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 ? [Y/n] ("A" to abort)
==> ------------------------------------
==>



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

  6.    cin >> a;
  7.    cin >> b;
  8.    c = (a+1)*(b+1);
  9.    cout << c << "\n";
  10. }
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2012-1-31 12:22:00 | 显示全部楼层
ZZ是什么数
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2012-1-31 12:23:16 | 显示全部楼层
[wayne@myarch ~]\$ g++ ntl.cpp -lntl
[wayne@myarch ~]\$ ./a.out
1234567890987654321
1234567890987654322
1524157877457704726931870110752934006
[wayne@myarch ~]\$ 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.

[wayne@myarch ~]\$ 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@myarch ~]$
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2012-1-31 12:30:03 | 显示全部楼层
ZZ是什么数
〇〇 发表于 2012-1-31 12:22


好快的速度啊!
可以看看官网文档:
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
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2012-1-31 12:32:07 | 显示全部楼层
依赖包 gf2x 也很有背景,不可小觑
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-4-19 14:01 , Processed in 0.059482 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表