るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.037秒)
トップページ > クラス:Array[x] > バージョン:2.1.0[x] > クエリ:repeated_permutation[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. array repeated_permutation
  2. _builtin repeated_permutation
  3. array repeated_combination
  4. _builtin repeated_combination
  5. repeated_permutation array

キーワード

検索結果

Array#repeated_permutation(n) -> Enumerator (54406.0)

サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。

...ロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}

@see Array#repeated_combination, Array#permutation...

Array#repeated_permutation(n) { |p| ... } -> self (54406.0)

サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。

...ロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}

@see Array#repeated_combination, Array#permutation...

Array#permutation(n = self.length) -> Enumerator (28.0)

サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。

...した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.permutation(2) {|e| result << e} # => [1,2,3]
result # => [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
//}

@see Array#combination, Array#repeated_permutation...

Array#permutation(n = self.length) { |p| block } -> self (28.0)

サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。

...した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.permutation(2) {|e| result << e} # => [1,2,3]
result # => [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
//}

@see Array#combination, Array#repeated_permutation...

Array#repeated_combination(n) -> Enumerator (28.0)

サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。

...して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| result << e} # => [1,2,3]
result #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
//}

@see Array#repeated_permutation, Array#combination...

絞り込み条件を変える

Array#repeated_combination(n) { |c| ... } -> self (28.0)

サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。

...して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| result << e} # => [1,2,3]
result #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
//}

@see Array#repeated_permutation, Array#combination...