You can subscribe to this list here.
| 2001 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(83) |
Nov
(57) |
Dec
(111) |
| 2004 |
Jan
(38) |
Feb
(121) |
Mar
(107) |
Apr
(241) |
May
(102) |
Jun
(190) |
Jul
(239) |
Aug
(158) |
Sep
(184) |
Oct
(193) |
Nov
(47) |
Dec
(68) |
| 2005 |
Jan
(190) |
Feb
(105) |
Mar
(99) |
Apr
(65) |
May
(92) |
Jun
(250) |
Jul
(197) |
Aug
(128) |
Sep
(101) |
Oct
(183) |
Nov
(186) |
Dec
(42) |
| 2006 |
Jan
(102) |
Feb
(122) |
Mar
(154) |
Apr
(196) |
May
(181) |
Jun
(281) |
Jul
(310) |
Aug
(198) |
Sep
(145) |
Oct
(188) |
Nov
(134) |
Dec
(90) |
| 2007 |
Jan
(134) |
Feb
(181) |
Mar
(157) |
Apr
(57) |
May
(81) |
Jun
(204) |
Jul
(60) |
Aug
(37) |
Sep
(17) |
Oct
(90) |
Nov
(122) |
Dec
(72) |
| 2008 |
Jan
(130) |
Feb
(108) |
Mar
(160) |
Apr
(38) |
May
(83) |
Jun
(42) |
Jul
(75) |
Aug
(16) |
Sep
(71) |
Oct
(57) |
Nov
(59) |
Dec
(152) |
| 2009 |
Jan
(73) |
Feb
(213) |
Mar
(67) |
Apr
(40) |
May
(46) |
Jun
(82) |
Jul
(73) |
Aug
(57) |
Sep
(108) |
Oct
(36) |
Nov
(153) |
Dec
(77) |
| 2010 |
Jan
(42) |
Feb
(171) |
Mar
(150) |
Apr
(6) |
May
(22) |
Jun
(34) |
Jul
(31) |
Aug
(38) |
Sep
(32) |
Oct
(59) |
Nov
(13) |
Dec
(62) |
| 2011 |
Jan
(114) |
Feb
(139) |
Mar
(126) |
Apr
(51) |
May
(53) |
Jun
(29) |
Jul
(41) |
Aug
(29) |
Sep
(35) |
Oct
(87) |
Nov
(42) |
Dec
(20) |
| 2012 |
Jan
(111) |
Feb
(66) |
Mar
(35) |
Apr
(59) |
May
(71) |
Jun
(32) |
Jul
(11) |
Aug
(48) |
Sep
(60) |
Oct
(87) |
Nov
(16) |
Dec
(38) |
| 2013 |
Jan
(5) |
Feb
(19) |
Mar
(41) |
Apr
(47) |
May
(14) |
Jun
(32) |
Jul
(18) |
Aug
(68) |
Sep
(9) |
Oct
(42) |
Nov
(12) |
Dec
(10) |
| 2014 |
Jan
(14) |
Feb
(139) |
Mar
(137) |
Apr
(66) |
May
(72) |
Jun
(142) |
Jul
(70) |
Aug
(31) |
Sep
(39) |
Oct
(98) |
Nov
(133) |
Dec
(44) |
| 2015 |
Jan
(70) |
Feb
(27) |
Mar
(36) |
Apr
(11) |
May
(15) |
Jun
(70) |
Jul
(30) |
Aug
(63) |
Sep
(18) |
Oct
(15) |
Nov
(42) |
Dec
(29) |
| 2016 |
Jan
(37) |
Feb
(48) |
Mar
(59) |
Apr
(28) |
May
(30) |
Jun
(43) |
Jul
(47) |
Aug
(14) |
Sep
(21) |
Oct
(26) |
Nov
(10) |
Dec
(2) |
| 2017 |
Jan
(26) |
Feb
(27) |
Mar
(44) |
Apr
(11) |
May
(32) |
Jun
(28) |
Jul
(75) |
Aug
(45) |
Sep
(35) |
Oct
(285) |
Nov
(99) |
Dec
(16) |
| 2018 |
Jan
(8) |
Feb
(8) |
Mar
(42) |
Apr
(35) |
May
(23) |
Jun
(12) |
Jul
(16) |
Aug
(11) |
Sep
(8) |
Oct
(16) |
Nov
(5) |
Dec
(8) |
| 2019 |
Jan
(9) |
Feb
(28) |
Mar
(4) |
Apr
(10) |
May
(7) |
Jun
(4) |
Jul
(4) |
Aug
|
Sep
(4) |
Oct
|
Nov
(23) |
Dec
(3) |
| 2020 |
Jan
(19) |
Feb
(3) |
Mar
(22) |
Apr
(17) |
May
(10) |
Jun
(69) |
Jul
(18) |
Aug
(23) |
Sep
(25) |
Oct
(11) |
Nov
(20) |
Dec
(9) |
| 2021 |
Jan
(1) |
Feb
(7) |
Mar
(9) |
Apr
|
May
(1) |
Jun
(8) |
Jul
(6) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(2) |
Dec
(23) |
| 2022 |
Jan
(23) |
Feb
(9) |
Mar
(9) |
Apr
|
May
(8) |
Jun
(1) |
Jul
(6) |
Aug
(8) |
Sep
(30) |
Oct
(5) |
Nov
(4) |
Dec
(6) |
| 2023 |
Jan
(2) |
Feb
(5) |
Mar
(7) |
Apr
(3) |
May
(8) |
Jun
(45) |
Jul
(8) |
Aug
|
Sep
(2) |
Oct
(14) |
Nov
(7) |
Dec
(2) |
| 2024 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
(7) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
|
Nov
(4) |
Dec
(14) |
| 2025 |
Jan
(22) |
Feb
(6) |
Mar
(5) |
Apr
(14) |
May
(6) |
Jun
(11) |
Jul
(19) |
Aug
|
Sep
(17) |
Oct
(1) |
Nov
(2) |
Dec
(18) |
| 2026 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Petr M. <mi...@ph...> - 2011-01-18 08:28:18
|
> Maybe you guys just need to be a bit more patient before killing it. > > > The problem with the help files is a longstanding one, and AFAIK it's > > not that easy to fix. There is a system component that was in XP but > > is missing from Vista et al., that's why the help doesn't work. You > > can install that component from Microsoft's site, after that it'll > > work. (I can't recall its name now) > > If only it were that simple. The real problem is that even after you > have winhelp32 installed, it'll _still_ refuse to display our help > pages, because they have arrived on the system without having been > "blessed" by an official MSI installer. So you have to explicitly > remove a "this is a nasty file from somewhere in the big, nasty > Internet, so it can't be allowed to work" flag from the file in Explorer. Would an installer help here? It's nice gnuplot installation is just "unzip this file", but maybe an installer or a setup-script doing - download and install winhelp32 - remove security bits - run gnuplot for the 1st time would help here. --- PM |
|
From: sfeam (E. Merritt) <eam...@gm...> - 2011-01-18 06:38:43
|
On Monday, January 17, 2011, Allin Cottrell wrote: > On Mon, 17 Jan 2011, Allin Cottrell wrote: > > > On Tue, 18 Jan 2011, Mojca Miklavec wrote: > > > > > > My bet is that fc-cache runs in the background to regenerate font > > > index "every now and then", so that one can use any given font on the > > > system. > > (and this can take a looong time). > > I notice that in gnuplot's cp_cairo.c there's a comment (around > line 690) about "working around a bug in the cairo/win32 backend > for font rendering": the work-around involves gp_cairo on Windows > using the freetype + fontconfig backend by preference to the win32 > backend. Following Mojca's lead, this could explain the initial > long wait for gnuplot output. > > I'm wondering, is the cairo bug in question still there? > Unfortunately the comment is not specific (no bugzille ID). But if > the issue is fixed in current cairo it could be worth making a > change. Cairo's win32 backend doesn't have the problem of a long > wait on first use. Here's a link to the original thread reporting the problem in cairo's win32 backend: http://groups.google.com/group/comp.graphics.apps.gnuplot/browse_thread/thread/5742a3d915085f7b/d075063d7da423e9?hl=en&ie=UTF-8&oe=utf-8&q=missing+pixels+for+Windows+PNG+driver&pli=1 I think there's enough information there to test whether the bug is still present or not. If the bug has been fixed in some more recent cairo version, the test on WIN32 and cairo versioning in .../src/wxterminal/gp_cairo.c can be modified appropriately. Or you could write to Behdad Esfahbod and ask him, since he was the cairo developer who recognized the problem and suggested the work-around. Ethan |
|
From: Tatsuro M. <tma...@ya...> - 2011-01-18 04:26:43
|
Hello I also experienced long time wait on the wxt terminal on windows 7 starter. >From second time, I have never waited so long. Regards Tatsuro --- Allin Cottrell wrote: > On Mon, 17 Jan 2011, Allin Cottrell wrote: > > > On Tue, 18 Jan 2011, Mojca Miklavec wrote: > > > > > > My bet is that fc-cache runs in the background to regenerate font > > > index "every now and then", so that one can use any given font on the > > > system. > > (and this can take a looong time). > > I notice that in gnuplot's cp_cairo.c there's a comment (around > line 690) about "working around a bug in the cairo/win32 backend > for font rendering": the work-around involves gp_cairo on Windows > using the freetype + fontconfig backend by preference to the win32 > backend. Following Mojca's lead, this could explain the initial > long wait for gnuplot output. > > I'm wondering, is the cairo bug in question still there? > Unfortunately the comment is not specific (no bugzille ID). But if > the issue is fixed in current cairo it could be worth making a > change. Cairo's win32 backend doesn't have the problem of a long > wait on first use. > > Allin Cottrell > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: Allin C. <cot...@wf...> - 2011-01-18 04:07:31
|
On Mon, 17 Jan 2011, Allin Cottrell wrote: > On Tue, 18 Jan 2011, Mojca Miklavec wrote: > > > > My bet is that fc-cache runs in the background to regenerate font > > index "every now and then", so that one can use any given font on the > > system. (and this can take a looong time). I notice that in gnuplot's cp_cairo.c there's a comment (around line 690) about "working around a bug in the cairo/win32 backend for font rendering": the work-around involves gp_cairo on Windows using the freetype + fontconfig backend by preference to the win32 backend. Following Mojca's lead, this could explain the initial long wait for gnuplot output. I'm wondering, is the cairo bug in question still there? Unfortunately the comment is not specific (no bugzille ID). But if the issue is fixed in current cairo it could be worth making a change. Cairo's win32 backend doesn't have the problem of a long wait on first use. Allin Cottrell |
|
From: sfeam (E. Merritt) <eam...@gm...> - 2011-01-18 03:20:58
|
On Monday, January 17, 2011, Tatsuro MATSUOKA wrote: > Hello > > Shigeharu Takeno made a patch for this issue. > > http://sourceforge.net/tracker/?func=detail&aid=3160356&group_id=2055&atid=302055 > > I have confirmed the patch works on the current cvs source. Excellent. I've added it to CVS. Ethan > > Regards > > Tatsuro > > --- Tatsuro MATSUOKA wrote: > > > Hello > > > > --- "sfeam (Ethan Merritt)" wrote: > > > > > It seems that the zoom/pan response to scrolling the mouse wheel, > > > added by James Van Zandt in 2009, is not working in the windows > > > terminal. Is this correct? > > > > Yes. > > > > > I think the only thing missing is that it needs to pass through > > > WM_MOUSEWHEEL events from WndGraphProc() in wgraph.c. Currently > > > it passes through events triggered by WM_LBUTTONUP, WM_LBUTTONDOWN, > > > etc, but not WM_MOUSEWHEEL. > > > > > > The main mousing code wants to see this as a GP_buttonpress event, > > > with parameter > > > 4 = mouse wheel scrolled up > > > 5 = mouse wheel scrolled down > > > and the shift/control/alt modifiers filled in as usual. > > > > > > Any volunteers to look into adding that? > > > > I am now occupied in the GNU Octave project for the 3.4 release on MinGW platform. Thus I cannot > > have > > enough time to do the above at present. > > I will ask this in the Japanese thread for gnuplot. > > > > Regards > > > > Tatsuro > > |
|
From: Allin C. <cot...@wf...> - 2011-01-18 03:10:40
|
On Tue, 18 Jan 2011, Mojca Miklavec wrote: > 2011/1/18 Allin Cottrell wrote: > > > > But we're seeing the same, quite mysterious, issue on Windows: the > > "first" gnuplot plot takes a long time to appear, where "long" > > can be anything from 5-10 seconds to well over a minute. It looks > > like the app is off in the ozone, but eventually the plot appears. > > I'm not sure exactly what "first" means here -- first plot after > > booting Windows, first plot after initially installing or updating > > gretl + gnuplot? -- since that seems to vary. But subsequent plots > > take a sane amount of time (i.e. barely noticeable delay). > > > > My first thought on this was that maybe Windows is conducting some > > elaborate security audit on the toolchain that's involved (GLib, > > pango and so on), but that's only a wild guess. I wish I > > understood what's going on, because it creates a very bad > > impression for new users. (No such problem on Linux or Mac.) > > Wait, that sounds familiar! > > My bet is that fc-cache runs in the background to regenerate font > index "every now and then", so that one can use any given font on the > system. > > This doesn't happen on Mac on Linux since fontconfig database update > runs independently in the background. But if gnuplot is compiled with > fontconfig under windows it first checks when the database has last > been generated and if enough time elapsed, it regenerates the database > which may take pretty long (depending on the number of fonts available > on the system). Aha! That sounds quite plausible. Next time I boot windows I'll try to investigate. I suppose that if I can find the relevant cache file and delete it, then I ought to be able to provoke the long wait for a plot? Allin Cottrell |
|
From: Mojca M. <moj...@gm...> - 2011-01-18 02:56:32
|
2011/1/18 Allin Cottrell wrote: > > But we're seeing the same, quite mysterious, issue on Windows: the > "first" gnuplot plot takes a long time to appear, where "long" > can be anything from 5-10 seconds to well over a minute. It looks > like the app is off in the ozone, but eventually the plot appears. > I'm not sure exactly what "first" means here -- first plot after > booting Windows, first plot after initially installing or updating > gretl + gnuplot? -- since that seems to vary. But subsequent plots > take a sane amount of time (i.e. barely noticeable delay). > > My first thought on this was that maybe Windows is conducting some > elaborate security audit on the toolchain that's involved (GLib, > pango and so on), but that's only a wild guess. I wish I > understood what's going on, because it creates a very bad > impression for new users. (No such problem on Linux or Mac.) Wait, that sounds familiar! My bet is that fc-cache runs in the background to regenerate font index "every now and then", so that one can use any given font on the system. This doesn't happen on Mac on Linux since fontconfig database update runs independently in the background. But if gnuplot is compiled with fontconfig under windows it first checks when the database has last been generated and if enough time elapsed, it regenerates the database which may take pretty long (depending on the number of fonts available on the system). Mojca |
|
From: Allin C. <cot...@wf...> - 2011-01-18 02:00:08
|
On Mon, 17 Jan 2011, [ISO-8859-1] Hans-Bernhard Br wrote: > On 17.01.2011 18:55, Peter Juhasz wrote: > > > The wxt terminal window appears, but without any content, and the > > application doesn't respond anymore. I have to kill it every time, no > > "it magically fixed itself after the fifth time" for me. > > My experience on a real Windows box was somewhat similar, but ultimately > different. The first plot from the first wxt version of gnuplot I ever > ran took _ages_. Yes, it did feel like eternity, but ulimately it got > there. Ever since, it just works. > > So apparently there's something the wxt framework needs to do once to > work properly. Interesting. "My" app gretl ( gretl.sf.net ) calls gnuplot to generate graphs. These are not displayed using the wxt terminal, rather we get gnuplot to generate a PNG file using the pngcairo terminal (which of course shares a lot of code with wxt) and then we display the PNG in a GTK window that's under gretl's control. But we're seeing the same, quite mysterious, issue on Windows: the "first" gnuplot plot takes a long time to appear, where "long" can be anything from 5-10 seconds to well over a minute. It looks like the app is off in the ozone, but eventually the plot appears. I'm not sure exactly what "first" means here -- first plot after booting Windows, first plot after initially installing or updating gretl + gnuplot? -- since that seems to vary. But subsequent plots take a sane amount of time (i.e. barely noticeable delay). My first thought on this was that maybe Windows is conducting some elaborate security audit on the toolchain that's involved (GLib, pango and so on), but that's only a wild guess. I wish I understood what's going on, because it creates a very bad impression for new users. (No such problem on Linux or Mac.) Allin Cottrell |
|
From: Tatsuro M. <tma...@ya...> - 2011-01-18 01:23:41
|
Hello Shigeharu Takeno made a patch for this issue. http://sourceforge.net/tracker/?func=detail&aid=3160356&group_id=2055&atid=302055 I have confirmed the patch works on the current cvs source. Regards Tatsuro --- Tatsuro MATSUOKA wrote: > Hello > > --- "sfeam (Ethan Merritt)" wrote: > > > It seems that the zoom/pan response to scrolling the mouse wheel, > > added by James Van Zandt in 2009, is not working in the windows > > terminal. Is this correct? > > Yes. > > > I think the only thing missing is that it needs to pass through > > WM_MOUSEWHEEL events from WndGraphProc() in wgraph.c. Currently > > it passes through events triggered by WM_LBUTTONUP, WM_LBUTTONDOWN, > > etc, but not WM_MOUSEWHEEL. > > > > The main mousing code wants to see this as a GP_buttonpress event, > > with parameter > > 4 = mouse wheel scrolled up > > 5 = mouse wheel scrolled down > > and the shift/control/alt modifiers filled in as usual. > > > > Any volunteers to look into adding that? > > I am now occupied in the GNU Octave project for the 3.4 release on MinGW platform. Thus I cannot > have > enough time to do the above at present. > I will ask this in the Japanese thread for gnuplot. > > Regards > > Tatsuro > > -------------------------------------- > Get the new Internet Explorer 8 optimized for Yahoo! JAPAN > http://pr.mail.yahoo.co.jp/ie8/ > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: Tatsuro M. <tma...@ya...> - 2011-01-18 01:21:03
|
Hello --- Mojca Miklavec wrote: > If I create a file 'a.plt' in UTF-8 encoding and use > load 'a.plt' > then UTF-8 works without a problem. > > However if I type > set xlabel 'a将ュ将゛将�#39; > plot sin(x) > then it won't recognize the input unless I explicitely specify > set encoding cp852 > so it's just a problem of correctly interpreting the input, not a > problem of drawing it (which was also problematic on the old windows > terminal). > > I also need to tell that when I use "cmd" and change the font in > Properties to Lucida Console for example, then I'm able to paste a > Greek alpha into cmd window. However when I run gnuplot, this is > impossible - I can apparently only use characters from cp1250/cp852. > There is no way to enter any Greek letter at all. In Japanese windows, the situation is the same. We have to use a suitable text editor and execute in the script for the utf-8. In Unix (including Cygwin) terminal emulator works at various locale so that we can use the utf-8 on the terminal. There is the Msys mintty on windows. It seem to treat the UTF-8. However it cannot be used for gnuplot.exe (cursor behaviors are too strange to use it. Probably it is optimized for Msys system.) I hope the Msys mitty like a program that can be used for windows native environments. Regards Tatsuro -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: Mojca M. <moj...@gm...> - 2011-01-17 23:38:09
|
Hello,
2011/1/18 Tatsuro MATSUOKA wrote:
>
> The wxt terminal uses the fontconfig + Freetype for font handling.
That was indeed one of the best improvements over the old windows
terminal (where support for any encoding but ASCII was just a dream
and nobody knew how to select a font ...).
> You can use utf-8 character encoding to use unicode.
If I create a file 'a.plt' in UTF-8 encoding and use
load 'a.plt'
then UTF-8 works without a problem.
However if I type
set xlabel 'ačšž'
plot sin(x)
then it won't recognize the input unless I explicitely specify
set encoding cp852
so it's just a problem of correctly interpreting the input, not a
problem of drawing it (which was also problematic on the old windows
terminal).
I also need to tell that when I use "cmd" and change the font in
Properties to Lucida Console for example, then I'm able to paste a
Greek alpha into cmd window. However when I run gnuplot, this is
impossible - I can apparently only use characters from cp1250/cp852.
There is no way to enter any Greek letter at all.
I'm using Slovenian locale. Maybe the program behaves different in
Japanese locale.
Thanks a lot,
Mojca
|
|
From: Tatsuro M. <tma...@ya...> - 2011-01-17 23:07:53
|
Hello The wxt terminal uses the fontconfig + Freetype for font handling. You can use utf-8 character encoding to use unicode. In the gnuplot/binary in gnuplot 4.4.2 binary distribution, fc-list-gp.exe is included. Please read README.Windows in gnuplot directory. * fc-list-gp.exe : This program is the renamed fontconfig utlity which outputs a list of fonts managed by the fontconfig library used in this gnuplot distribution. ! fc-list-gp > fc-list.txt lists which font is available in your system. Regards Tatsuro -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: Tatsuro M. <tma...@ya...> - 2011-01-17 22:59:19
|
Hello --- Mojca Miklavec wrote: > Gnuplot also signals a "crash" to OS when closed with "that cross on > the upper right corner" which should probably not happen, but well ... For wxt terminal, "press cross on the upper right corner" causes crash. I can fix this if windows api function SetConsoleCtrlHandler. (I have tried and tested once.) The reason I have not submit this patch is that I cannot make a decision in which it is implemented in plot.c or win/winmain.c. If the patch is hopeful I will post it to the bug tracker. Regards Tatsuro -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: Tatsuro M. <tma...@ya...> - 2011-01-17 22:49:50
|
Hello I have gotten the netbook recently. The OS is windows 7 starter. I have installed gnuplot into C:\Progaram Files as an administrator. I have also install winhelp32 for window 7. The wxt terminal and help works without problem. For help file, the below might helps you. http://sourceforge.net/tracker/?func=detail&aid=2984116&group_id=2055&atid=102055 Regards Tatsuro --- Hans-Bernhard Br将モker wrote: > On 17.01.2011 18:55, Peter Juhasz wrote: > > > The wxt terminal window appears, but without any content, and the > > application doesn't respond anymore. I have to kill it every time, no > > "it magically fixed itself after the fifth time" for me. > > My experience on a real Windows box was somewhat similar, but ultimately > different. The first plot from the first wxt version of gnuplot I ever > ran took _ages_. Yes, it did feel like eternity, but ulimately it got > there. Ever since, it just works. > > So apparently there's something the wxt framework needs to do once to > work properly. > > Maybe you guys just need to be a bit more patient before killing it. > > > The problem with the help files is a longstanding one, and AFAIK it's > > not that easy to fix. There is a system component that was in XP but > > is missing from Vista et al., that's why the help doesn't work. You > > can install that component from Microsoft's site, after that it'll > > work. (I can't recall its name now) > > If only it were that simple. The real problem is that even after you > have winhelp32 installed, it'll _still_ refuse to display our help > pages, because they have arrived on the system without having been > "blessed" by an official MSI installer. So you have to explicitly > remove a "this is a nasty file from somewhere in the big, nasty > Internet, so it can't be allowed to work" flag from the file in Explorer. > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2011-01-17 21:32:57
|
On 17.01.2011 18:55, Peter Juhasz wrote: > The wxt terminal window appears, but without any content, and the > application doesn't respond anymore. I have to kill it every time, no > "it magically fixed itself after the fifth time" for me. My experience on a real Windows box was somewhat similar, but ultimately different. The first plot from the first wxt version of gnuplot I ever ran took _ages_. Yes, it did feel like eternity, but ulimately it got there. Ever since, it just works. So apparently there's something the wxt framework needs to do once to work properly. Maybe you guys just need to be a bit more patient before killing it. > The problem with the help files is a longstanding one, and AFAIK it's > not that easy to fix. There is a system component that was in XP but > is missing from Vista et al., that's why the help doesn't work. You > can install that component from Microsoft's site, after that it'll > work. (I can't recall its name now) If only it were that simple. The real problem is that even after you have winhelp32 installed, it'll _still_ refuse to display our help pages, because they have arrived on the system without having been "blessed" by an official MSI installer. So you have to explicitly remove a "this is a nasty file from somewhere in the big, nasty Internet, so it can't be allowed to work" flag from the file in Explorer. |
|
From: Ethan M. <merritt@u.washington.edu> - 2011-01-17 18:12:08
|
On Monday, January 17, 2011, Mojca Miklavec wrote: > > I don't like the fact that I have to use > set encoding cp852 > (this could be either automatic or it could support UTF-8 in Windows > Vista and 7) and help files are missing (that could easily be fixed, I > assume), but my original complaint wasn't entirely true. If you know how to persuade Windows to accept UTF-8, please let us know. I was under the impression that Windows could not handle it. Microsoft (and Sun) chose to go with 16-bit encodings instead. As to "set encoding cp852", how would you suggest this be made automatic? And why? Can't you just put it in your initialization file? > Gnuplot also signals a "crash" to OS when closed with "that cross on > the upper right corner" which should probably not happen, but well ... I have not seen that. Could you provide a specific recipe for replicating this problem? Ethan |
|
From: Peter J. <pet...@gm...> - 2011-01-17 17:55:39
|
I experience the same on a virtualboxed Vista setup, with gnuplot 4.4.2 and 4.5 both. The wxt terminal window appears, but without any content, and the application doesn't respond anymore. I have to kill it every time, no "it magically fixed itself after the fifth time" for me. Interestingly, it works as expected on a (real) Windows XP. The problem with the help files is a longstanding one, and AFAIK it's not that easy to fix. There is a system component that was in XP but is missing from Vista et al., that's why the help doesn't work. You can install that component from Microsoft's site, after that it'll work. (I can't recall its name now) Péter Juhász 2011/1/17 Mojca Miklavec <moj...@gm...>: > Dear list, > > I'm sorry. I take my word back. > > Gnulpot used to hang for a very very very long time each time when I > tried it (until I lost all the hope and forced closing it). After the > fifth try it now works without a problem. I cannot figure out what > exactly could go wrong, but it does work now. > > I don't like the fact that I have to use > set encoding cp852 > (this could be either automatic or it could support UTF-8 in Windows > Vista and 7) and help files are missing (that could easily be fixed, I > assume), but my original complaint wasn't entirely true. > > Gnuplot also signals a "crash" to OS when closed with "that cross on > the upper right corner" which should probably not happen, but well ... > > Mojca > > > 2011/1/17 Mojca Miklavec wrote: >> Dear list, >> >> I'm using Mac. I remember that I managed to compile gnuplot with wxt >> terminal on Mac once, but it was hanging and one couldn't do anything >> with it (function was drawn, but one could not click on the window). >> >> I have now tested gnuplot 4.2.2 for Windows (precompiled) on Windows 7 >> and it hangs almost in the same way as it does on mac (only that it >> doesn't even draw anything). Using >> set term windows >> and then continue with that old terminal works fine, but wxt seems to >> be just as broken under windows as it is on mac. Does it work for >> others and on what version of Windows? >> >> Thanks, >> Mojca >> > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > |
|
From: Mojca M. <moj...@gm...> - 2011-01-17 17:27:09
|
Dear list,
I'm sorry. I take my word back.
Gnulpot used to hang for a very very very long time each time when I
tried it (until I lost all the hope and forced closing it). After the
fifth try it now works without a problem. I cannot figure out what
exactly could go wrong, but it does work now.
I don't like the fact that I have to use
set encoding cp852
(this could be either automatic or it could support UTF-8 in Windows
Vista and 7) and help files are missing (that could easily be fixed, I
assume), but my original complaint wasn't entirely true.
Gnuplot also signals a "crash" to OS when closed with "that cross on
the upper right corner" which should probably not happen, but well ...
Mojca
2011/1/17 Mojca Miklavec wrote:
> Dear list,
>
> I'm using Mac. I remember that I managed to compile gnuplot with wxt
> terminal on Mac once, but it was hanging and one couldn't do anything
> with it (function was drawn, but one could not click on the window).
>
> I have now tested gnuplot 4.2.2 for Windows (precompiled) on Windows 7
> and it hangs almost in the same way as it does on mac (only that it
> doesn't even draw anything). Using
> set term windows
> and then continue with that old terminal works fine, but wxt seems to
> be just as broken under windows as it is on mac. Does it work for
> others and on what version of Windows?
>
> Thanks,
> Mojca
>
|
|
From: Mojca M. <moj...@gm...> - 2011-01-17 13:04:28
|
Dear list,
I'm using Mac. I remember that I managed to compile gnuplot with wxt
terminal on Mac once, but it was hanging and one couldn't do anything
with it (function was drawn, but one could not click on the window).
I have now tested gnuplot 4.2.2 for Windows (precompiled) on Windows 7
and it hangs almost in the same way as it does on mac (only that it
doesn't even draw anything). Using
set term windows
and then continue with that old terminal works fine, but wxt seems to
be just as broken under windows as it is on mac. Does it work for
others and on what version of Windows?
Thanks,
Mojca
|
|
From: <mw...@gm...> - 2011-01-16 18:23:15
|
Hi,
I have recently with your help been able to implement finite summation by adding the functions sum() and sumx(). I have also thought about your comments and tried to implement an expression 'for' that should work like:
a = for [k=1:4] k
f(x) = for [k=1:4] sin(k*x)
print for [k=1:4] k
plot for [k=1:4] sin(k*x)
I can parse "for [k=1:4]" decently. The following token should be similar to a function of k. I have thus tried to create a udf (on the fly) with the corresponding action code, but I have not succeeded and need your help to continue. The relevant code is in parse_for_expression() at:
/* parse the following expression and convert it to an action table. */
/* XXX I am very unsure about the following part */
save_at = at;
save_at_size = at_size;
at = (struct at_type *) gp_alloc(sizeof(struct at_type), "action table");
memset(at, 0, sizeof(*at)); /* XXX understand why: reset action table !!! */
at_size = MAX_AT_LEN;
/* XXX maybe I have to save the recursion level */
parse_expression();
/* create a udf (user defined function) with the parsed action talbe (at) */
udf = (struct udft_entry *) gp_alloc(sizeof(struct udft_entry), "for");
udf->next_udf = (struct udft_entry *) NULL;
udf->definition = NULL;
udf->at = at;
udf->udf_name = NULL; /* TODO maybe add */
udf->dummy_num = 1;
for (i = 0; i < MAX_NUM_VAR; i++)
(void) Ginteger(&(udf->dummy_values[i]), 0);
/* restore at */
at = save_at;
at_size = save_at_size;
add_action(FOR)->udf_arg = udf;
I appreciate your help very much.
Thanks for your consideration,
Micha Wiedenmann
diff --git a/src/eval.c b/src/eval.c
index 056159b..8681857 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -93,6 +93,7 @@ const struct ft_entry GPFAR ft[] =
{"pop", f_pop},
{"call", f_call},
{"calln", f_calln},
+ {"for", f_for},
{"lnot", f_lnot},
{"bnot", f_bnot},
{"uminus", f_uminus},
diff --git a/src/eval.h b/src/eval.h
index 2af029e..b7da3b9 100644
--- a/src/eval.h
+++ b/src/eval.h
@@ -53,7 +53,7 @@
enum operators {
/* keep this in line with table in eval.c */
PUSH, PUSHC, PUSHD1, PUSHD2, PUSHD, POP,
- CALL, CALLN, LNOT, BNOT, UMINUS,
+ CALL, CALLN, FOR, LNOT, BNOT, UMINUS,
LOR, LAND, BOR, XOR, BAND, EQ, NE, GT, LT, GE, LE, PLUS, MINUS, MULT,
DIV, MOD, POWER, FACTORIAL, BOOLE,
DOLLARS, /* for using extension - div */
diff --git a/src/internal.c b/src/internal.c
index a397af2..2f9ac25 100644
--- a/src/internal.c
+++ b/src/internal.c
@@ -188,6 +188,57 @@ f_calln(union argument *x)
void
+f_for(union argument *arg)
+{
+#if 0
+ /* XXX compare with f_range */
+ struct value beg, end; /* bounds [beg, end] */
+#endif
+
+ int a, b; /* bounds [a, b] */
+ udft_entry *udf; /* function to evaluate */
+ struct cmplx ret; /* result */
+
+ struct value tmp;
+ union argument calln_arg;
+ int i;
+
+ udf = arg->udf_arg;
+
+ /* pop upper bound (b) */
+ if (pop(&tmp)->type != INTGR)
+ int_warn(NO_CARET, "expecting an integer as 2nd argument to sum");
+ b = tmp.v.int_val;
+
+ /* pop lower bound (a) */
+ if (pop(&tmp)->type != INTGR)
+ int_warn(NO_CARET, "expecting an integer as 1st argument to sum");
+ a = tmp.v.int_val;
+
+ ret.real = 0;
+ ret.imag = 0;
+ for (i=a; i<=b; ++i) {
+
+ /* calculate f_k = f(k); */
+
+ push(Ginteger(&tmp, i));
+ /* XXX maybe change to 'call'? */
+ push(Ginteger(&tmp, 1)); /* push argument count */
+
+ calln_arg.udf_arg = udf;
+ f_calln(&calln_arg);
+
+ pop(&tmp);
+ ret.real += real(&tmp);
+ ret.imag += imag(&tmp);
+ }
+
+ push(Gcomplex(&tmp, ret.real, ret.imag));
+
+}
+
+
+void
f_lnot(union argument *arg)
{
struct value a;
diff --git a/src/internal.h b/src/internal.h
index 0d254de..f4bfb8a 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -54,6 +54,7 @@ void f_pushd __PROTO((union argument *x));
void f_pop __PROTO((union argument *x));
void f_call __PROTO((union argument *x));
void f_calln __PROTO((union argument *x));
+void f_for __PROTO((union argument *x));
void f_lnot __PROTO((union argument *x));
void f_bnot __PROTO((union argument *x));
void f_lor __PROTO((union argument *x));
diff --git a/src/parse.c b/src/parse.c
index 0569ebb..c984dd1 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -88,6 +88,7 @@ static void parse_relational_expression __PROTO((void));
static void parse_additive_expression __PROTO((void));
static void parse_multiplicative_expression __PROTO((void));
static void parse_unary_expression __PROTO((void));
+static void parse_for_expression __PROTO((void));
static int parse_assignment_expression __PROTO((void));
static int is_builtin_function __PROTO((int t_num));
@@ -487,6 +488,9 @@ parse_primary_expression()
c_token++;
add_action(call_type)->udf_arg = add_udf(tok);
}
+ } else if (equals(c_token, "for")) {
+ FPRINTF((stderr, "found 'for' keyword\n"));
+ parse_for_expression();
/* dummy_func==NULL is a flag to say no dummy variables active */
} else if (dummy_func) {
if (equals(c_token, c_dummy_var[0])) {
@@ -828,6 +832,110 @@ parse_unary_expression()
parse_primary_expression();
}
+
+/* create action code for 'for' expressions */
+static void
+parse_for_expression()
+{
+ /* parse [<var> = <start> : <end>] */
+ /* push <start>
+ * push <end>
+ * create a udf for##
+ * save dummy_func and set it to new udf
+ * 1 variable
+ * parse remainder as function of <var>
+ * pass udf as arg to add_action(FOR)
+ */
+
+ /* FIXME what if dummy_func is not NULL in the beginning? ( I think this is
+ * the case for foo(x) = for [k=1:10] sin(k*x), since parsing foo(x) set it
+ * and then for overrides it further down the parsing.
+ */
+ char *errormsg = "Expecting iterator for [<var> = <start> : <end>]\n";
+ int beg, end;
+ union argument *arg;
+
+ struct udvt_entry *udv;
+ struct udft_entry *udf;
+
+ struct at_type * save_at;
+ int save_at_size;
+ int i;
+
+ if (!equals(c_token, "for"))
+ return;
+ c_token++;
+
+ /* XXX what if c_token is too large (out of bounds) in isletter? */
+ /* XXX is this use of '++' undefined behaviour defined? */
+ /* XXX why do I have to create an udv? */
+ if (!equals(c_token++, "[") || !isletter(c_token))
+ int_error(c_token-1, errormsg);
+ udv = add_udv(c_token);
+ c_token++;
+
+ if (!equals(c_token, "="))
+ int_error(c_token-1, errormsg); /* why -1? */
+ c_token++;
+
+ beg = int_expression();
+
+ if (!equals(c_token, ":"))
+ int_error(c_token, errormsg);
+ c_token++;
+
+ end = int_expression();
+
+ /* TODO add increment */
+ if (!equals(c_token, "]"))
+ int_error(c_token, errormsg);
+ c_token++;
+
+ /* FIXME to implement, debug use 1 for <beg> */
+ arg = add_action(PUSHC);
+ arg->v_arg.type = INTGR;
+ arg->v_arg.v.int_val = beg;
+
+ /* FIXME to implement, debug use 10 for <end> */
+ arg = add_action(PUSHC);
+ arg->v_arg.type = INTGR;
+ arg->v_arg.v.int_val = end;
+
+ /* parse the following expression and convert it to an action table. */
+ /* XXX I am very unsure about the following part */
+ save_at = at;
+ save_at_size = at_size;
+
+ at = (struct at_type *) gp_alloc(sizeof(struct at_type), "action table");
+ memset(at, 0, sizeof(*at)); /* XXX understand why: reset action table !!! */
+ at_size = MAX_AT_LEN;
+
+ /* XXX maybe I have to save the recursion level */
+ parse_expression();
+
+ /* create a udf (user defined function) with the parsed action talbe (at) */
+ udf = (struct udft_entry *) gp_alloc(sizeof(struct udft_entry), "for");
+ udf->next_udf = (struct udft_entry *) NULL;
+ udf->definition = NULL;
+ udf->at = at;
+ udf->udf_name = NULL; /* TODO maybe add */
+ udf->dummy_num = 1;
+ for (i = 0; i < MAX_NUM_VAR; i++)
+ (void) Ginteger(&(udf->dummy_values[i]), 0);
+
+ /* restore at */
+ at = save_at;
+ at_size = save_at_size;
+
+ add_action(FOR)->udf_arg = udf;
+}
+
+
/* find or add value and return pointer */
struct udvt_entry *
add_udv(int t_num)
--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
|
|
From: Tatsuro M. <tma...@ya...> - 2011-01-15 16:19:50
|
Hello --- "sfeam (Ethan Merritt)" wrote: > It seems that the zoom/pan response to scrolling the mouse wheel, > added by James Van Zandt in 2009, is not working in the windows > terminal. Is this correct? Yes. > I think the only thing missing is that it needs to pass through > WM_MOUSEWHEEL events from WndGraphProc() in wgraph.c. Currently > it passes through events triggered by WM_LBUTTONUP, WM_LBUTTONDOWN, > etc, but not WM_MOUSEWHEEL. > > The main mousing code wants to see this as a GP_buttonpress event, > with parameter > 4 = mouse wheel scrolled up > 5 = mouse wheel scrolled down > and the shift/control/alt modifiers filled in as usual. > > Any volunteers to look into adding that? I am now occupied in the GNU Octave project for the 3.4 release on MinGW platform. Thus I cannot have enough time to do the above at present. I will ask this in the Japanese thread for gnuplot. Regards Tatsuro -------------------------------------- Get the new Internet Explorer 8 optimized for Yahoo! JAPAN http://pr.mail.yahoo.co.jp/ie8/ |
|
From: David K. <dvd...@gm...> - 2011-01-13 18:22:51
|
>>>>> "Ethan" == Ethan Merritt <merritt@u.washington.edu> writes: > I am happy to accept the patches to term.c and linux.trm, but ... >> (Gtk and Qt can work this way). > Wouldn't it be more interesting to see if the Qt terminal driver in > gnuplot CVS can be used on this device? It was my understanding that > it was developed partly to support the sort of device you describe. > I haven't seen much discussion or feedback about qt.trm, so maybe > people haven't noticed it yet. On a normal desktop machine it doesn't > seem to have any particular advantage over the wxgtk-based wxt.trm, > but on a small device it might be an entirely different story. Actually I gave qt a try with PLplot, but it kept crashing, so when I gave up and started a GNUplot port, I didn't bother to test the qt driver. Also Qt seems to start some kind of a mini window manager (called QWS) when running directly on the console, so startup time and memory usage are nowhere close to SVGAlib. Especially considering that I want to use gnuplot as a plotting backend for Octave, memory footprint needs to stay down (only 32MB RAM, no swap on the Nanonote). cheers, David -- GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40 |
|
From: Mojca M. <moj...@gm...> - 2011-01-13 08:01:39
|
Dear list,
When I run ./configure I get
TeX files will be installed in
/usr/local/usr//usr/local/texlive/2010/../texmf-local/tex/latex/gnuplot
However that should have been
/usr/local/texlive/texmf-local/tex/latex/gnuplot
and not the complicated string above.
The configure script says:
if test "$TEXDIR" = "no"; then
#in the case prefix = NONE us ac_default_prefix
TEXDIR="${prefix}"
test "x$TEXDIR" = xNONE && TEXDIR=$ac_default_prefix
# at this point TEXDIR is set to "/usr/local"
TEXDIR=`$KPSEXPAND $TEXDIR/usr/'$TEXMFLOCAL'/tex/latex/gnuplot \
|sed "s%^.*share/%$TEXDIR/share/%"`
# and now /usr is appended
# TEXMFLOCAL is /usr/local/texlive/2010/../texmf-local
# so I get
"/usr/local"+"/usr"+"/usr/local/texlive/2010/../texmf-local"+"/tex/latex/gnuplot"
# which is certainly wrong
I have no idea what the sed is supposed to do (here it doesn't do
anything anyway), but the overall functionality is simply wrong here.
I don't plan to use that functionality anyway, but it would be nice to
fix it.
Thanks a lot,
Mojca
|
|
From: sfeam (E. Merritt) <eam...@gm...> - 2011-01-13 05:42:42
|
It seems that the zoom/pan response to scrolling the mouse wheel, added by James Van Zandt in 2009, is not working in the windows terminal. Is this correct? I think the only thing missing is that it needs to pass through WM_MOUSEWHEEL events from WndGraphProc() in wgraph.c. Currently it passes through events triggered by WM_LBUTTONUP, WM_LBUTTONDOWN, etc, but not WM_MOUSEWHEEL. The main mousing code wants to see this as a GP_buttonpress event, with parameter 4 = mouse wheel scrolled up 5 = mouse wheel scrolled down and the shift/control/alt modifiers filled in as usual. Any volunteers to look into adding that? Ethan |
|
From: <pl...@pi...> - 2011-01-12 23:29:59
|
On 12/01/11 20:40, Ethan Merritt wrote:
> On Wednesday, January 12, 2011 07:49:57 am mw...@gm... wrote:
> [snip]
>> I have implemented sum(a, b, "f") and sum(a, b, x, "g") in order to calculate finite sums:
>>
>> # calculate a finite sum
>> f(n) = n
>> print sum(1, 10, "f") # -> 55
>>
>> # calculate a finite sum with parameter x
>>
>> # fourier coefficients of some square wave
>> fourier(k, x) = sin(3./2*k)/k * 2./3*cos(k*x)
>> s(x) = 1./2 + sumx(1, 100, x, "fourier")
>> plot s(x)
>>
>> I hope this is sufficient to understand why I want a parameter x (so one can plot some square waves and other things.)
>
> I find that syntax rather confusing, but maybe it's just me.
> My first thought would be to aim for
> fourier(x) = for [k=1:100] sin(3./2*k)/k * 2./3*cos(k*x)
> since that matches the iteration syntax already used elsewhere
> in the set of gnuplot commands. I suspect the internal implementation
> could still work more or less the way you have it, but the user
> interface would be (for me anyhow) more obvious.
>
>
>> As Mr. Bröker pointed out, there is a trick involving the tertinary operator '?' and recursion to sorta workaround. Originally I tried to plot the sum with '?' but I could only do so for 1..10, in case of 1..100 it said something about stack overflow.
>
> I am inclined to agree with Hans-Bernhard that such a summation
> meta-function is not required.
> But feel free to provide a contrary argument.
>
> The summation can easily be expressed as a simple recursive function.
> The problem you saw with stack overflow probably resulted from failing to
> order the terms so that the calculation involved tail-recursion.
> E.g.
>
> gnuplot> tailsum(N) = (N>0) ? tailsum(N-1) + N : 0
> gnuplot> headsum(N) = (N>0) ? N + headsum(N-1) : 0
> gnuplot> print tailsum(250)
> 31375
> gnuplot> print headsum(250)
> stack overflow
>
> Now it is true that the current version of gnuplot imposes a further
> limit on the recursion depth:
>
> gnuplot> print tailsum(251)
> recursion depth limit exceeded
>
> It is currently a hard limit determined by
> eval.h:#define STACK_DEPTH 250 /* maximum size of the execution stack */
>
> But it's largely an arbitrary number to prevent run-away function evaluation.
> It could be made a user-accessible parameter if there's a need for it.
>
>
>> I have added below a working patch but would like you to have a look at it.
>
> I don't really have much time right now.
> Could you please upload it to the patch tracker on Sourceforge?
> That way it won't get lost, you can update it whenever you want,
> and testers can post comments and provide feedback.
>
>
>> I have some things that are not clear to me, in particular:
>>
>> * Do I have to free the values that I have gotten using pop?
>
> No.
>
>> * In what order do I have to push i and x befor the call to f(i, x). I thought that I have to push them from right to left but that seems to contradicts my testing, now I am very unsure about it (even though it seems to work correctly).
>
> If you are calling your own function then you need only be
> consistent at both ends of the call. But in general the stack
> is LIFO. pop() returns the value most recently push()ed
>
>> * Do I have to alloc memeory for the values I push on the stack befor the call to f(.)?
>
> The push() operation makes a copy.
> It's up to you to manage allocate/free of the original.
>
>> * This is only curiosity is arg in foo(union argument *arg) every used and if, what for?
>
> I have wondered that myself :-)
>
>> I would also like you to take a look at my addition to gnuplot.doc and proofread it.
>
> Please put it on the patch tracker along with the patch itself.
>
>> Finally it would be nice but not necessary if the function could be passed as 'f' instead of '"f", that is sum(1, 10, f), and even better as sum(n=[1:10], n) but I consider this as optional and very hard to do (at least with my knowledge).
>
> That would not be a good idea, as it would prevent the use of string variables.
> Consider:
> ident(N) = N
> f = "ident"
> print sum(1, 10, f)
>
>> Thank you again for your generous help without I would never have gone so far.
>
> If you have this working now, I'd be interested to see some benchmarks.
> Is there a performance benefit over using the existing mechanism of
> defining a recursive function using tail-recursion?
> Is there a real-world use that requires summing over more than 250 terms?
>
> Ethan
>
>
>> Thank you,
>> Micha Wiedenmann
>>
>> --- eval.c.orig 2011-01-11 17:38:00.000000000 +0100
>> +++ eval.c 2011-01-12 16:19:05.000000000 +0100
>> @@ -176,6 +176,9 @@
>> {"atanh", f_atanh},
>> {"lambertw", f_lambertw}, /* HBB, from G.Kuhnle 20001107 */
>>
>> + {"sum", f_sum}, /* summation sum(a, b, "f") = \sum_{i=a}^b f(i) */
>> + {"sumx", f_sumx}, /* summation sum(a, b, x, "f") = \sum_{i=a}^b f(i, x) (with parameter x) */
>> +
>> {"column", f_column}, /* for using */
>> {"valid", f_valid}, /* for using */
>> {"timecolumn", f_timecolumn}, /* for using */
>> @@ -689,6 +692,20 @@
>> return (*udv_ptr);
>> }
>>
>> +struct udft_entry *
>> +get_udf_by_name(char *key)
>> +{
>> + struct udft_entry *udf_ptr = first_udf;
>> +
>> + while (udf_ptr) {
>> + if (!strcmp(key, udf_ptr->udf_name))
>> + return udf_ptr;
>> +
>> + udf_ptr = udf_ptr->next_udf;
>> + }
>> +
>> + return NULL;
>> +}
>>
>> static void update_plot_bounds __PROTO((void));
>> static void fill_gpval_axis __PROTO((AXIS_INDEX axis));
>> --- eval.h.orig 2011-01-11 17:38:21.000000000 +0100
>> +++ eval.h 2011-01-12 15:54:30.000000000 +0100
>> @@ -164,6 +164,7 @@
>> void apollo_pfm_catch __PROTO((void));
>> #endif
>> struct udvt_entry * add_udv_by_name __PROTO((char *key));
>> +struct udft_entry * get_udf_by_name __PROTO((char *key));
>>
>> /* update GPVAL_ variables available to user */
>> void update_gpval_variables __PROTO((int from_plot_command));
>> --- specfun.c.orig 2011-01-11 17:37:27.000000000 +0100
>> +++ specfun.c 2011-01-12 16:14:28.000000000 +0100
>> @@ -49,6 +49,7 @@
>> #include "specfun.h"
>> #include "stdfn.h"
>> #include "util.h"
>> +#include "internal.h"
>>
>> #define ITMAX 200
>>
>> @@ -1933,3 +1934,130 @@
>> push(Gcomplex(&a, x, 0.0));
>> }
>>
>> +/* Finite summation
>> + *
>> + * Calculate the finite sum(a, b, "f") = \sum_{i=a}^b f(i), where "f" is the
>> + * name (a string) of f(i), a function taking one (integer) parameter i.
>> + */
>> +void
>> +f_sum(union argument *arg)
>> +{
>> + struct value tmp;
>> + int a, b; // bounds [a, b]
>> + struct cmplx ret;
>> + int i;
>> + struct udft_entry *udf;
>> + union argument call_arg;
>> +
>> + (void) arg; /* avoid -Wunused warning */
>> +
>> + // pop function name
>> + if (pop(&tmp)->type != STRING)
>> + int_error(NO_CARET, "expecting a name of a function with 1 parameters as 3rd argument to sum");
>> + if (!(udf = get_udf_by_name(tmp.v.string_val)))
>> + int_error(NO_CARET, "No user-defined function %s", tmp.v.string_val);
>> +
>> + // pop upper bound (b)
>> + if (pop(&tmp)->type != INTGR)
>> + int_warn(NO_CARET, "expecting an integer as 2nd argument to sum");
>> + b = tmp.v.int_val;
>> +
>> + // pop lower bound (a)
>> + if (pop(&tmp)->type != INTGR)
>> + int_warn(NO_CARET, "expecting an integer as 1st argument to sum");
>> + a = tmp.v.int_val;
>> +
>> + ret.real = 0;
>> + ret.imag = 0;
>> + for (i=a; i<=b; ++i) {
>> +
>> + /* calculate f_i = f(i); */
>> +
>> + push(Ginteger(&tmp, i));
>> +
>> + call_arg.udf_arg = udf;
>> + f_call(&call_arg);
>> +
>> + pop(&tmp);
>> + ret.real += real(&tmp);
>> + ret.imag += imag(&tmp);
>> + }
>> +
>> + push(Gcomplex(&tmp, ret.real, ret.imag));
>> +
>> +}
>> +
>> +/* Finite summation (with free parameter x)
>> + *
>> + * Calculate the finite sum(a, b, x, "f") = \sum_{i=a}^b f(i, x), where "f" is the
>> + * name (a string) of f(i, x), a function taking two parameters i (integer) and x
>> + * (complex). Example usage:
>> + *
>> + * # fourier coefficients of some square wave
>> + * fourier(k, x) = sin(3./2*k)/k * 2./3*cos(k*x)
>> + * s(x) = 1./2 + sum(1, 10, x, "fourier")
>> + * plot s(x)
>> + */
>> +void
>> +f_sumx(union argument *arg)
>> +{
>> + struct value tmp;
>> + int a, b; // bounds [a, b]
>> + struct cmplx x, ret;
>> + int i;
>> + udft_entry *udf;
>> + union argument calln_arg;
>> +
>> + // XXX is arg every used in any other function if so, what is it used for?
>> + (void) arg; /* avoid -Wunused warning */
>> +
>> + // XXX do I have to free the poped values?
>> + // pop function name
>> + if (pop(&tmp)->type != STRING)
>> + int_error(NO_CARET, "expecting a name of a function with 2 parameters as 4th argument to sum");
>> + if (!(udf = get_udf_by_name(tmp.v.string_val)))
>> + int_error(NO_CARET, "No user-defined function %s", tmp.v.string_val);
>> +
>> + // pop x
>> + pop(&tmp);
>> + x.real = real(&tmp);
>> + x.imag = imag(&tmp);
>> +
>> + // pop upper bound (b)
>> + if (pop(&tmp)->type != INTGR)
>> + int_warn(NO_CARET, "expecting an integer as 2nd argument to sum");
>> + b = tmp.v.int_val;
>> +
>> + // pop lower bound (a)
>> + if (pop(&tmp)->type != INTGR)
>> + int_warn(NO_CARET, "expecting an integer as 1st argument to sum");
>> + a = tmp.v.int_val;
>> +
>> + ret.real = 0;
>> + ret.imag = 0;
>> + for (i=a; i<=b; ++i) {
>> +
>> + /* calculate f_i(x) = f(i, x); */
>> +
>> + /* XXX in what order do I have to push?
>> + * I thought that I would have to push from right to left but my
>> + * testing contradicts that finding. I am very unsure about the order
>> + * and need to understand this
>> + */
>> + // XXX do I have to malloc instead of pushing a temporary?
>> + push(Ginteger(&tmp, i));
>> + push(Gcomplex(&tmp, x.real, x.imag));
>> + push(Ginteger(&tmp, 2)); // push argument count
>> +
>> + calln_arg.udf_arg = udf;
>> + f_calln(&calln_arg);
>> +
>> + pop(&tmp);
>> + ret.real += real(&tmp);
>> + ret.imag += imag(&tmp);
>> + }
>> +
>> + push(Gcomplex(&tmp, ret.real, ret.imag));
>> +
>> +}
>> +
>> --- specfun.h.orig 2011-01-11 17:37:21.000000000 +0100
>> +++ specfun.h 2011-01-12 15:36:01.000000000 +0100
>> @@ -61,4 +61,7 @@
>> void f_inverse_erf __PROTO((union argument *x));
>> void f_lambertw __PROTO((union argument *x));
>>
>> +void f_sum __PROTO((union argument *x));
>> +void f_sumx __PROTO((union argument *x));
>> +
>> #endif /* GNUPLOT_SPECFUN_H */
>> --- ../docs/gnuplot.doc.orig 2011-01-12 15:09:42.000000000 +0100
>> +++ ../docs/gnuplot.doc 2011-01-12 16:22:47.000000000 +0100
>> @@ -1091,6 +1091,30 @@
>> %sinh(x)@any@$sinh~x$, hyperbolic sine of $x$ in radians
>> The `sinh(x)` function returns the hyperbolic sine of its argument. `sinh`
>> expects its argument to be in radians.
>> +4 sum
>> +?expressions functions sum
>> +?functions sum
>> +?sum
>> +#sum(a, b, "f")& any& $\sum_{i=a}^b f(i)$, finite sum \\
>> +%sum(a, b, "f")@any@$sum(i=a..b, f(i)$, finite sum
>> + The `sum(a, b, "f")` function calculates the finite sum \sum_{i=a}^b f(i),
>> + where "f" is the name (a string) of f(i), a function taking one (integer)
>> + parameter i. For example, `f(n)=n; print sum(1, 10, "f")` prints 55.
>> +4 sumx
>> +?expressions functions sumx
>> +?functions sumx
>> +?sumx
>> +#sumx(a, b, x, "f")& any& $\sum_{i=a}^b f(i, x)$, finite sum (with parameter $x$)\\
>> +%sumx(a, b, x, "f")@any@$sumx(i=a..b, f(i, x)$, finite sum (with parameter $x$)
>> + The `sumx(a, b, x, "f")` function calculates the finite sum
>> + \sum_{i=a}^b f(i, x), where "f" is the name (a string) of f(i, x), a function
>> + taking two parameters i (integer) and x (complex).
>> +
>> + Example:
>> + # fourier coefficients of some square wave
>> + fourier(k, x) = sin(3./2*k)/k * 2./3*cos(k*x)
>> + s(x) = 1./2 + sumx(1, 10, x, "fourier")
>> + plot s(x)
>> 4 sqrt
>> ?expressions functions sqrt
>> ?functions sqrt
>>
>>
>
If I was hitting 251 recursive calls of a function to do a sum
calculation I would be inclined to ask myself if it was the best way of
doing things.
/P
|