commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (O'brien, Tim)
Subject Re: [math][patch] New RollingUnivariateImpl
Date Fri, 16 May 2003 15:05:28 GMT
On Fri, 2003-05-16 at 09:37, Mark R. Diggory wrote:
> I had looked at those, but found the Cont/Exp Arrays to be a bit 
> overkill for the RollingUnivariate. This is strictly because it works on 
> a double array of "constant length". The easiest implementation to 
> understand for the RollingUnivariate was the double array.

Your patch involves moving (n-1) elements of the list on every insert. 
Using ContractableDoubleArray accomplishes the same task, but simply
increments the startIndex of an internal storage array.  Storage is
reclaimed periodically when certain storage limits are exceeded.

> What do you think? Maybe RollingArray extends ExpandableArray and masks 
> the rolling behavior behind its interface so it can be plugged in easily 
> to the other Implementations?

DoubleArray already exposes addElementRolling() in the public interface.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message