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: gsl_rng_fprintf and gsl_rng_fscanf


Olaf Lenz writes:
 > Therefore it seems to be necessary to add two function pointers
 > 
 > void (*printf) (void *state, FILE *file) void (*scanf) (FILE *file,
 > void *state)
 > 
 > to the gsl_rng_type struct in the fashion of the get and set
 > functions and implement the respective function for every single of
 > the RNG types.
 > 
 > Before I set off to do this, I would like to ask the lot of you, if
 > there's any reason why it shouldn't be done like this?

>From the library viewpoint, it would be very costly to implement these
functions for every generator.

If I needed to store generator state portably I think would write my
own function which did a lookup on the generator name (from the
struct) and just handled the generators that I needed, using XDR or
some similar existing protocol.

There is a lot to be said in favor of using binary files on the same
architecture though.

-- 
Brian


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