The LinBox C++ library (http://www.linalg.org) performs exact linear algebra and provides a set of routines for the solution of linear algebra problems such as rank, determinant, and the solution of linear systems. It provides representations for both sparse and dense matrices over integers and finite fields. It has a particular emphasis on black-box matrix methods (which are very efficient over sparse matrices), but increasingly also provides elimination-based routines for dense matrices using the industry-standard BLAS numeric routines.
GAP (http://www.gap-system.org) is a system for computational discrete algebra, with particular emphasis on Computational Group Theory. It provides good implementations of exact linear algebra routines on dense matrices over all common fields and the integers. Typically, GAP's versions are faster than LinBox for small finite fields (i.e. order less than 256), but LinBox is much faster for larger finite fields and the integers.
The linboxing (LinBox-in-GAP) package provides an interface to the LinBox C++ library from GAP. It provides alternative versions of GAP linear algebra routines which are mapped through to the equivalent LinBox library routines at the GAP kernel level. The functions provided by the linboxing package are named the same as the GAP equivalents, but are all contained within the LinBox
record, and so are prefixed with `LinBox.
'. The functions provided are
over the integers and prime fields.
The linear algebra routines provided by the linboxing package are, in the majority of cases, considerably faster than the native GAP versions, and scale better with matrix size. This speed is at the expense of memory, since the GAP matrices and vector must be copied into a memory format that LinBox can use.
The tables below give typical timings when performing operations on a 500 x 500 matrix. All of the timings given below were performed on a 3.20GHz Intel Core i7 Linux machine using GAP version 4.4.12 and version 0.5.2 of the linboxing package. The tests consider the various equivalent methods in GAP and linboxing, and the various different data representations used internally by GAP
The most dramatic speedups are seen for matrices of integers, where the linboxing routines are significantly faster. It is also faster for large prime fields, but GAP is better for small finite fields due to its very efficient internal representation of those fields. These observations hold for all Rank, Determinant and SolutionMat calculations, but the Trace method is so simple that it appears to be always faster to use GAP
These timings are offered as guidelines. The speedup should be larger with larger matrices, but a gain can also be seen with much smaller matrices (e.g. the Rank of a 15 x 15 integer matrix). The user is encouraged to perform their own timing experiments to assess the likely gain in their own cases.
Operation | Standard GAP method | GAP IntMat method |
linboxing method |
RankMat / Length(BaseIntMat) | 2822.08s | 73.21s | 0.10s |
DeterminantMat / DeterminantIntMat | 184.71s | 78.84s | 7.12s |
SolutionMat / SolutionIntMat | 6423.93s | 144.92s | 2.19s |
TraceMat | 0.00s | - | 0.52s |
Operation | Standard GAP method | GAP IntMat method |
linboxing method |
RankMat / Length(BaseIntMat) | 6375.83s | 149.78s | 0.32s |
DeterminantMat / DeterminantIntMat | 2998.70s | 133.67s | 103.74s |
SolutionMat / SolutionIntMat | 15210.10s | 840.73s | 34.52s |
TraceMat | 0.00s | - | 0.73s |
Operation | Standard GAP method | linboxing method |
RankMat | 1.95s | 0.14s |
DeterminantMat | 1.92s | 0.14s |
SolutionMat | 3.64s | 0.33s |
TraceMat | 0.00s | 0.35s |
Operation | Standard GAP method | linboxing method |
RankMat | 0.00s | 0.06s |
DeterminantMat | 0.00s | 0.06s |
SolutionMat | 0.00s | 0.21s |
TraceMat | 0.00s | 0.29s |
generated by GAPDoc2HTML