This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

wrapper for GSL and Excel


I have written a little wrapper to call GSL from Excel (on Windows)
and have uploaded it to a Yahoo webspace (feeling unsure whether
this group here wants attachments) in the files section of 
http://groups.yahoo.com/group/axalom (due to Yahoo's policy one has
to sign in), the file name is wrapGSL_xl.zip, it contains the whole
project in MSVC 6.0 together with the compiled wrapper wrapGSL.dll
and an Excel sheet test.xls which shows how to use that.

It assumes that GSL.DLL is installed (usually in the Windows
systems directory).

The wrapping is simple: it takes a name (as string) of a GSL-function
as first argument and the actual argument(s) of the GSL-fct as the
next ones, hands it over to GSL.DLL and returns the result in the
__stdcall calling convention needed for Excel.

There is no syntax checking on calling GSL (so do not make mistakes
and better put everything in a VBA module). Please note that on a
crash Excel does not clean the memory properly and blocks files,
so only a restart helps :-(  In any case it is better to have the
GSL manual at hand instead of 'trial and error' testing ...

For using DLLs in Excel one must declare the functions in VBA and
for this you must set the correct path for wrapGSL.dll. Since the
functions are called by their 'names' one only needs to declare
some 'types'.

For this open the Excel project through the menu bar or <Alt>+F11.
After setting the correct pathes in the module m_DeclareDLL the
examples in the sheet should work.

The main use (for me) are the special functions within GSL.

I have included complex valued functions as well (but have not done
it very nice in Excel; additionally i have the impression that the
complex GSL fcts are slow).

Not yet done: more complicated arguments or results (like arrays
or numerical integration etc). May be some times in the future ...

Axel


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