るりまサーチ

最速Rubyリファレンスマニュアル検索!
1107件ヒット [1-100件を表示] (0.136秒)
トップページ > クエリ:e[x] > クラス:Matrix[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. matrix rank_e
  5. open3 capture2e

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Matrix#coerce(other) -> Array (6201.0)

他の数値オブジェクトとの変換を行います。

...クトをMatrix::Scalarのオブジェクトに変換し、selfとの組を配列として返します。

@param other 変換する数値オブジェクト

//emlist[例][ruby]{
require 'matrix'
a1 = [1, 2]
a2 = [-1.25, 2.2]
m = Matrix[a1, a2]
r = Rational(1, 2)
p m.coerce(r) #=> [#<Matrix::Scalar:...
...0x832df18 @value=(1/2)>, Matrix[[1, 2], [-1.25, 2.2]]]
//}...

Matrix#column_vectors -> [Vector] (6201.0)

自分自身を列ベクトルの配列として返します。

...自分自身を列ベクトルの配列として返します。

//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_vectors # => [Vector[1, 10, -1], Vector[2, 15, -2], Vector[3, 20, 1.5]]
//}...

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

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

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

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

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

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

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

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

Matrix#row_vectors -> [Vector] (6201.0)

自分自身を行ベクトルの配列として返します。

...自分自身を行ベクトルの配列として返します。

//emlist[例][ruby]{
require 'matrix'
a1 = [ 1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]

p m.row_vectors # => [Vector[1, 2, 3], Vector[10, 15, 20], Vector[-1, -2, 1.5]]
//}...

絞り込み条件を変える

Matrix#each(which = :all) -> Enumerator (6114.0)

行列の各要素を引数としてブロックを呼び出します。

...:lower 対角成分とそれより下側の部分
* :upper対角成分とそれより上側の部分
* :strict_lower 対角成分の下側
* :strict_upper 対角成分の上側

ブロックを省略した場合、 Enumerator を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix
[ [1...
...,2], [3,4] ].each { |e| puts e }
# => prints the numbers 1 to 4
Matrix
[ [1,2], [3,4] ].each(:strict_lower).to_a # => [3]
//}

@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#map...

Matrix#each(which = :all) {|e| ... } -> self (6114.0)

行列の各要素を引数としてブロックを呼び出します。

...:lower 対角成分とそれより下側の部分
* :upper対角成分とそれより上側の部分
* :strict_lower 対角成分の下側
* :strict_upper 対角成分の上側

ブロックを省略した場合、 Enumerator を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix
[ [1...
...,2], [3,4] ].each { |e| puts e }
# => prints the numbers 1 to 4
Matrix
[ [1,2], [3,4] ].each(:strict_lower).to_a # => [3]
//}

@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#map...

Matrix#each_with_index(which = :all) -> Enumerator (6114.0)

行列の各要素をその位置とともに引数としてブロックを呼び出します。

...できます。
Matrix
#each と同じなのでそちらを参照してください。

ブロックを省略した場合、 Enumerator を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix
[ [1,2], [3,4] ].each_with_index do |e, row, col|
puts "#{e} at #{row}, #{col}"
e
nd
# => 1 at 0,...
...0
# => 2 at 0, 1
# => 3 at 1, 0
# => 4 at 1, 1
//}

@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each...

Matrix#each_with_index(which = :all) {|e, row, col| ... } -> self (6114.0)

行列の各要素をその位置とともに引数としてブロックを呼び出します。

...できます。
Matrix
#each と同じなのでそちらを参照してください。

ブロックを省略した場合、 Enumerator を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix
[ [1,2], [3,4] ].each_with_index do |e, row, col|
puts "#{e} at #{row}, #{col}"
e
nd
# => 1 at 0,...
...0
# => 2 at 0, 1
# => 3 at 1, 0
# => 4 at 1, 1
//}

@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each...
<< 1 2 3 ... > >>