help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for discrete_inv.m


From: Glenn Golden
Subject: Re: Patch for discrete_inv.m
Date: Mon, 16 Feb 2004 19:32:17 -0700

"John W. Eaton" writes:
> On 23-Jan-2004, Glenn Golden <address@hidden> wrote:
> 
> | The following patch to scripts/statistics/distributions/discrete_inv.m
> | significantly reduces its memory usage for large datasets.  It does the
> | following:
> 
> I applied these changes.
> 
> |    1. Elimininates the variable 'ind', which is the same size as the
> |       incoming dataset, and was never being used.
> | 
> |    2. Clears variable 'p' (also same size as the incoming dataset) as
> |       soon as it's finished using it.
> 
> I used "p = []" instead of calling clear as it should be faster and
> have the same effect.
> 
> Sorry I missed this for 2.1.54.  
> 
> | (I'm not posting this to the bugs-octave list because I'm not sure that
> | it's considered a bug:  In some cases, the space-time tradeoff made in
> | this patch may be the opposite of what is desired, e.g., if the routine
> | is being called many times with relatively small datasets and large CDF
> | fraction vectors.)
> 
> Perhaps there is a partially vectorized solution that limits the
> memory usage and keeps the number of loop iterations relatively small?
> 

Actually now that I've been using it steadily for a while, I'm reasonably
satisfied that the tradeoff is a good one as is.  The speed penalty for
many calls with small datasets seems like it's relatively unimportant,
because the realtime is dominated by temp copies and sorting.  And certainly
in the sense that the memory exhaustion for large problems was a show
stopper, whereas the small speed penalty for many calls with small problems
is probably just an annoyance in most cases.

- gdg



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]