fprintf for blocks/vectors: why the \n?
Brian Gough
bjg@network-theory.co.uk
Wed Dec 19 13:20:00 GMT 2001
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
More information about the Gsl-discuss
mailing list