別のキーワード
クラス
- Matrix (713)
-
Matrix
:: LUPDecomposition (12) - Vector (282)
キーワード
- * (24)
- [] (12)
- []= (21)
- adjugate (12)
-
angle
_ with (12) - antisymmetric? (7)
- coerce (12)
-
cofactor
_ expansion (12) - collect (48)
- collect! (28)
- collect2 (24)
- column (24)
-
column
_ vectors (12) - component (12)
- conj (12)
- conjugate (12)
- covector (12)
- det (12)
- determinant (12)
- each (24)
-
each
_ with _ index (24) - eigen (12)
- eigensystem (12)
- element (12)
-
elements
_ to _ f (12) -
elements
_ to _ i (12) -
elements
_ to _ r (12) -
entrywise
_ product (8) -
find
_ index (36) -
hadamard
_ product (8) - hstack (12)
- imag (12)
- imaginary (12)
- index (36)
- inspect (12)
- inv (12)
- inverse (12)
-
laplace
_ expansion (12) - lup (12)
-
lup
_ decomposition (12) - magnitude (12)
- map (48)
- map! (28)
- map2 (12)
- minor (24)
- norm (12)
- normalize (12)
- r (12)
- rank (12)
- real (12)
- real? (12)
- rect (12)
- rectangular (12)
- regular? (12)
- row (24)
-
row
_ vectors (12) -
skew
_ symmetric? (7) - solve (12)
-
to
_ a (24) -
to
_ s (24) - tr (12)
- trace (12)
- vstack (12)
検索結果
先頭5件
-
Matrix
# antisymmetric? -> bool (139.0) -
行列が反対称行列 (交代行列、歪〔わい〕対称行列とも) ならば true を返します。
...@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します
//emlist[][ruby]{
require 'matrix'
Matrix[[0, -2, Complex(1, 3)], [2, 0, 5], [-Complex(1, 3), -5, 0]].antisymmetric? # => true
Matrix.empty.antisymmetric? # => true
Matrix[[1, 2, 3], [4, 5, 6]......, [7, 8, 9]].antisymmetric? # => false
# 対角要素が違う
Matrix[[1, -2, 3], [2, 0, 6], [-3, -6, 0]].antisymmetric? # => false
# 符号が違う
Matrix[[0, 2, -3], [2, 0, 6], [-3, 6, 0]].antisymmetric? # => false
//}... -
Matrix
# skew _ symmetric? -> bool (139.0) -
行列が反対称行列 (交代行列、歪〔わい〕対称行列とも) ならば true を返します。
...@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します
//emlist[][ruby]{
require 'matrix'
Matrix[[0, -2, Complex(1, 3)], [2, 0, 5], [-Complex(1, 3), -5, 0]].antisymmetric? # => true
Matrix.empty.antisymmetric? # => true
Matrix[[1, 2, 3], [4, 5, 6]......, [7, 8, 9]].antisymmetric? # => false
# 対角要素が違う
Matrix[[1, -2, 3], [2, 0, 6], [-3, -6, 0]].antisymmetric? # => false
# 符号が違う
Matrix[[0, 2, -3], [2, 0, 6], [-3, 6, 0]].antisymmetric? # => false
//}... -
Vector
# collect -> Enumerator (139.0) -
ベクトルの各要素に対してブロックを評価した結果を、要素として持つベクトルを生成します。
...して持つベクトルを生成します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
a = [1, 2, 3.5, -10]
v1 = Vector.elements(a)
p v1 # => Vector[1, 2, 3.5, -10]
v2 = v1.map{|x|
x * -1
}
p v2 # => Vector[-1, -2, -3.5, 10]
//}... -
Vector
# collect {|x| . . . } -> Vector (139.0) -
ベクトルの各要素に対してブロックを評価した結果を、要素として持つベクトルを生成します。
...して持つベクトルを生成します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
a = [1, 2, 3.5, -10]
v1 = Vector.elements(a)
p v1 # => Vector[1, 2, 3.5, -10]
v2 = v1.map{|x|
x * -1
}
p v2 # => Vector[-1, -2, -3.5, 10]
//}... -
Vector
# map -> Enumerator (139.0) -
ベクトルの各要素に対してブロックを評価した結果を、要素として持つベクトルを生成します。
...して持つベクトルを生成します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
a = [1, 2, 3.5, -10]
v1 = Vector.elements(a)
p v1 # => Vector[1, 2, 3.5, -10]
v2 = v1.map{|x|
x * -1
}
p v2 # => Vector[-1, -2, -3.5, 10]
//}... -
Vector
# map {|x| . . . } -> Vector (139.0) -
ベクトルの各要素に対してブロックを評価した結果を、要素として持つベクトルを生成します。
...して持つベクトルを生成します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
a = [1, 2, 3.5, -10]
v1 = Vector.elements(a)
p v1 # => Vector[1, 2, 3.5, -10]
v2 = v1.map{|x|
x * -1
}
p v2 # => Vector[-1, -2, -3.5, 10]
//}... -
Matrix
# regular? -> bool (133.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 行列が正方行列でない場合に発生します... -
Vector
# *(other) -> Vector (128.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, -150.0]
//}... -
Matrix
# column(j) -> Vector | nil (127.0) -
j 番目の列を Vector オブジェクトで返します。 j 番目の列が存在しない場合は nil を返します。 ブロックが与えられた場合はその列の各要素についてブロックを繰り返します。
...ックスと見倣します。末尾の列が -1 番目になります。
//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(1) # => Vector[2, 15, -2]
cnt = 0
m.column(-1) { |x|
cnt = cnt + x
}
p cnt # => 24.5
//}... -
Matrix
# column(j) {|x| . . . } -> self (127.0) -
j 番目の列を Vector オブジェクトで返します。 j 番目の列が存在しない場合は nil を返します。 ブロックが与えられた場合はその列の各要素についてブロックを繰り返します。
...ックスと見倣します。末尾の列が -1 番目になります。
//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(1) # => Vector[2, 15, -2]
cnt = 0
m.column(-1) { |x|
cnt = cnt + x
}
p cnt # => 24.5
//}...