143件ヒット
[1-100件を表示]
(0.153秒)
ライブラリ
- prime (143)
キーワード
- each (22)
-
each
_ with _ index (22) - next (11)
- rewind (11)
- succ (11)
-
upper
_ bound (11) -
upper
_ bound= (11) -
with
_ index (22) -
with
_ object (22)
検索結果
先頭5件
-
Prime
:: PseudoPrimeGenerator # next -> () (9102.0) -
次の擬似素数を返します。 また内部的な位置を進めます。
...次の擬似素数を返します。
また内部的な位置を進めます。
サブクラスで実装してください。
@raise NotImplementedError 必ず発生します。... -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (6202.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...。
@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は 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 # upper _ bound=(upper _ bound) (6202.0) -
新しい列挙上界をセットします。
...新しい列挙上界をセットします。
@param upper_bound 新しい上界を整数または nil で指定します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。... -
Prime
:: PseudoPrimeGenerator # with _ index {|prime , index| . . . } -> self (6202.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...。
@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は 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 -> Enumerator (6102.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...。
@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は 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 # rewind -> () (6102.0) -
列挙状態を巻き戻します。
...列挙状態を巻き戻します。
サブクラスで実装してください。
@raise NotImplementedError 必ず発生します。
@see Enumerator#rewind... -
Prime
:: PseudoPrimeGenerator # upper _ bound -> Integer | nil (6102.0) -
現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。
...現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。... -
Prime
:: PseudoPrimeGenerator # with _ index -> Enumerator (6102.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...。
@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は 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 # succ -> () (6002.0) -
次の擬似素数を返します。 また内部的な位置を進めます。
...次の擬似素数を返します。
また内部的な位置を進めます。
サブクラスで実装してください。
@raise NotImplementedError 必ず発生します。... -
Prime
:: PseudoPrimeGenerator # with _ object(obj) -> Enumerator (3102.0) -
与えられた任意のオブジェクトと要素をブロックに渡して評価します。
...bj 任意のオブジェクトを指定します。
@return 最初に与えられたオブジェクトを返します。
@return ブロックを与えられた場合は obj を返します。ブロックを与えられなかった場合は Enumerator を返します。
@see Enumerator#with_object...