種類
- インスタンスメソッド (319)
- 特異メソッド (110)
- クラス (55)
クラス
- Integer (55)
- Prime (121)
-
Prime
:: EratosthenesGenerator (33) -
Prime
:: Generator23 (33) -
Prime
:: PseudoPrimeGenerator (154) -
Prime
:: TrialDivisionGenerator (33)
キーワード
- EratosthenesGenerator (11)
- Generator23 (11)
- Prime (11)
- PseudoPrimeGenerator (11)
- TrialDivisionGenerator (11)
- each (66)
-
each
_ prime (22) -
each
_ with _ index (22) -
from
_ prime _ division (11) - instance (11)
-
int
_ from _ prime _ division (22) - new (11)
- next (44)
- prime? (33)
-
prime
_ division (33) - rewind (44)
- succ (44)
-
upper
_ bound (11) -
upper
_ bound= (11) -
with
_ index (22) -
with
_ object (22)
検索結果
先頭5件
-
Prime
:: PseudoPrimeGenerator # each {|prime| . . . } -> object (2.0) -
素数を与えられたブロックに渡して評価します。
素数を与えられたブロックに渡して評価します。 -
Prime
:: PseudoPrimeGenerator # each _ with _ index -> Enumerator (2.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (2.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
Prime
:: PseudoPrimeGenerator # next -> () (2.0) -
次の擬似素数を返します。 また内部的な位置を進めます。
次の擬似素数を返します。
また内部的な位置を進めます。
サブクラスで実装してください。
@raise NotImplementedError 必ず発生します。 -
Prime
:: PseudoPrimeGenerator # rewind -> () (2.0) -
列挙状態を巻き戻します。
列挙状態を巻き戻します。
サブクラスで実装してください。
@raise NotImplementedError 必ず発生します。
@see Enumerator#rewind -
Prime
:: PseudoPrimeGenerator # succ -> () (2.0) -
次の擬似素数を返します。 また内部的な位置を進めます。
次の擬似素数を返します。
また内部的な位置を進めます。
サブクラスで実装してください。
@raise NotImplementedError 必ず発生します。 -
Prime
:: PseudoPrimeGenerator # upper _ bound -> Integer | nil (2.0) -
現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。
現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。 -
Prime
:: PseudoPrimeGenerator # upper _ bound=(upper _ bound) (2.0) -
新しい列挙上界をセットします。
新しい列挙上界をセットします。
@param upper_bound 新しい上界を整数または nil で指定します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。 -
Prime
:: PseudoPrimeGenerator # with _ index -> Enumerator (2.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
Prime
:: PseudoPrimeGenerator # with _ index {|prime , index| . . . } -> self (2.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index...