help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] gsl_vector_get () return status


From: Brian Gough
Subject: Re: [Help-gsl] gsl_vector_get () return status
Date: Thu, 03 Jan 2008 12:08:59 +0000
User-agent: Wanderlust/2.14.0 (Africa) Emacs/22.1 Mule/5.0 (SAKAKI)

At Wed, 02 Jan 2008 14:05:04 -0500,
Joel J. Adamson wrote:
> Is there a way to either (a) determine the length of the vector in C or
> (b) determine the error condition?  Is there some other variable that
> gets set (errno?) when the error occurs?  

Just to add to what has already been written:

There is no 'errno' type variable in GSL, due to the complications
with multithreaded programs.  

For the _get functions the only way to access the error would be
setting a custom error handler (gsl_set_error_handler). The global
error handler is really intended for general error handling though, so
it's not something I'd recommend as a solution in this case.

For some functions such as gsl_vector_get there's no convenient way to
return the out-of-bound information so we just return 0.  

Using v->size is the right way to get the size.

-- 
Brian Gough

GNU Scientific Library -
http://www.gnu.org/software/gsl/




reply via email to

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