NTL 介绍
NTL is a high-performance, portable C++ library providing data structures
and algorithms for manipulating signed, arbitrary length integers, and
for vectors, matrices, and polynomials over the integers and over finite
fields.
步骤
1.在https://www.shoup.net/ntl/下载 WinNTL-11_4_3.zip , 并解压到 任意目录 (目录不要有中文和空格,以下也是)
2.将WinNTL-11_4_3中include文件夹下的文件复制到codeblocks安装目录/MinGw/include
3.打开codeblocks 新建一个 static library 项目 项目名字lib(名字随意)
右键lib项目,Add files(添加文件),添加 WinNTL-11_4_3解压目录/src 文件夹下所有文件
点击打开,成功后如图所示
点击 Settings/Compiler/Search directories
添加 WinNTL-11_4_3解压目录\include 目录
编译项目
等待编译完成后, Settings/Compiler/Linker settings ,点击Add , 从 项目路径\lib\bin\Debug 中添加 lib.a 文件
至此NTL已经配置好了!
测试
新建项目 选择控制台应用程序
在A Tour of NTL: Examples中, 有很多NTL的样例
比如我们选择Big Integers 来测试下
复制代码到codeblocks中, 编译运行,随便敲两个大数,看到程序很快就给出了结果
首发于 blog.laphel.com