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: fprintf for blocks/vectors: why the \n?


Fleur Kelpin writes:
 > If the automatic \n in block/fprintf_source.c were to go, people could
 > provide the format "%g\n" or "%g\t" or anything they like.

Hi,

That function is just intended as an ascii version of the binary write
function, for portability purposes.  Hence it dumps the list of
numbers to the stream without any structure.

 > The way things are now, I find I am writing my own for loops for printing,
 > whereas gsl tries to provide this functionality.

Yes, to actually display a vector or matrix you'll need to write your
own (little) display routine which prints them in your favorite
format.  Then you can call one of those routines whenever you need to
display a vector or matrix.

If somebody writes some good routines they can go into the library.
Ideally they should be able to display in all the standard formats
like Fortran, Octave, HTML, TeX, troff, etc using an argument to
select between them. 

regards

Brian


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