help-octave
[Top][All Lists]
Advanced

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

Patch for discrete_inv.m


From: John W. Eaton
Subject: Patch for discrete_inv.m
Date: Mon, 16 Feb 2004 18:35:00 -0600

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?

Thanks,

jwe



-------------------------------------------------------------
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]