You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Mark R. Diggory" <md...@latte.harvard.edu> on 2003/07/10 15:29:19 UTC

[math] Thoughts on efficiency in ListUnivariates

The new ListUnivariateImpl gives an opportunity to ponder a couple 
different approaches and their efficiency issues.

Current approach: Iterate over list and transform objects to doubles, 
inserting these doubles into a double[] and passing it to the 
appropriate UnivarStatistic object's evaluate method.

Primarily Issue: The double[] is regenerated for every getXXX call.

Pros: The "change in state" of the external list doesn't need to be 
monitored.

Cons: Not a very efficient means of working with the Lists.

Would it would be better if the state of the list could be monitored and 
the double[] regenerated if an object has been added/removed from the 
list? Are there known means of "listening to Collections".

-Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org