An implementation of PseudoPrimeGenerator
which uses a prime table generated by trial division.
Class Methods
::
lib/prime.rb
View on GitHub
# File tmp/rubies/ruby-2.3.8/lib/prime.rb, line 327
def initialize
@index = -1
super
end
No documentation available
Instance Methods
#
lib/prime.rb
View on GitHub
# File tmp/rubies/ruby-2.3.8/lib/prime.rb, line 335
def rewind
initialize
end
No documentation available
#
lib/prime.rb
View on GitHub
# File tmp/rubies/ruby-2.3.8/lib/prime.rb, line 332
def succ
TrialDivision.instance[@index += 1]
end
No documentation available