るりまサーチ

最速Rubyリファレンスマニュアル検索!
144件ヒット [101-144件を表示] (0.009秒)
トップページ > クエリ:permutation[x]

別のキーワード

  1. array permutation
  2. matrix permutation?
  3. _builtin permutation
  4. array repeated_permutation
  5. _builtin repeated_permutation

ライブラリ

クラス

キーワード

検索結果

<< < 1 2 >>

Array#repeated_combination(n) { |c| ... } -> self (6.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...

Enumerator#size -> Integer | Float::INFINITY | nil (6.0)

self の要素数を返します。

...いた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。

//emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 94109400
loop.size # => Float::INFINITY
(1..100).drop_while.size # => nil
//}

@see Enumerator.new...

Matrix#lup -> Matrix::LUPDecomposition (6.0)

行列の LUP 分解を保持したオブジェクトを返します。

...します。

//emlist[例][ruby]{
require 'matrix'
a = Matrix[[1, 2], [3, 4]]
l, u, p = a.lup
l.lower_triangular? # => true
u.upper_triangular? # => true
p.permutation? # => true
l * u == p * a # => true
a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)]
//}

@see Matrix::LUPDecomposition...

Matrix#lup_decomposition -> Matrix::LUPDecomposition (6.0)

行列の LUP 分解を保持したオブジェクトを返します。

...します。

//emlist[例][ruby]{
require 'matrix'
a = Matrix[[1, 2], [3, 4]]
l, u, p = a.lup
l.lower_triangular? # => true
u.upper_triangular? # => true
p.permutation? # => true
l * u == p * a # => true
a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)]
//}

@see Matrix::LUPDecomposition...
<< < 1 2 >>