It is a plugin package for Yorick (>= version 1.4) that, among other interesting things, adds functions that operate both on dense and sparse matrices.
Well, if you don't know what it is then this product is probably not for you. A sparse matrix is a matrix which is mostly filled with zeros. This allows us to store that matrix in a more compact form, reducing memory use and increasing computational speed in linear algebra operations.
I've been studying many different formats. I pretty like Scilab's coordinate storage, where the row index, the column index and the value are stored. It is easy to use and allows one to do most operations in a high order level (without using too much C). However it eats too much memory.
Thus, I opted form Compressed Row Storage [1] format, which is a bit more complicated but works extremely well for doing operations between matrices and vectors, and not so well for matrix <-> matrix operations.
Note: as a side note, I must say that linked list format is used when solving a linear system of equations. The reason why this format is not employed in the rest of the package is simply that Yorick lacks a good garbage collector, and is based on a sort of reference counting one, which is hard to use and --to me-- error prone.
Currently there's only one big absence: matrix product. The supported operations that have to do with sparse matrices are:
Well, there are a lot of other interesting additions, such as:
There are a number of things that you must get in order to install SpYorick:
In principle it should be possible to build SpYorick without some of these additions: it's just a matter of tweaking MyMakefile a bit. However, I've had not time to do this in a more friendly way.
make -f MyMakefile
$ cd tests $ ../spyorick Copyright (c) 1996. The Regents of the University of California. All rights reserved. Yorick 1.4 ready. For help type 'help' > #include "all.i" "TESTING SPARSE CREATION (double)" "================================" "1) double" " size = " 2 "; sparse <-> full ok!" " size = " 4 "; sparse <-> full ok!" [... and a whole bunch of output]
or you can do a
make -f MyMakefile installthat will copy the executable, plus `sparse.i', plus `cg.i' to the appropiate places in your $HOME directory.
Copyright (c) Juan Jose Garcia Ripoll.
All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
3. All advertising materials mentioning features or use of this
software must display the following acknowledgement:
This product includes software developed by Juan Jose
Garcia Ripoll.
4. The name of Juan Jose Garcia Ripoll may not be used to endorse
or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY JUAN JOSE GARCIA RIPOLL ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL HE BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
Juan Jose Garcia Ripoll
E.T.S.I. Industriales
Univ. Castilla-La Mancha
c/Camilo Jose Cela
E-13071 Ciudad Real
Spain
job: jjgarcia@ind-cr.uclm.es
home: worm@arrakis.es
www: http://www.arrakis.es/~worm
[1] R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. Donato, J. Dongarra, V. Eijkhout, R. Pozo, C. Romine, H. Van der Vorst. "Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods", SIAM (1994). (Available at http://www.netlib.org/templates/Templates.html)