るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

クラス

キーワード

検索結果

<< 1 2 3 > >>

Vector#*(m) -> Matrix (18129.0)

自分自身を列ベクトル(行列)に変換して (実際には Matrix.column_vector(self) を適用) から、行列 m を右から乗じた行列 (Matrix クラス) を返します。

...を列ベクトル(行列)に変換して (実際には Matrix.column_vector(self) を適用) から、行列 m を右から乗じた行列 (Matrix クラス) を返します。

@
param m 右から乗算を行う行列
@
raise ExceptionForMatrix::ErrDimensionMismatch 次元が合わない場合に発...
...生します

=== 注意

引数の行列 m は自分自身を列ベクトルとした場合に乗算が定義できる行列である必要があります。

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

v = Vector[1, 2]
a = [4, 5, 6]
m = Matrix[a]

p v * m # => Matrix[[4, 5, 6], [8, 10, 12]]
//}...

Vector#*(other) -> Vector (18119.0)

self の各要素に数 other を乗じたベクトルを返します。

...じたベクトルを返します。

@
param other self の各要素に掛ける Numeric オブジェクトを指定します。

//emlist[例][ruby]{
require 'matrix'
a = [1, 2, 3.5, 100]
v1 = Vector.elements(a)
p v1.*(2) # => Vector[2, 4, 7.0, 200]
p v1.*(-1.5) # => Vector[-1.5, -3.0, -5.25,...

Matrix#hstack(*matrices) -> Matrix (133.0)

行列 self と matrices を横に並べた行列を生成します。

...ces を横に並べた行列を生成します。

Matrix
.hstack(self, *matrices) と同じです。

//emlist[例][ruby]{
require 'matrix'
x = Matrix[[1, 2], [3, 4]]
y = Matrix[[5, 6], [7, 8]]
x.hstack(y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]
//}

@
param matrices 並べる行列。すべての行...
...列の行数がselfの行数と一致していなければならない
@
raise ExceptionForMatrix::ErrDimensionMismatch 行数の異なる行列がある場合に発生します

@
see Matrix.hstack, Matrix#vstack...

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

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

...ができます。
*
:all - すべての要素(デフォルト)
*
:diagonal - 対角要素
*
:off_diagonal 対角要素以外
*
:lower 対角成分とそれより下側の部分
*
:upper対角成分とそれより上側の部分
*
:strict_lower 対角成分の下側
*
:strict_upper 対...
...][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#ma...

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

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

...ができます。
*
:all - すべての要素(デフォルト)
*
:diagonal - 対角要素
*
:off_diagonal 対角要素以外
*
:lower 対角成分とそれより下側の部分
*
:upper対角成分とそれより上側の部分
*
:strict_lower 対角成分の下側
*
:strict_upper 対...
...][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#ma...

絞り込み条件を変える

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

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

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

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

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

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

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

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

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

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

Matrix#lup -> Matrix::LUPDecomposition (39.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 (39.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...
<< 1 2 3 > >>