MatLisp is not usually distributed as a tarball, so you will need to get sources from Git. Once you have extracted either the tarball or cloned a git repository for yourself, you can configure and build MatLisp.
This is a quick introduction on configuring MatLisp; See DetailedConfigureOptions for more information.
Let us assume you have the MatLisp sources in the directory matlisp. While you can configure and build in the matlisp directory, it's useful to build in a different directory. Let say we wish to build in the build directory. The first steps are:
- autoreconf --install
- mkdir build
- cd build
Choose one of the supported lisps (cmucl, allegro, or sbcl) and run configure:
- ../configure --enable-<lisp> --with-lisp-exec=<exec> --libdir=$PWD/lib --enable-static=no
The --with-lisp-exec option is only needed if configure cannot figure out the name and location of the executable for the selected lisp. The --enable-static=no option disables building of the static libraries which MatLisp doesn't use.
After configuring MatLisp, the next step is building. Just run
to build MatLisp. This may take some time, but all of the necessary shared libraries are built and installed in build/lib and all the Lisp functions are compiled. When the build is finished, you will be left at the Lisp prompt. You can either exit Lisp or start using MatLisp right away.
If you are the Lisp prompt after running make, you're basically set to start using MatLisp. In general, you just need to enter
to start using MatLisp.
If you want to start MatLisp from scratch, you can just start your Lisp and enter
* (load "<path-to>/build/start.lisp") * (in-package "MATLISP-USER")
where * is the Lisp prompt.
MatLisp modifies the standard Lisp reader so that you may enter matrices using the syntax illustrated below.
* [1 2; 3 4] #<REAL-MATRIX 1d0 2d0 3d0 4d0>
Matrices are enclosed by [ and ]. Each row of the matrix is separated from other rows by a semicolon ";".
Most matrix functions and operators start with the letter "m". So, to add two matrices use m+. To compute the eigenvalues of a matrix use (eig m).
To learn about the available functions, use (help). To get detailed information about the function use (help <fun>).