Maple-LinBox Package - Project LinBox

Home
Overview
News
People
Download
Documentation
Developer
Links
Support

GAP homology package
Maple-LinBox package

Online computing servers
An entirely new Maple interface is included with LinBox, starting at version 1.1.0. Please see the LinBox distribution for details.

This replaces an older Maple-LinBox package (version 0.3).

Maple-LinBox Package

Version 1.0 developed by Pascal Giorgi,
any questions and comments should be post to pascal.giorgi@univ-perp.fr

Table of Contents

  1. Description
  2. Requirements
  3. Compilation and Installation
  4. Usage
  5. Performances
  6. Known bugs

Description

The new Maple-LinBox package enables LinBox computation within Maple session. In particular, you can simply call LinBox functionalities (e.g. Determinant, Rank, Minimal Polynomial,...) on Maple matrices. Both computation over the integers and over small prime fields (i.e. at most 26 bits) are currently available. The speedup of LinBox against LinearAlgebra Maple's module is tremendous. it allows for instance the computation of an integer determinant of 400x400 dense matrix with entries lying in [1..100] in only 1.7s on PIV-3.2Ghz while Maple computation turns out to need 536s.

Requirements

This package requires at least version 9 of Maple and version 1.1 of LinBox. All requirements of LinBox library are still necessary to compile the interface. Currently, our interface only supports Linux based system. This is especially due to calling function convention. A Windows compliant version of the interface is still under progress. The interface has not been yet tested on MAC based system. Any report would be appreciated.

In summary, you need

  1. Maple v9.0 or greater
  2. LinBox 1.1 or greater
  3. all LinBox dependencies
  4. Linux based system

Compilation and installation

In order to enable the Maple-LinBox package during LinBox installation, you have to specify the installation directory of Maple to the configure script with the option --with-maple. An example of installation enabling LinBox-Maple interface will look like:

./configure --with-maple=Maple_installation_path --enable-shared

The flag --enable-shared is mandatory to enable the compilation of LinBox-Maple interface. Due to the heaviness of the generated library, you can turn off the static compilation of LinBox to save half of the compilation time. This can be achieved with the --disable-static option given to the configure script.

Once you get LinBox compiled and installed, you need to add the newly created LinBox-Maple module to Maple module knowledge. This is achieved by adding the path of the LinBox-Maple module to the "libname" variable of Maple. You can do this permanently by setting this variable in your .mapleinit file located in your home directory (file can be created if it does not exist). This file should contain

libname:="LINBOX_PATH/lib/LinBoxMaple", libname:

where you would have replaced LINBOX_PATH by the installation path of the LinBox library.

Usage

You can access the Linbox-Maple functionalities in your Maple session in loading the LinBox Module with the command line with(LinBox); Hence, you get access to five solutions to exact linear algebra problem. namely

  • lbDeterminant -> Determinant computation
  • lbRank -> Rank computation
  • lbMinpoly -> Minimal Polynomial computation
  • lbCharpoly -> Characteristic Polynomial computation
  • lbSolving -> Linear System solving

For all these functions, you have access to either a computation over the integer or over a small prime field. Here is some examples of use:

A:=Matrix(100,rand(1..100));
b:=Vector(100,rand(1..100));

#determinant of A
d1:=lbDeterminant(A); # over the integer
d2:=lbDeterminant(65521,A); # over GF(65521)

#characteristic polynomial of A
P1:=lbCharpoly(A,'x'); # over the integer
P2:=lbCharpoly(65521,A,'x'); # over GF(65521)

# resolution of Ax=b
x1:=lbSolving(A,b); # over the integer
x2:=lbSolving(65521,A,b); # over GF(65521)

...

Performances

you can find below some performance comparisons between our LinBox-Maple interface and LinearAlgebra module of Maple. The matrices are dense with integers coefficient lying in [1..100]. Computation are done on a PIV-3.2Ghz, 1Gb RAM.

Determinant
n 50 100 200 400
Maple 0.214s 1.609s 16.073s 536.533s
LinBox 0.014s 0.094s 0.502s 1.771s
speedup 15.28 17.11 32.01 302.95
Rank
n 50 100 200 400
Maple 0.463s 1.439s 17.104s 542.702s
LinBox 0.006s 0.016s 0.083s 0.298s
speedup 77.16 89.93 206.07 1821.14
System Solving
n 50 100 200 400
Maple 0.331s 0.886s 4.126s 52.002s
LinBox 0.013s 0.053s 0.398s 2.552s
speedup 25.46 16,71 10.36 20.37
Characteristic Polynomial
n 20 40 80 160
Maple 0.121s 2.223s 40.434s 906.416s
LinBox 0.007s 0.018s 0.143s 1.336s
speedup 17.28 123.50 282.75 678.45

Known bugs

Unfortunately, some bugs present in Maple API lead to problem in our interface. In particular, you can find below a list of known bugs in our interface due to Maple bugs:

  1. Maple v9.0: the with(LinBox); leads to an error in loading the module. This is due to a non re-evaluation of the Maple define_external when loading module. The only alternative, to my knowledge, to fix this problem for our LinBox interface is to replace the with(LinBox); command with

    read("LINBOX_PATH/lib/lb-maple.mpl");
    Dev:-lbStart();

    Here again, the LINBOX_PATH variable should be replaced by the LinBox installation path. This alternative should work but is not fully satisfying. Any idea would be helpful on this.
  2. Maple v10.0 : our interface is unfortunately suffering from a conversion error in low level function of Maple API. In particular, the conversion of immediate negative integers are bugged and always returns zero. Therefore, right now negative integer greater than -2^31+1 on (32 bits machine) or -2^63+1 on (64 bits machine) are not supported. Hopefully, this problem should be fixed in newer Maple release. We are working hard to find a good solution for this problem in our interface.

Valid HTML 4.0! Valid CSS! Page prepared by Pascal Giorgi <pascal.giorgi@univ-perp.fr>,
This page's URL: http://www.linalg.org/maple-linbox.html
Page created: 1 February 2007
Page last updated: 1 February 2007