4件ヒット
[1-4件を表示]
(0.130秒)
ライブラリ
- ビルトイン (4)
キーワード
- permutation (2)
-
repeated
_ permutation (2)
検索結果
先頭4件
-
Array
# permutation(n = self . length) -> Enumerator (36607.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 (36607.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 _ permutation(n) -> Enumerator (36607.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 (36607.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...