[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Writing Chebychev coefficients to disk

From: Brian Gough
Subject: Re: [Help-gsl] Writing Chebychev coefficients to disk
Date: Mon, 12 Mar 2007 21:40:21 +0000
User-agent: Wanderlust/2.14.0 (Africa) Emacs/21.3 Mule/5.0 (SAKAKI)

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

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 -

reply via email to

[Prev in Thread] Current Thread [Next in Thread]