るりまサーチ

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

別のキーワード

  1. matrix []
  2. matrix *
  3. matrix map
  4. matrix each
  5. matrix index

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

Matrix#inverse -> Matrix (20235.0)

逆行列を返します。

...逆行列を返します。

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

p Matrix[[2, 1], [3, 2]].inv #=> Matrix[[(2/1), (-1/1)], [(-3/1), (2/1)]]

p Matrix[[2.0, 1.0], [3.0, 2.0]].inv #=> Matrix[[2.0000000000000004, -1.0000000000000002], [-3.000000000000001, 2.0000000000000004]]
//}...

Matrix#collect {|x| ... } -> Matrix (20229.0)

行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。

...適用を繰り返した結果を、要素として持つ行列を生成します。

ブロックがない場合、 Enumerator を返します。


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

m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
//}

@see Matrix#each...

Matrix#eigen -> Matrix::EigenvalueDecomposition (20229.0)

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

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

Matrix
::EigenvalueDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(右固有ベクトル、固有値行列、左固有ベクトル)
を得ることがで...
...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 # => true
//}

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

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

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

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

Matrix
::EigenvalueDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(右固有ベクトル、固有値行列、左固有ベクトル)
を得ることがで...
...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 # => true
//}

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

Matrix#lup -> Matrix::LUPDecomposition (20229.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...

絞り込み条件を変える

Matrix#lup_decomposition -> Matrix::LUPDecomposition (20229.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...

Matrix#map {|x| ... } -> Matrix (20229.0)

行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。

...適用を繰り返した結果を、要素として持つ行列を生成します。

ブロックがない場合、 Enumerator を返します。


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

m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
//}

@see Matrix#each...

Matrix#adjugate -> Matrix (20228.0)

余因子行列を返します。

...余因子行列を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix
[[7,6],[3,9]].adjugate # => Matrix[[9, -6], [-3, 7]]
//}

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

Matrix#t -> Matrix (20227.0)

転置行列 (transpose matrix) を返します。

...転置行列 (transpose matrix) を返します。

self を Matrix のオブジェクトで、(m,n) 型行列としたとき a(j,i) を (i,j) 要素とする (n,m) 型行列を返します。...

Matrix#conj -> Matrix (20223.0)

複素共役を取った行列を返します。

...複素共役を取った行列を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix
[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
# => 1+2i i 0
# 1 2 3
Matrix
[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].conjugate
# => 1-2i -i 0
# 1 2 3
//}...

絞り込み条件を変える

Matrix#conjugate -> Matrix (20223.0)

複素共役を取った行列を返します。

...複素共役を取った行列を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix
[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
# => 1+2i i 0
# 1 2 3
Matrix
[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].conjugate
# => 1-2i -i 0
# 1 2 3
//}...
<< < 1 2 3 4 5 ... > >>