gsl (version 1.6-10)

Misc: Argument processing and general info

Description

Massages arguments into a form suitable for passing to C functions; also general package info.

Usage

process.args(...)
strictify(val,status)

Arguments

...
Argument list to be coerced to the same length.
val
Value component of &result
status
status integer

Details

Function process.args() et seq is called, if possible, to massage the arguments into a form suitable for passing to .C(). For example, in function hyperg_0F1(c,x), one wants hyperg_0F1(0.1, c(0.3,0.4)) and hyperg_0F1(c(0.1,0.2), 0.3) and hyperg_0F1(c(0.1,0.2),c(0.3,0.4) to behave sensibly. Function process.arg() does this by returning a list whose elements are vectors of the same length. Most of the special functions use process.args() to ensure that the returned value takes the attributes of the input argument with most elements where possible. Function strictify() uses the status value returned by the error form of the GSL special functions to make values returned with a nonzero error a NaN. In most of the special functions, strictify() is called if argument strict takes its default value of TRUE. Setting it to FALSE sometimes returns a numerical value as per the GSL reference manual.

In most of the special functions, if argument give takes its default value of FALSE, only a numerical value is returned. If TRUE, error information and the status (see preceding paragraph) is also returned.

The function naming scheme directly copies the GSL manual except that leading gsl_sf_ and, if present, the trailing _e is stripped: thus gsl_sf_Airy_Ai_e goes to R function airy_Ai(); however, some functions retain the prefix to avoid conflicts (viz gsl_sf_sin(), gsl_sf_cos(), gsl_sf_gamma(), gsl_sf_ choose(), gsl_sf_beta()).

R function arguments have the same names as in the GSL reference manual, except for the quasirandom functions documented in the Qrng manpage.

The package is organized into units corresponding to GSL header files; the .c, .R, and .Rd filenames match the GSL header filenames, except that the .Rd files are capitalized. Functions appear in all files in the same order as the GSL reference manual, which precludes the use of the tidying method given in section 3.1 of R-exts. Error forms of GSL functions (_e versions) are used if available.

In general, documentation is limited to: (a), a pointer to the GSL reference book, which would in any case dominate any docs here; and (b), re-productions of some tables and figures in Abramowitz and Stegun (June 1964).

References

http://www.gnu.org/software/gsl