別のキーワード
ライブラリ
- matrix (20)
検索結果
先頭5件
-
Matrix
# *(m) -> Matrix | Vector (54307.0) -
self に行列またはベクトル m を右から乗じた行列を返します。
...を返します。
m が Vector オブジェクトなら返り値も Vector オブジェクトになります。
@param m 右からの乗算が定義可能な行列やベクトルを指定します。
@raise ExceptionForMatrix::ErrDimensionMismatch 次元が合わない場合に発生します... -
Matrix
# *(other) -> Matrix (54307.0) -
self の各成分に数 other を掛けた行列を返します。
self の各成分に数 other を掛けた行列を返します。
@param other self の各成分に掛ける Numeric オブジェクトを指定します。 -
Matrix
# **(n) -> Matrix (18307.0) -
self の n 乗を返します。
...self の n 乗を返します。
@param n べき数の指定
@raise ExceptionForMatrix::ErrNotRegular n が 0 以下で、行列が正則でない場合に発生します... -
Matrix
# combine(*matrices) {|*elements| . . . } -> Matrix (325.0) -
要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。
...要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。
Matrix.combine(self, *matrices) { ... } と同じです。
@see Matrix.combine... -
Matrix
# hstack(*matrices) -> Matrix (325.0) -
行列 self と matrices を横に並べた行列を生成します。
...self と matrices を横に並べた行列を生成します。
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 (133.0) -
行列の各要素を引数としてブロックを呼び出します。
...uby]{
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 (133.0) -
行列の各要素を引数としてブロックを呼び出します。
...uby]{
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
# eigen -> Matrix :: EigenvalueDecomposition (79.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 (79.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 (79.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 (79.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
# collect!(which = :all) -> Enumerator (25.0) -
行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
...詳細は、 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
# collect!(which = :all) {|element| . . . } -> self (25.0) -
行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
...詳細は、 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
# collect(which = :all) -> Enumerator (25.0) -
行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。
...Symbol の詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
p m.map(:diagonal) { |x| x * 10 } # => Matrix[[10, 2], [3, 40]]
//}
@see Matrix#each, Matrix#map!... -
Matrix
# collect(which = :all) {|x| . . . } -> Matrix (25.0) -
行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。
...Symbol の詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
p m.map(:diagonal) { |x| x * 10 } # => Matrix[[10, 2], [3, 40]]
//}
@see Matrix#each, Matrix#map!... -
Matrix
# map!(which = :all) -> Enumerator (25.0) -
行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
...詳細は、 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
# map!(which = :all) {|element| . . . } -> self (25.0) -
行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
...詳細は、 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
# map(which = :all) -> Enumerator (25.0) -
行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。
...Symbol の詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
p m.map(:diagonal) { |x| x * 10 } # => Matrix[[10, 2], [3, 40]]
//}
@see Matrix#each, Matrix#map!... -
Matrix
# map(which = :all) {|x| . . . } -> Matrix (25.0) -
行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。
...Symbol の詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
p m.map(:diagonal) { |x| x * 10 } # => Matrix[[10, 2], [3, 40]]
//}
@see Matrix#each, Matrix#map!... -
Matrix
# vstack -> Matrix (25.0) -
行列 self と matrices を縦に並べた行列を生成します。
...と matrices を縦に並べた行列を生成します。
Matrix.vstack(self, *matrices) と同じです。
//emlist[例][ruby]{
require 'matrix'
x = Matrix[[1, 2], [3, 4]]
y = Matrix[[5, 6], [7, 8]]
x.vstack(y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
//}
@see Matrix.vstack, Matrix#hstack...