|
From: walter h. <wh...@bf...> - 2012-07-31 13:26:25
|
Am 30.07.2012 22:42, schrieb Lev A. Melnikovsky:
> Hi,
>
> the function I need to plot is a result of nontrivial computation (each data
> point is obtained by solving an ODE). I have implemented it in C, but executing
> the program with
>
> real(system(sprintf("somecommand %f %f", x, y)))
>
> once for each data point (this is a 3d surface) implies a significant overhead.
> My program is statically linked, still this is too slow. I need grid data (to
> create contours), so building the datafile is inefficient.
>
> Ideally I'd like to see an option to open a pipe and write the arguments to it
> and read the results from it. My program would be glad to work in this mode. Is
> this possible?
>
> I'm using Linux if this matters.
>
I am not sure that i understand what you are trying to archive
Writing the data to a file and reading that as matrix should be pretty fast.
I assume you are aware that you can use binary data ? (http://gnuplot.sourceforge.net/demo_4.6/binary.html)
if you can write a gnuplot script you can uses popen() that should be
much better that system().
re,
wh
|