Menu

#444 option for "set fit" to change MAX_DATA

None
closed-fixed
nobody
fit (2)
5
2016-05-13
2016-05-10
No

If fitting a dataset with more than 2048 points (10000 here), a series of messages

Max. number of data points scaled up to: 3072
Max. number of data points scaled up to: 4608
Max. number of data points scaled up to: 6912
Max. number of data points scaled up to: 10368

is displayed before each fit, which is slighly annoying, if nothing else. Especially for those windows users who cannot compile their own binary and change the value in fit.c:154, would it be possible to have an option "MAX_DATA" to set fit?

Discussion

  • Karl Ratzsch

    Karl Ratzsch - 2016-05-10

    (On second thought, this sounds like something I might manage to implement. I'll come back with a status in a while.)

     

    Last edit: Karl Ratzsch 2016-05-18
  • Bastian Märkisch

    These limits look like they come from an age when 64kB were a lot... Couldn't we just eliminate this warning/info message - or at least only emit it for really sizeable datasets?

     
    • Karl Ratzsch

      Karl Ratzsch - 2016-05-10

      I guess something like 64k would be a sensible change to the default of MAX_DATA = 2048. I cannot ascertain if it would be hard to do this in a dynamic fashion. plot does not have a hard-set limit, so it should be possible, i guess.

       
    • Hans-Bernhard Broeker

      Well, as it is, 2048 data points already eat more than 64 KiB, what with there being 6 arrays of at least 2048 doubles if you go there. That's 96 KiB, and yes, that quite hard to support for a 16-bit platform, which was still supported back then.

      And there's a reason why the factor is 1.5 instead of 2, too. Back when that factor was set (by myself, IIRC), the maths part would allocate a matrix of (num_data * num_data) elements, so a growth by 2 would actually increase the memory usage by a factor of 4. So I chose 1.5, which yields an effective resize of 2.25. The underlying solver has changed in the meantime, so memory consumption is now linear in num_data. That means a factor of 2 would be sensible now.

       
  • Bastian Märkisch

    Btw. thanks to MSYS2/Mingw64 compilation is now almost as pain-free on Windows as it is on *nix, see [support-requests:#199].

     

    Related

    Support Requests: #199

  • Karl Ratzsch

    Karl Ratzsch - 2016-05-10

    Coincidentally, I discovered that post half an hour ago and am currently installing msys2. :-)

     
  • Bastian Märkisch

    Here's the equivalent code section from plot2d.c:

        while ((j = df_readline(v, max_cols)) != DF_EOF) {
    
            if (i >= current_plot->p_max) {
                /* overflow about to occur. Extend size of points[]
                 * array. Double the size, and add 1000 points, to avoid
                 * needlessly small steps. */
                cp_extend(current_plot, i + i + 1000);
            }
    

    No message whatsoever. Plus a more "agressive" extension 2*n+1000 instead of (n*3)/2.
    I propose to adopt the code in fit.c accordingly.

     
  • Bastian Märkisch

    • status: open --> pending-accepted
    • Group: -->
     
  • Bastian Märkisch

    Instead of the proposed option the code now no longer prints a message when enlarging the max. number of data points. Also the maximum number is doubled on every iteration.
    In CVS for version 5.1, but might go to 5.0 in as well in my opinion.

     
    • Ethan Merritt

      Ethan Merritt - 2016-05-13

      Sure. Might as weel go into 5.0 also. I don't see any down-side.

       
      • Bastian Märkisch

        OK. Done.

         
  • Bastian Märkisch

    • status: pending-accepted --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.