355件ヒット
[201-300件を表示]
(0.123秒)
ライブラリ
- matrix (355)
検索結果
先頭5件
-
Matrix
# *(m) -> Matrix | Vector (3133.0) -
self に行列またはベクトル m を右から乗じた行列を返します。
...
self に行列またはベクトル m を右から乗じた行列を返します。
m が Vector オブジェクトなら返り値も Vector オブジェクトになります。
@param m 右からの乗算が定義可能な行列やベクトルを指定します。
@raise ExceptionForMatrix::Err......DimensionMismatch 次元が合わない場合に発生します... -
Matrix
# *(other) -> Matrix (3133.0) -
self の各成分に数 other を掛けた行列を返します。
...
self の各成分に数 other を掛けた行列を返します。
@param other self の各成分に掛ける Numeric オブジェクトを指定します。... -
Matrix
# **(n) -> Matrix (3130.0) -
self の n 乗を返します。
...
self の n 乗を返します。
@param n べき数の指定
@raise ExceptionForMatrix::ErrNotRegular n が 0 以下で、行列が正則でない場合に発生します... -
Matrix
# coerce(other) -> Array (3120.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
# eigen -> Matrix :: EigenvalueDecomposition (3120.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
# map!(which = :all) -> Enumerator (3116.0) -
行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
...り返した結果で要素を置き換えます。
ブロックのない場合は、自身と map! から生成した Enumerator オブジェクトを返します。
@param which which に以下の Symbol を指定することで、
引数として使われる要素を限定でき......詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map! { |element| element * 10 } #=> Matrix[[10, 20], [30, 40]]
p m #=> Matrix[[10, 20], [30, 40]]
//}
@see Matrix#each, Matrix#map... -
Matrix
# each(which = :all) -> Enumerator (3115.0) -
行列の各要素を引数としてブロックを呼び出します。
...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).t......o_a # => [3]
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#map... -
Matrix
# each(which = :all) {|e| . . . } -> self (3115.0) -
行列の各要素を引数としてブロックを呼び出します。
...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).t......o_a # => [3]
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#map... -
Matrix
# lup -> Matrix :: LUPDecomposition (3114.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...