with-fortran-matrix

Raymond Toy <[email protected]> Tue, 27 Mar 2012 08:07:30 -0700
Newsgroups gmane.lisp.matlisp.devel
Message-ID <[email protected]>
Now that I've used the callback support a little, I'd like to propose
the following to make it a little easier to write callbacks for fortran
routines.

(WITH-FORTRAN-MATRIX (name fv &rest dimensions) &body body)

This makes it easier to access Fortran matrices so you can write

(defun callback (fv)
  (with-fortran-matrix (m fv (1 4) (1 5))
    (setf (m 1 3) (m 4 5))

The dimensions (1 4) and (1 5) are the lower and upper bounds of the
Fortran matrix m, which is an alias to the actual foreign vector in fv.

Or maybe it should be

(with-fortran-matrices ((m1 fv1 <dims1>)
                        (m2 fv2 <dims2>))
  body)

so that several matrices can be created at once.

Ray

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure