This is JAS version: jas-2.3, subversion revision: 3757 (export at 2011-09-03).
The JAS classes jar-file
jas-2.3.3757-bin.jar
can be used the same way as any other Java archive during
compilation and execution of your Java programms.
The source code is in
jas-2.3.3757-src.jar
current version for JDK 1.6.
(right click on the link and chose "save link as")
The Javadoc API documentation is in
jas-2.3.3757-doc.jar
for current version.
The JAS Git repository is available with
git clone http://krum.rz.uni-mannheim.de/jas.git jas
Required libraries:
lib/log4j.jar (from Apache Log4j),
lib/junit.jar (from Junit),
In case you have the first two ones, just ensure they are in the
correct location (e.g. ../lib/
) or they are in the class path.
In case you can not use Apache log4j for some reason, there is an adaptor package mylog.jar which delegates all logging calls to native Java logging.
Optional libraries and files:
For latest developments see JAS Weblog and the Subversion change log.
Add the JAS jar-file and the other required jar-files to the classpath. Start using it in your applications. For example
javac -classpath log4j.jar:junit.jar:jas.jar:. -d . src/edu/jas/gb/Examples.java java -classpath log4j.jar:junit.jar:jas.jar:. edu.jas.gb.Examples
If you want to develop with JAS, then extract the
jar-file in a new directory
jar -xvf jas-[version]-src.jar
JAS is currently developed for Java 6 (Sun JDK 1.6 and OpenJDK 1.6). It will compile also under Java 5 (Sun JDK 1.5), but some (concurrency) classes may not work under the Java Virtual Machine (JVM) of JRE-1.5. It seems best to disable automatic parallel computation then (see edu.jas.kern.ComputerThreads.NO_THREADS).
Among the extracted files, there is an Ant build script
build.xml
and also a Gnu make file
Makefile
.
To use Ant, you must edit the build.xml
file and
adjust the lib
property to point to the directory
where you downloaded the jar files.
Also be sure to use the correct JDK version, e.g. via setting the
JAVA_HOME
environment variable.
To use the Gnu make file, you must edit the Makefile
and adjust the JDK
and the LIBPATH
variables.
Most useful Ant targets:
ant compile
changed Java files are compiled,
ant recompile
all Java files are compiled,
ant test
run all JUnit tests,
ant clean
remove backup files,
ant distclean
remove all class files,
ant doc
create the Javadocs.
Most useful make file targets:
make "class"
run the main()
method of the class,
e.g. make edu.jas.poly.Examples
run
the class Examples
.
Unit tests can be run with the "test" target for ant, e.g.
ant test
The output of the unit tests is collected in the directory
test
for inspection.
The test units work mainly with generated random polynomials.
The parameters are choosen such that the resulting Groebner bases
are not to hard to compute.
However some random polynomials may be to big and the running time
may occasionally be several minutes (but not hours).
On the other hand random polynomials may sometimes be zero or one.
If such input does not make sense the test will fail. I.e. some
tests will fail from time to time, but not for repeated execution
of the test. So if a test fails rerun the test a few times.
The JAS documentation is contained in the jar files
jas-[version]-src.jar
and jas-[version]-doc.jar
.
Extract the jar files and start exploring with any browser
from the index.html
file in the main directory.
The JAS javadoc API documents and the jython documents can also be browsed online: API javadocs and epydoc of jas.py.
README and licencing: COPYING.jas (GPL) or COPYING.lgpl.jas (LGPL)
The JAS source distribution can also be compiled and used from the Eclipse integrated development environment.
Instructions to install the JAS source:
/src
from 1.
Instructions to install the JAS binary:
Create and edit a sample java programm which uses the JAS API. E.g. the following sample computes the first ten Legendre polynomials.
import java.util.List; import java.util.ArrayList; import edu.jas.arith.BigRational; import edu.jas.poly.GenPolynomial; import edu.jas.poly.GenPolynomialRing; public class mytests { public static void main(String[] args) { BigRational fac = new BigRational(); String[] var = new String[]{ "x" }; GenPolynomialRing<BigRational> ring = new GenPolynomialRing<BigRational>(fac,1,var); int n = 10; List<GenPolynomial<BigRational>> P = new ArrayList<GenPolynomial<BigRational>>(n); GenPolynomial<BigRational> t, one, x, xc; BigRational n21, nn; one = ring.getONE(); x = ring.univariate(0); P.add( one ); P.add( x ); for ( int i = 2; i < n; i++ ) { n21 = new BigRational( 2*i-1 ); xc = x.multiply( n21 ); t = xc.multiply( P.get(i-1) ); // (2n-1) x P[n-1] nn = new BigRational( i-1 ); xc = P.get(i-2).multiply( nn ); // (n-1) P[n-2] t = t.subtract( xc ); nn = new BigRational(1,i); t = t.multiply( nn ); // 1/n t P.add( t ); } for ( int i = 0; i < n; i++ ) { System.out.println("P["+i+"] = " + P.get(i) ); } } }
Set up your .jythonrc
file, e.g. see the sample code in
sample.jythonrc.
Be sure you have downloaded the above libraries log4j.jar, junit.jar and jas*-bin.jar.
The main file to interface to the JAS library is jas.py. It must be imported by other Python files. HTML documents of the interface can be found here.
If jython cannot find the JAS classes, try to put the jas.jar also into the CLASSPATH or unpack the jar into the directory you are starting jython (also to get the correct version of .py files).
Start using JAS, e.g.
jython examples/trinks.pyThe examples/trinks.py contains an Groebner base example named after its proposer Mr. Trinks. The file runs a sequential, a parallel and a distributed version of the Groebner base algorithms.
For further discussion of the JAS jython interface see User guide.
Be sure you have downloaded the above libraries log4j.jar, junit.jar and jas*-bin.jar.
The main file to interface to the JAS library is jas.rb. It must be imported by other Ruby files. HTML documents of the interface can be found here.
Start using JAS, e.g.
jruby -J-cp "../lib/log4j.jar:../lib/junit.jar:." examples/trinks.rbThe examples/trinks.rb contains an Groebner base example named after its proposer Mr. Trinks. The file runs a sequential, a parallel and a distributed version of the Groebner base algorithms.
For further discussion of the JAS scripting interface see User guide.
Last modified: Sun Mar 13 18:12:41 CET 2011