This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Matrix support and guile signal handlers


Telford Tendys writes:
 > I'm a bit of a guile newbie, I'm writing a matrix
 > handling library and I'd like to be able to use the
 > scheme interpreter to exaluate expressions, some
 > of which may involve matricies.
 > 

 > People who use Matlab or octave would know of the
 > usefulness of an interpretive language combined with
 > a matrix library.
 > 
 > Has guile got matrix support?
 > 
 > Has anyone else already started on this project?
 > 
 > I'm thinking that I should be able to make the
 > matrix data type an atomic type in guile by using
 > struct gscm_type and gscm_alloc_obj().
 > 
 > Then I can map new functions into scheme such as
 > (mat-+), (mat-*) and (mat-invert).
 > 
 > Is this a plausible direction?
 > 
 > Is there a better way?
 > 
There was some discussion about matrix package interfaces for guile a few days
ago on here. Especially Chris Lee is busy doing something in that direction, 
he first used the matrix manipulation library 'Meschach', and then switched to
LAPACK and BLAS. For wrapping those libs for guile, C.Lee invented the useful
powertool 'g-wrap', which takes a description of functions and datatypes you
want to add to guile and produces C-code that can be compiled and linked to 
extend guile with these functions and data structures. Other experts are Mark
Galassi, who maintains the GNU Scientific Library (yet in beta stage) and will
eventually wrap it for Guile, and Marius Vollmer who ponders about replacing
the octave/matlab syntax with a custom-extensible syntax via guile-scheme.
Other C-libraries that could be ported to guile in this context are GNU-Math
and Cephes.   

The best way to introduce new types into guile is by using so-called smobs
(small objects), which store the fundamental type informations (printing, 
garbage collection, comparison). The automated wrapper tools, like the above
mentioned g-wrap and Dav Beazley's swig, use smobs. Jim Blandy wrote a prelimi-
nary manual about data type representation and smobs for guile, dunno how far
this got yet.


Klaus Schilling