# An implementation of +PseudoPrimeGenerator+ which uses
# a prime table generated by trial division.
class Generator::TrialDivision < Generator::PseudoPrime
  def initialize
    @index = -1
    super
  end

  def succ
    Impl::TrialDivision.instance[@index += 1]
  end

  def rewind
    initialize
  end

  def next
    succ
  end
end
