class Prime::TrialDivisionGenerator

An implementation of PseudoPrimeGenerator which uses a prime table generated by trial division.

Public Class Methods

new() click to toggle source
Calls superclass method Prime::PseudoPrimeGenerator::new
# File prime-0.1.2/lib/prime.rb, line 429
def initialize
  @index = -1
  super
end

Public Instance Methods

next()
Alias for: succ
rewind() click to toggle source
# File prime-0.1.2/lib/prime.rb, line 437
def rewind
  initialize
end
succ() click to toggle source
# File prime-0.1.2/lib/prime.rb, line 434
def succ
  TrialDivision.instance[@index += 1]
end
Also aliased as: next