[ 
https://issues.apache.org/jira/browse/MATH-894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495793#comment-13495793
 ] 

Phil Steitz commented on MATH-894:
----------------------------------

I never liked "apply" as a name.  IIRC it goes back to the attempt at 
functional programming style in the early days of the stat package.  The idea 
is that you "apply" a statistic to a set of data like applying a functor.  I am 
fine with calling it "compute" or even "evaluate" in RDA.  I think the change 
you suggest to clear() should be safe and an efficiency improvement.  The only 
problem would be code that somehow depends on unused storage only at the 
beginning of the array, which is not an advertised invariant.  Unit tests 
should pick up any problems in the public API.
                
> Spurious method call in "ResizableDoubleArray" ("o.a.c.m.util")
> ---------------------------------------------------------------
>
>                 Key: MATH-894
>                 URL: https://issues.apache.org/jira/browse/MATH-894
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.0
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>             Fix For: 3.1
>
>
> Method "addElement" should not call "contract()", as it will almost always 
> make the storage array shrink on the first call since it will be considered 
> "too big" (for just storing one element).
> See discussion about this change in MATH-757.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to