help-gsl
[Top][All Lists]
Advanced

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

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


From: Patrick Alken
Subject: Re: [Help-gsl] Writing Chebychev coefficients to disk
Date: Mon, 12 Mar 2007 10:28:10 -0600
User-agent: Mutt/1.4.2.2i

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);

ASCII/XML formatting seems a bit excessive. I don't know anything
about XML but to do it properly with ascii you'll have to start
messing around with yacc/bison parsers.

Patrick Alken

On Mon, Mar 12, 2007 at 12:32:59PM -0300, Paulo Jabardo wrote:
> What could be interesting is to develop some
> guidelines on serialization of GSL objects. Any
> feature would have a standard way to write the code to
> a file (or stream) and a standard way to read it. Some
> sort of ASCII file format could be developed and
> objects could be written and read using this file
> format.
> 
> I don't need such resource for now for my C programs
> because GSL is a tiny part of my applications. I don't
> know how useful tis could be but I use R-project a lot
> and one of the features that I like a lot is the
> possibility to saving variables and environments to a
> file and being able to retrieve my work environment
> later. 
> 
> What do you think about this?
> 
> As for the format, there are several alternatives.
> Some XML thing, or, what I consider a better solution,
> some scripting language such as GUILE or LUA.
> 
> 
> Paulo
> 
> --- Brian Gough <address@hidden> escreveu:
> 
> > At Wed, 7 Mar 2007 21:25:30 +0100,
> > Oliver Jennrich wrote:
> > > I'm just working on a program that uses
> > (piecewise) Chebychev interpolation
> > > and need to write the corresponding
> > gsl_cheb_struct in a file for later use.
> > > 
> > > No big deal, but I was wondering if there is a
> > general need for something
> > > like gsl_cheb_series_write and
> > gsl_cheb_series_read.
> > 
> > Thanks for the suggestion, I've added a TODO entry
> > to provide a way to
> > save/restore coefficients, or access the coefficient
> > data.
> > 
> > -- 
> > Brian Gough
> > (GSL Maintainer)
> > 
> > Network Theory Ltd,
> > Publishing the GSL Manual -
> > http://www.network-theory.co.uk/gsl/manual/
> > 
> > 
> > _______________________________________________
> > Help-gsl mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/help-gsl
> > 
> 
> 
> __________________________________________________
> Fale com seus amigos  de gra?a com o novo Yahoo! Messenger 
> http://br.messenger.yahoo.com/ 
> 
> 
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl
> 




reply via email to

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