Arjen Markus (28 december 2009) I have been contemplating this for several years now, but I finally made a start with a wrapper extension to get the functionality of LAPACK into Tcl.
I started off with two simple BLAS routines (BLAS is the more basic library that underlies LAPACK - basic linear algebra system, if I am not mistaken) and the Fortran wrapper you can find in my ftcl library (see [L1 ]). Immediately I ran into design issues:
Take the routine dapxy, which computes a*X + Y (a a scalar, X and Y vectors) and returns the result in Y. The interface is such that X and Y could also be two-dimensional arrays (matrices) so that you could use this routine to update the rows and columns of a matrix Y using a vector X o a matrix X.
Questions that arise:
Right now, my answers are:
set result [daxpy $a $x $y]
(The Fortran interface is:
call dapxy( n, a, dx, incx, dy, incy )
Because of incx and incy, you can pass two-dimensional arrays such that only a part is updated.)
Another question is: should we wrap all routines (some 1500!) or just the more commonly used ones? (If so, which ones?)