るりまサーチ

最速Rubyリファレンスマニュアル検索!
526件ヒット [501-526件を表示] (0.053秒)

別のキーワード

  1. bigdecimal/util to_d
  2. float to_d
  3. rsa d
  4. rsa d=
  5. matrix d

キーワード

検索結果

<< < ... 4 5 6 >>

Matrix#eigensystem -> Matrix::EigenvalueDecomposition (145.0)

行列の固有値と左右の固有ベクトルを保持したオブジェクトを返します。

...

Matrix
::EigenvalueDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(右固有ベクトル、固有値行列、左固有ベクトル)
を得ることができます。
これを [V, D, W] と書くと、
(元の行列が対角化可能ならば)、
D
...
...で、 self == V*D*W, V = W.inverse を満たします。
D
のそれぞれの対角成分が行列の固有値です。

//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
v, d, v_inv = m.eigensystem
d
.diagonal? # => true
v.inv == v_inv # => true
(v * d * v_inv).round(5) == m # => tru...
...e
//}

@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します
@see Matrix::EigenvalueDecomposition...

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

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

...

Matrix
::LUPDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(下三角行列、上三角行列、置換行列)
を得ることができます。これを [L, U, P] と書くと、
L*U = P*self を満たします。

//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...

Vector#[]=(index, value) (103.0)

index 番目の要素を value に変更します。

...index 番目の要素を value に変更します。

@param index インデックスを整数で指定します。
@param value 設定したい要素の値を指定します。
@raise TypeError ベクトルの範囲外にある整数を指定したときに、発生します。

//emlist[][ruby]{...
...require 'matrix'

v = Vector[0, 0, 0, 0, 0]

v[1] = 2
p v #=> Vector[0, 2, 0, 0, 0]

v[-1] = 3
p v #=> Vector[0, 2, 0, 0, 3]

v[99] = 100
# IndexError: given index 99 is outside of -5...5
//}...
<< < ... 4 5 6 >>