简体   繁体   English

整数上的线性代数包

[英]Linear algebra package over the integers

I've recently ran into the following problem. 我最近遇到了以下问题。 Given a list of vectors (here I mean tuple) all with integer entries, is there a package (language isn't too much an issue, the faster the better, so I guess C) to very quickly determine when another integer vector is in the span of the original list? 给定一个带有整数条目的向量列表(在这里我指的是元组),是否有一个程序包(语言不是太大的问题,越快越好,所以我猜是C)可以非常快速地确定何时有另一个整数向量原始列表的范围? I need to do this arithmetic over the integers (no division). 我需要对整数(无除法)进行这种算术运算。 I'm sure there is one, but wanted to circumvent the lengthy literature review. 我敢肯定有一个,但是想避开冗长的文献综述。

You could use the mathnf function in PARI to compute the Hermite normal form of the matrix containing your spanning vectors as columns. 您可以在PARI中使用mathnf函数来计算矩阵的Hermite法线形式 ,该矩阵将跨越向量作为列。 The columns of the HNF matrix span the same lattice, and it is trivial to check if a vector is in this lattice. HNF矩阵的列跨越相同的网格,并且检查向量是否在此网格中很简单。 There are many more libraries able to calculate the HNF -- Google is your friend. 还有更多能够计算HNF的库-Google是您的朋友。

CVXOPT may be an option. 可以选择CVXOPT In particular, look at this function: 特别是看一下这个函数:

cvxopt.glpk.ilp = ilp(...)  
Solves a mixed integer linear program using GLPK.

(status, x) = ilp(c, G, h, A, b, I, B)

PURPOSE
Solves the mixed integer linear programming problem

minimize    c'*x
subject to  G*x <= h
            A*x = b
            x[I] are all integer
            x[B] are all binary

Look at this post also: binary linear programming solver in Python 还请看这篇文章: Python中的二进制线性编程求解器

也许LinBox是您所需要的。

Does LINPACK have anything? LINPACK有什么吗?

http://en.wikipedia.org/wiki/LINPACK http://en.wikipedia.org/wiki/LINPACK

We used to use it a lot in my vector/supercomputer days, and there are usually hardware specific versions. 在我的矢量/超级计算机时代,我们经常使用它,并且通常有特定于硬件的版本。

The best libraries I know of for this are: 我所知道的最好的库是:

Pari (not GP, but the Pari library itself): http://pari.math.u-bordeaux.fr/ Pari(不是GP,而是Pari库本身): http : //pari.math.u-bordeaux.fr/

NTL (C++): http://www.shoup.net/ntl/ NTL(C ++): http//www.shoup.net/ntl/

IML: http://www.cs.uwaterloo.ca/~astorjoh/iml.html IML: http//www.cs.uwaterloo.ca/~astorjoh/iml.html

We are starting to add this sort of functionality in flint2 (in particular in the fmpz_mat module): 我们开始在flint2中添加这种功能(尤其是在fmpz_mat模块中):

https://github.com/fredrik-johansson/flint2 https://github.com/fredrik-johansson/flint2

The aim of flint is make it absolutely as fast as possible, though the matrix stuff is still heavily under development. 火石的目的是使它尽可能快地完成,尽管基质材料仍在大量开发中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM