るりまサーチ

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

別のキーワード

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

キーワード

検索結果

<< 1 2 3 ... > >>

Matrix::LUPDecomposition#u -> Matrix (29205.0)

LUP分解の上半行列部分を返します。

...LUP分解の上半行列部分を返します。...

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

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

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

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

//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 (23359.0)

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

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

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

//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#entrywise_product(m) -> Matrix (23229.0)

アダマール積(要素ごとの積)を返します。

...ダマール積(要素ごとの積)を返します。

@raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します。

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

Matrix
[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) # => Matrix[[1, 4], [9, 8]]
//}...

Matrix#hadamard_product(m) -> Matrix (23229.0)

アダマール積(要素ごとの積)を返します。

...ダマール積(要素ごとの積)を返します。

@raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します。

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

Matrix
[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) # => Matrix[[1, 4], [9, 8]]
//}...

絞り込み条件を変える

Matrix#adjugate -> Matrix (23228.0)

余因子行列を返します。

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

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

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

Matrix#round(ndigits = 0) -> Matrix (23204.0)

行列の各要素を指定した桁数で丸めた行列を返します。

...行列の各要素を指定した桁数で丸めた行列を返します。

@see Float#round...

Matrix#regular? -> bool (23127.0)

行列が正方で正則なら true を、特異なら false を返します。

...正則なら true を、特異なら false を返します。

行列が正則であるとは、正方行列であり、かつ、その逆行列が存在することです。
行列式が0でないことと同値です。

正方行列でない場合には例外 ExceptionForMatrix::ErrDimensionMisma...
...h を
発生させます。


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

a1 = [ 1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]
p m.regular? # => true

a1 = [ 1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, -3]
m = Matrix[a1, a2, a3]
p m.regular? # => false

a1 = [ 1, 2, 3]
a2 = [10,...
...15, 20]
a3 = [-1, -2, 1.5]
a4 = [1, 1, 1]
m = Matrix[a1, a2, a3, a4]
p m.regular? # => raise ExceptionForMatrix::ErrDimensionMismatch
//}

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

Matrix#column(j) -> Vector | nil (23115.0)

j 番目の列を Vector オブジェクトで返します。 j 番目の列が存在しない場合は nil を返します。 ブロックが与えられた場合はその列の各要素についてブロックを繰り返します。

...ックスと見倣します。末尾の列が -1 番目になります。

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

a1 = [ 1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]

p m.column(1) # => Vector[2, 15, -2]

cnt = 0
m.column(-1) { |x|
cnt = cnt + x
}
p cnt # => 24.5
//}...

Matrix#column(j) {|x| ... } -> self (23115.0)

j 番目の列を Vector オブジェクトで返します。 j 番目の列が存在しない場合は nil を返します。 ブロックが与えられた場合はその列の各要素についてブロックを繰り返します。

...ックスと見倣します。末尾の列が -1 番目になります。

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

a1 = [ 1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]

p m.column(1) # => Vector[2, 15, -2]

cnt = 0
m.column(-1) { |x|
cnt = cnt + x
}
p cnt # => 24.5
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>