You're right, it can drop the first element. SamplingIterator.next() pulls a successor element from the delegate iterator and stashes it. This works, but I think the full semantics would require that the delegate iterator does not advance until Sampling.next causes it to. Not sure.
On Sat, May 21, 2011 at 3:06 PM, Sean Owen (JIRA) <[email protected]> wrote: > > [ > https://issues.apache.org/jira/browse/MAHOUT-687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037469#comment-13037469 > ] > > Sean Owen commented on MAHOUT-687: > ---------------------------------- > > I don't know what you mean -- it most definitely can drop the first element. > What hasNext() method are you referring to? > Yes, it's easy to make a similar change elsewhere to remove static Random > instances. > >> Random generator objects- slight refactor >> ----------------------------------------- >> >> Key: MAHOUT-687 >> URL: https://issues.apache.org/jira/browse/MAHOUT-687 >> Project: Mahout >> Issue Type: Improvement >> Reporter: Lance Norskog >> Priority: Minor >> Attachments: MAHOUT-687.patch, MAHOUT-687.patch >> >> >> Problems: >> * The uncommons RepeatableRNG classes are the basis of RandomUtils. >> ** These classes cheerfully ignore setSeed. >> * Some people in the project want to move off Uncommons anyway. >> This patch uses the org.apache.commons.math.random.RandomGenerator classes >> instead of org.apache.uncommons.maths.RepeatableRNG classes. >> . > > -- > This message is automatically generated by JIRA. > For more information on JIRA, see: http://www.atlassian.com/software/jira > -- Lance Norskog [email protected]
