[ https://issues.apache.org/jira/browse/NUMBERS-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17362556#comment-17362556 ]
Gilles Sadowski commented on NUMBERS-163: ----------------------------------------- {quote}no need to instantiate an object to perform the computation in the simple cases. {quote} Sure; performance impact should be checked. {quote}I don't see how this addresses my use cases. {quote} I showed extended usage of {{LinearCombination}} for which I understood that intermediate values should be kept (i.e. "p + s" should only be computed when the "double" result is requested). I didn't look at {{Summation}}. > Summation and LinearCombination Accumulators > -------------------------------------------- > > Key: NUMBERS-163 > URL: https://issues.apache.org/jira/browse/NUMBERS-163 > Project: Commons Numbers > Issue Type: New Feature > Reporter: Matt Juntunen > Priority: Major > > It would be useful to have simple accumulator classes in {{Summation}} and > {{LinearCombination}} to perform extended precision operations on arbitrary > collections of values without requiring conversion to {{double[]}}. Ex: > {code:java} > Summation.Accumulator sum= Summation.accumulator(1d); > sum.add(x) > .add(y) > .add(z) > .add(w); > double sumResult = sum.get(); > LinearCombination.Accumulator comb = LinearCombination.accumulator(1d); > comb.add(x, scale) > .add(y, scale) > .add(z, scale) > .add(w, scale); > double combResult = comb.get(); > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)