This is the mail archive of the
mailing list for the GSL project.
Re: a few questions about discrete rng
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Rodney Sparapani <rsparapa at post dot its dot mcw dot edu>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Mon, 8 Jul 2002 19:50:48 +0100 (BST)
- Subject: Re: a few questions about discrete rng
- References: <200207081615.g68GFSh05807@post.its.mcw.edu>
Rodney Sparapani writes:
> Thanks for your reply. I don't know if I'm adding to this
> discussion either :o) But, many other parts of GSL including
> gsl_vector use size_t. So, I can see where you got it from.
> However, it's wide spread misuse is not good IMHO. I suppose many
> C programmers can "see through" typedefs and not be as easily
> distracted as a bumbling statistician. Something more
> user-friendly would be nice though. Also, after having learned a
> complex API like gsl_vector, I think it best to propagate that
> knowledge throughout. Lastly, gsl_vector would have a certain
> flexibility that pointers would not. For example,
> gsl_ran_discrete_t would not have to also store K. Maybe not the
> best example, but I think you can see what I mean.
size_t is the preferred way to represent the size of objects or arrays
in C. Using "int" is not portable, e.g. to 64-bit platforms.
We don't use gsl_vector for simple arrays. One of the design
decisions was that it should be possible to use GSL in a minimal way,
without having to drag in too many header files if one only needs to
call a single function. See doc/gsl-design.texi for details.