[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] using gamma functions in a standalone manner

From: Alex Lancaster
Subject: [Help-gsl] using gamma functions in a standalone manner
Date: 14 Apr 2004 05:58:25 -0700


I'm using the log(n!) factorial functions from GSL, specifically the
gsl_sf_lnfact() function.  I'd like to be able to extract this single
function, and include it in the source of my (GPLed) program, as I'd
rather not add GSL as a dependency for my source for one function.

In the "Code Reuse" section of the reference manual, it specifically
mentions that this is possible (assuming that you are distributing
your own programs under the GPL, which I am doing) by redefining a few
macros and includes.  However, I'm having difficulting extracting the
right amount code to call this function.

In the specfunc directory I started with gamma.c, gsl_sf_gamma.h, and
attempted to pair down the dependencies, and found and redefined
macros locally as I the compiler found them, but it became rapidly
obvious that there are many dependencies from the various header files
not in the even in the "specfunc" and perhaps other .c files (such as

So before I get too far into the guts of GSL, does anybody know if
this is feasible with these particular special functions (which seem
to make heavy use of the various macros and utility functions)?  Does
anybody know a reasonably straightforward way to just compile gamma.c?
Or, put another way, what's a good strategy to minimize the amount of
GSL code I would need to put into my program that also avoids worrying
about getting too tangled up in sorting out the interdependencies?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]