Tue 18 Dec 2007 05:37:31 PM UTC, original submission:
Reply-To: -unavailable-
From: Brian Gough <bjg@network-theory.co.uk>
To: -unavailable-
Subject: Re: [Help-gsl] Writing Chebychev coefficients to disk
Date: Mon, 12 Mar 2007 21:40:21 +0000
At Mon, 12 Mar 2007 10:28:10 -0600,
Patrick Alken wrote:
>
> It seems to me the simplest way to do this is just:
>
> fwrite(gsl_cheb_ptr, sizeof(gsl_cheb_series), 1, fp);
> fwrite(gsl_cheb_ptr->c, sizeof(double), n, fp);
>
> and later:
>
> fread(gsl_cheb_ptr, sizeof(gsl_cheb_series), 1, fp);
> fread(gsl_cheb_ptr->c, sizeof(double), n, fp);
>
Yes, the library should help in getting the correct value of "n"
(which is c->order + 1 in this case) to avoid subtle off-by-one
errors.
It's certainly more useful to expose the memory than provide the read
and write functions directly though.
--
Brian Gough
Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/
_____________________________________________
Help-gsl mailing list
-unavailable-
http://lists.gnu.org/mailman/listinfo/help-gsl
|