別のキーワード
種類
- インスタンスメソッド (29)
- 特異メソッド (6)
クラス
- Matrix (24)
-
Matrix
:: LUPDecomposition (2) - Vector (9)
キーワード
- == (2)
- [] (1)
- basis (1)
- build (2)
-
cofactor
_ expansion (1) - combine (3)
- component (1)
- diagonal? (1)
- element (1)
- empty? (1)
- eql? (2)
- hermitian? (1)
- independent? (2)
-
laplace
_ expansion (1) -
lower
_ triangular? (1) - normal? (1)
- orthogonal? (1)
- permutation? (1)
- real? (1)
- regular? (1)
- singular? (2)
- solve (1)
- square? (1)
- symmetric? (1)
- unitary? (1)
-
upper
_ triangular? (1) - zero? (2)
検索結果
先頭5件
-
Matrix
. combine(*matrices) -> Enumerator (18343.0) -
要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。
...ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。
//emlist[例][ruby]{
require 'matrix'
x = Matrix[[6, 6], [4, 4]]
y = Matrix[[1, 2], [3, 4]]
Matrix.combine(x, y) {|a, b| a - b} # => Matrix[[5, 4], [1, 0]]
//}
@param matrices 並べる行列。すべて......の行列の行数と列数が一致していなければならない
@raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します
@see Matrix#combine... -
Matrix
. combine(*matrices) {|*elements| . . . } -> Matrix (18343.0) -
要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。
...ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。
//emlist[例][ruby]{
require 'matrix'
x = Matrix[[6, 6], [4, 4]]
y = Matrix[[1, 2], [3, 4]]
Matrix.combine(x, y) {|a, b| a - b} # => Matrix[[5, 4], [1, 0]]
//}
@param matrices 並べる行列。すべて......の行列の行数と列数が一致していなければならない
@raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します
@see Matrix#combine... -
Matrix
# combine(*matrices) {|*elements| . . . } -> Matrix (18307.0) -
要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。
...要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。
Matrix.combine(self, *matrices) { ... } と同じです。
@see Matrix.combine... -
Matrix
. build(row _ size , column _ size = row _ size) -> Enumerable (18307.0) -
row_size×column_sizeの行列をブロックの返り値から生成します。
...した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
m = Matrix.build(2, 4) {|row, col| col - row }
# => Matrix[[0, 1, 2, 3], [-1, 0, 1, 2]]
m = Matrix.build(3) { rand }
# => a 3x3 matrix with random elements
//}
@param row_size 行列の行数
@param column_size... -
Matrix
. build(row _ size , column _ size = row _ size) {|row , col| . . . } -> Matrix (18307.0) -
row_size×column_sizeの行列をブロックの返り値から生成します。
...した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
m = Matrix.build(2, 4) {|row, col| col - row }
# => Matrix[[0, 1, 2, 3], [-1, 0, 1, 2]]
m = Matrix.build(3) { rand }
# => a 3x3 matrix with random elements
//}
@param row_size 行列の行数
@param column_size... -
Vector
. basis(size: , index:) -> Vector (18307.0) -
size 次元ベクトル空間の index 番目の標準基底を返します。
...size 次元ベクトル空間の index 番目の標準基底を返します。
//emlist[例][ruby]{
require 'matrix'
Vector.basis(size: 3, index: 1) # => Vector[0, 1, 0]
//}
@param size ベクトルの次元
@param index 標準基底の何番目か。0 origin... -
Matrix
:: LUPDecomposition # solve(b) -> Vector | Matrix (442.0) -
self が正方行列 A の LUP 分解の時、一次方程式 Ax = b の解を返します。 b には Vector, Matrix, 数値の配列を指定出来ます。
...self が正方行列 A の LUP 分解の時、一次方程式 Ax = b の解を返します。
b には Vector, Matrix, 数値の配列を指定出来ます。
それぞれベクトルのサイズ、行列の行数、配列のサイズが A の列数と一致していなければなりません。......指定します。
//emlist[][ruby]{
require 'matrix'
lup = Matrix[[2, 1], [1, 2]].lup
lup.solve([1, -1]) #=> Vector[(1/1), (-1/1)]
lup.solve(Vector[3, 0]) #=> Vector[(2/1), (-1/1)]
lup.solve(Matrix[[1, 3], [-1, 0]]) #=> Matrix[[(1/1), (2/1)], [(-1/1), (-1/1)]]
//}... -
Matrix
# ==(other) -> bool (307.0) -
自分自身と other を比較し、同値であれば真(true)を返します。
自分自身と other を比較し、同値であれば真(true)を返します。
@param other 比較対象のオブジェクト -
Matrix
# cofactor _ expansion(row: nil , column: nil) -> object | Integer | Rational | Float (307.0) -
row 行、もしくは column 列に関するラプラス展開をする。
...けです。かわりにMatrix#determinant を
利用すべきです。
変則的な形状の行列に対してはそれ以上の意味を持ちます。例えば
row行/column列が行列やベクトルである場合には
//emlist[例][ruby]{
require 'matrix'
# Matrix[[7,6], [3,9]].laplace_expa......=> 45
Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(row: 0) # => Vector[3, -2]
//}
@param row 行
@param column 列
@raise ArgumentError row と column を両方指定した、もしくは両方とも指定していない、場合に発生します
@raise ExceptionForMatrix::ErrD......imensionMismatch 行列が正方でない場合に発生します
@see Matrix#cofactor... -
Matrix
# diagonal? -> bool (307.0) -
行列が対角行列ならば true を返します。
...行列が対角行列ならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# empty? -> bool (307.0) -
行列が要素を持たないならば true を返します。
...行列が要素を持たないならば true を返します。
要素を持たないとは、行数か列数のいずれかが0であることを意味します。
@see Matrix.empty... -
Matrix
# eql?(other) -> bool (307.0) -
自分自身と other を比較し、同値であれば真(true)を返します。
自分自身と other を比較し、同値であれば真(true)を返します。
@param other 比較対象のオブジェクト -
Matrix
# hermitian? -> bool (307.0) -
行列がエルミートならば true を返します。
...行列がエルミートならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# laplace _ expansion(row: nil , column: nil) -> object | Integer | Rational | Float (307.0) -
row 行、もしくは column 列に関するラプラス展開をする。
...けです。かわりにMatrix#determinant を
利用すべきです。
変則的な形状の行列に対してはそれ以上の意味を持ちます。例えば
row行/column列が行列やベクトルである場合には
//emlist[例][ruby]{
require 'matrix'
# Matrix[[7,6], [3,9]].laplace_expa......=> 45
Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(row: 0) # => Vector[3, -2]
//}
@param row 行
@param column 列
@raise ArgumentError row と column を両方指定した、もしくは両方とも指定していない、場合に発生します
@raise ExceptionForMatrix::ErrD......imensionMismatch 行列が正方でない場合に発生します
@see Matrix#cofactor... -
Matrix
# lower _ triangular? -> bool (307.0) -
行列が下三角行列ならば true を返します。
行列が下三角行列ならば true を返します。 -
Matrix
# normal? -> bool (307.0) -
行列が正規行列ならば true を返します。
...行列が正規行列ならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# orthogonal? -> bool (307.0) -
行列が直交行列ならば true を返します。
...行列が直交行列ならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# permutation? -> bool (307.0) -
行列が置換行列ならば true を返します。
...行列が置換行列ならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# real? -> bool (307.0) -
行列の全要素が実(Numeric#real?)であれば true を返します。
...が0でも偽を返します。
//emlist[例][ruby]{
require 'matrix'
Matrix[[1, 0], [0, 1]].real? # => true
Matrix[[Complex(0, 1), 0], [0, 1]].real? # => false
# 要素が実数であっても Complex オブジェクトなら偽を返す。
Matrix[[Complex(1, 0), 0], [0, 1]].real? # => false
//}... -
Matrix
# regular? -> bool (307.0) -
行列が正方で正則なら true を、特異なら false を返します。
...例外 ExceptionForMatrix::ErrDimensionMismatch を
発生させます。
//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.re......gular? # => 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
# singular? -> bool (307.0) -
行列が正方で特異なら true を、正則なら false を返します。
...るとは、正則でないことです。
行列式が0であること同値です。
正方行列でない場合には例外 ExceptionForMatrix::ErrDimensionMismatch を
発生させます。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# square? -> bool (307.0) -
正方行列であるなら、 true を返します。
正方行列であるなら、 true を返します。 -
Matrix
# symmetric? -> bool (307.0) -
行列が対称ならば true を返します。
...行列が対称ならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# unitary? -> bool (307.0) -
行列がユニタリならば true を返します。
...行列がユニタリならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# upper _ triangular? -> bool (307.0) -
行列が上三角行列ならば true を返します。
行列が上三角行列ならば true を返します。 -
Matrix
# zero? -> bool (307.0) -
行列が零行列ならば true を返します。
行列が零行列ならば true を返します。 -
Matrix
:: LUPDecomposition # singular? -> bool (307.0) -
元の行列が正方で特異なら true を、正則なら false を返します。 LUP 分解の結果を利用して判定します。
...元の行列が正方で特異なら true を、正則なら false を返します。
LUP 分解の結果を利用して判定します。
@see Matrix#singular?... -
Vector
# ==(v) -> bool (307.0) -
自分自身と引数 v を比較し、true/false を返します。
自分自身と引数 v を比較し、true/false を返します。
@param v 比較対象ベクトル -
Vector
# [](i) -> object | nil (307.0) -
i 番目の要素を返します。インデックスは 0 から開始します。 要素が存在しないインデックスを指定した時には nil を返します。
i 番目の要素を返します。インデックスは 0 から開始します。
要素が存在しないインデックスを指定した時には nil を返します。
@param i 取得する要素のインデックスを整数値で指定します。
インデックスは 0 から始めます。 -
Vector
# component(i) -> object | nil (307.0) -
i 番目の要素を返します。インデックスは 0 から開始します。 要素が存在しないインデックスを指定した時には nil を返します。
i 番目の要素を返します。インデックスは 0 から開始します。
要素が存在しないインデックスを指定した時には nil を返します。
@param i 取得する要素のインデックスを整数値で指定します。
インデックスは 0 から始めます。 -
Vector
# element(i) -> object | nil (307.0) -
i 番目の要素を返します。インデックスは 0 から開始します。 要素が存在しないインデックスを指定した時には nil を返します。
i 番目の要素を返します。インデックスは 0 から開始します。
要素が存在しないインデックスを指定した時には nil を返します。
@param i 取得する要素のインデックスを整数値で指定します。
インデックスは 0 から始めます。 -
Vector
# eql?(v) -> bool (307.0) -
自分自身と引数 v を比較し、true/false を返します。
自分自身と引数 v を比較し、true/false を返します。
@param v 比較対象ベクトル -
Vector
# independent?(*vectors) -> bool (307.0) -
self とベクトルの列 vectors が線形独立であれば true を返します。
...self とベクトルの列 vectors が線形独立であれば true を返します。
require 'matrix'
Vector.independent?(self, *vectors)
と同じです。
@param vectors 線形独立性を判定するベクトル列... -
Vector
# zero? -> bool (307.0) -
すべての要素がゼロであれば true を返します。
すべての要素がゼロであれば true を返します。 -
Vector
. independent?(*vectors) -> bool (307.0) -
ベクトルの列 vectors が線形独立であれば true を返します。
ベクトルの列 vectors が線形独立であれば true を返します。
@param vectors 線形独立性を判定するベクトル列