Konstantin L. Metlov wrote:
Hello !

I'm looking for possibilities to plug a Fortran numerical integration routines into J to be able to evaluate numerical quadratures efficiently. This is especially needed for multi-dimensional integrals, requiring an adaptive sub-division of integration region, which is alredy implemented very efficiently in Fortran (for one-dimensional case I wrote a simple Jacobi-Gauss quadrature in pure tacit J, which is fast enough and allows for endpoint singularities).

What I'm missing is the possibility to pass a pointer to the integrand function (written in J) into the Fortran or C code (called from J).

I've seen the lab on callbacks, but they are only allowed to return a scalar integer result, while I'd like to be able to receive and pass back to Fortran (or C) a vector (of floats) or, even better, a general array. Is there another interface for writing external (defined in DLLs) adverbs (or conjunctions), taking a function (verb) as an argument ?

Thank you !

With the best regards,
                           Konstantin.

Hi Konstantin,

You might take a look at: http://www.jsoftware.com/jwiki/Interfaces/Fortran and http://www.jsoftware.com/jwiki/Packages/LBFGS . These discusses one technique of interfacing Fortran subroutines to J.

In particular, the lbfgsb routine is designed in a co-routine style that allows the J code to test the results of the Fortran routine and then return to Fortran for further processing. The data passed back and forth between J and Fortran consists of a boxed list of scalars and vectors, of floats, ints and chars.

All the best,
David Mitchell
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to