This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: gsl_rng_fprintf and gsl_rng_fscanf
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Olaf Lenz <olenz at Physik dot Uni-Bielefeld dot DE>
- Cc: GSL Discussion List <gsl-discuss at sources dot redhat dot com>
- Date: Tue, 4 Nov 2003 21:53:03 +0000
- Subject: Re: gsl_rng_fprintf and gsl_rng_fscanf
- References: <3FA78C9D.3060102@Physik.Uni-Bielefeld.DE>
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