home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,412 of 2,978   
   Dr J R Stockton to All   
   Re: Optimizing a calculation over a seri   
   06 Mar 07 23:17:07   
   
   From: reply0710@merlyn.demon.co.uk   
      
   In comp.lang.pascal.borland message <1173164639.789824.274180@c51g2000cw   
   c.googlegroups.com>, Mon, 5 Mar 2007 23:03:59, prino   
    posted:   
   >Hi,   
   >   
   >I'm trying to find a way to speed up something, but I'm running into a   
   >wall. I've got a series (with a current length of 2056 items) of   
   >velocities stored as distance/time pairs.   
      
   Start by calculating a list (array) of velocities (really speeds) so   
   that the divisions are done only once each.   
      
   > What I need to get, for a   
   >list of 15 set velocities, are the sub-series of the 2056-set where   
   >the entire average of the entire subseries exceeds the current set   
   >velocity (SV),   
      
   It seems, maybe, that you should sort the list of 15 SVs and process in   
   order from lowest to highest.  Then it is (?) only necessary to look for   
   one SV within the set found for the previous SV.  One could have an   
   array of 2056 Booleans to show which are candidates, or note starting &   
   finishing points.   
      
   Or maybe start with the highest SV and for each lower SV seek to extend   
   the set found   
      
   > ie first velocity needs to exceed the SV, the avarage   
   >of the first two velocities needs to exceed the SV, the average of the   
   >first three velocities...   
      
   If you subtract the current target SV from all points, it is then only   
   necessary to see whether the running sum is positive.  That may save   
   arithmetic.   
      
   If the code is written in TP/BP, one way to speed it up could be to   
   compile it in Delphi.   
      
   --   
    (c) John Stockton, Surrey, UK.   ?@merlyn.demon.co.uk   Turnpike v6.05   MIME.   
      TP/BP/Delphi/&c., FAQqy topics & links;   
        RAH Prins : c.l.p.b mFAQ;   
      Timo Salmi's Turbo Pascal FAQ.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca