This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a few questions about discrete rng


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.

Hi, 

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.

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]