-------- Original Message --------
Subject: NaNs in the GSL
Date: Tue, 26 Sep 2006 11:57:04 -0700
From: Ben Klemens <klemensn at hss caltech edu>
To: [EMAIL PROTECTED]
Brian,
I have been working on a library of functions for statistical analysis,
named Apophenia. As you can imagine, it is based heavily on the GSL,
but it's intended to do work on the level of the typical stats package
(easy commands to run OLS, find covariances, et cetera).
Here's my problem: NaNs. Most real-world data that one would interrogate
is filled with them. The typical stats package has a global switch
named something like rm_NaNs; if rm_NaNs==0, then most functions (min, max,
variance, et cetera) will return NaN if any element of the input is NaN, and
if rm_NaNs==1, then these functions auto-prune, by prepending every use
of x with something like
if (!rm_NaNs || !gsl_isnan(x))
use x
So has the GSL team considered including such a flag in the GSL? As above,
fixing the code in most cases would be a trivial one-line insertion,
but are there other reasons for not adding a global gsl_rm_NaNs variable?
I'm on the verge of re-implementing many GSL functions with the above
check for NaNs added in, but it would clearly be best if the GSL itself
handled these things directly.
What do you think?
Thanks,
Ben