I've got two big concerns right now with DoubleArrays:
(1) To take advantage of any of the StatUtil methods on any of the DoubleArray objects, one has to use "getElements()" to get a double[] from the DoubleArray object to pass on to the StatUtils method, unfortunately DoubleArray.getElements() needs to generate a "copy" of the internal storage, so this often isn't efficient to do every time one is calling a statistic. I have a couple proposals that can resolve this issue.
(a) Have methods in StatUtils that accept both double[] and DoubleArray as input paramters. and have the StatUtil.xxx(double []) methods actually only wrap the double[] in a DoubleArray wrapper and then delegate to the StatUtil.xxx(DoubleArray) methods.
(b) Then add a constructor to FixedDoubleArray so it can be easily used to wrap the double[], or write a thin wrapper implementation of DoubleArray for this specific case.
(2) Some of the methods in DoubleArray are questionable as they are statistical in nature and replicated in the Univariate Interface, specifically DoubleArray.getMin() and DoubleArray.getMax(), and I can't find anywhere that these ever actually get used, I recommend we remove these methods from the Interface and Implementations.
(3) Following our same philosophy of not having methods in the interface that can't be supported across all implementations, DoubleArray.discardFrontElements seems problematic as not all DoubleArrays may support it. I do understand the usage, requirement and need for this method. I wonder if there is some way to internalize the discarding or provide a more generic sort of DoubleArray.trim() method. Discarding really only comes into play when working with ContractableDoubleArrays, maybe it should be exposed at that level instead of in the interface. Any thoughts?
-Mark
-- Mark Diggory Software Developer Harvard MIT Data Center http://www.hmdc.harvard.edu
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
