REASY opened a new pull request #134: EnumeratedDistribution: Use non-indexing 
for loop to improve performance in case of LinkedList
URL: https://github.com/apache/commons-math/pull/134
 
 
   In case if `List<Pair<T, Double>> pmf` is LinkedList, the runtime for 
constructor of the EnumeratedDistribution becomes quadratic to the length of 
pmf because of accessing i-th element by index. Accessing i-th element of 
LinkedList is linear. Just replaced the population of `singletons` with  
enhanced for-loop.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to