|
From: Ethan M. <merritt@u.washington.edu> - 2008-12-01 21:25:20
|
On Saturday 29 November 2008 22:05:35 Shigeharu TAKENO wrote:
> shige 11/30 2008
> ----------------
>
> Ethan A Merritt wrote:
> | > 3) The following setting make core dump on our environment:
> | >
> | > set datafile binary format='%*2double%double'
> |
> | The feature "set datafile binary format=..." was never implemented,
> | despite what it says in the documentation. For now I have
> | added an error message in the CVS version that prevents you from
> | issuing such a command, and therefore prevents the segfault.
>
> Thanks. I understand.
>
> | However, please try the attached patch and tell me if it works for you.
> | This patch is against current CVS (27 November 2008).
>
> It seems to work as expected. But, I think there have been some
> problems yet.
>
> 1) We can some options on 'set datafile binary', but we must
> remain to the splot command line:
>
> set datafile binary format='%double'
> splot 'data1' binary record=5x5 using 1:2:3 w lp
>
> is OK, but
>
> set datafile binary format='%double' record=5x5
> splot 'data1' binary using 1:2:3 w lp
>
> is not.
That problem is easy to fix.
Revised patch is attached.
> 2) Since I have not understand 'array' yet, I think it needs to
> modify the document for 'binary array' and 'binary record' to
> explain data format required by 'array' and 'record' precisely,
> like as 'binary matrix'.
I cannot write documentation for it, because I do not understand it.
You probably understand it better than I do.
I think the binary file code is a horrible mess, and should
be ripped out, re-designed, and re-written from the beginning.
But I don't have time to do that myself, and I don't see anyone else
volunteering. Small fixes may be the best we can do.
> 3) The document for 'binary array' says:
>
> A special "number", `Inf`, can be used to indicate that data
> should be read until the end of file.
>
> But, I obtain unexpected results:
>
> gnuplot> set datafile binary record=5xInf
> gnuplot> show datafile binary
> ....
> Record 0:
> Dimension: 5
> Generate coordinates: no
> ....
> gnuplot> set datafile binary record=Infx5
> gnuplot> show datafile binary
> ....
> Record 0:
> Dimension: 0x5
> Generate coordinates: no
> ....
Is that a bug in the code?
in the documentation?
only a problem in the output of "show"?
Does the program correctly read through to the end of the file?
Perhaps the documentation is simply wrong and the feature was
never implemented, the same as it was for "set datafile binary format=..."
I think that syntax is anyway not supportable.
Some machines will parse Inf as a number, but other machines will not.
If it must be read as a number, better to make it "-1".
If it is supposed to be a keyword, better make it something other than
a legal number such as "Inf".
In any case it would be better if the format were a string:
set datafile binary record="5x5"
That change by itself might get rid of 100 lines of unreadable code in
plot_option_array(), and has the added benefit that you could store it
in a variable:
format_A = "5x5"
format_B = "5x10"
set datafile binary record= (some_test ? format_A : format_B)
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|