C++ 中的代数算术包?
我正在寻找一个与 C++ 兼容的包,可以使用代数进行算术运算。 (注意:代数数是指具有整数系数的多项式的根的数字,因此它不以十进制或有理表达式形式给出)。
Mathematica 将代数数作为“根对象”处理,由具有选择根的多项式表示。然后可以对两个这样的根对象进行相加、相乘等操作,然后进行约减,得到一个新的根对象。
有没有一些软件可以用 C++ 做同样的事情?我见过一些奇特的数论包,它们通过数字字段扩展来做各种事情,但我更喜欢简单的东西,而不是只用代数数做基本算术,即加法、减法、乘法、除法、归约、测试相等性。 。
I am looking for a C++-compatible package that can do arithmetic with algebraic numbers. (Note: an algebraic number means a number that is a root of a polynomial with integer coefficients, so it is not given as a decimal or rational expression).
Mathematica handles algebraic numbers as "root objects", which are represented by polynomials with a choice of root. Then two such root objects can be added, multiplied, etc, and then reduced, to get a new root object.
Is there some software that does the same thing in C++? I have seen some fancy number theory packages that do various things with number field extensions, but I would prefer something simple than can just do basic arithmetic with algebraic numbers, i.e. addition, subtraction, multipication, division, reducing, testing for equality. .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Givaro:用于算术和代数计算的 C++ 库
Givaro: C++ library for arithmetic and algebraic computations
Mathematica 有一种与 C++ 交互的方法。如果这对你有用,我会推荐这种方法,因为你的需求可能过于本地化,无法找到一个已经拥有你需要的一切但没有太多其他东西的包。
http://reference.wolfram.com/mathematica/guide/CLanguageInterface.html
Mathematica has a way of interfacing with C++. If this could work for you, I would recommend this method, as your needs may be too localized to find a package which already has everything you need and not much else.
http://reference.wolfram.com/mathematica/guide/CLanguageInterface.html