種類
- インスタンスメソッド (13)
- 特異メソッド (4)
検索結果
先頭5件
-
Vector
# size -> Integer (78310.0) -
ベクトルの要素数(次元)を返します。
ベクトルの要素数(次元)を返します。 -
Matrix
# column _ size -> Integer (60310.0) -
行列の列数を返します。
行列の列数を返します。 -
Matrix
# row _ size -> Integer (60310.0) -
行列の行数を返します。
行列の行数を返します。 -
Matrix
. build(row _ size , column _ size = row _ size) {|row , col| . . . } -> Matrix (52450.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) -> Enumerable (52150.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
. empty(row _ size=0 , column _ size=0) -> Matrix (52132.0) -
要素を持たない行列を返します。
...一方は0である必要があります。
//emlist[例][ruby]{
require 'matrix'
m = Matrix.empty(2, 0)
m == Matrix[ [], [] ]
# => true
n = Matrix.empty(0, 3)
n == Matrix.columns([ [], [], [] ])
# => true
m * n
# => Matrix[[0, 0, 0], [0, 0, 0]]
//}
@param row_size 行列の行数
@param column_si... -
Matrix
# minor(from _ row , row _ size , from _ col , col _ size) -> Matrix (52009.0) -
selfの部分行列を返します。
...ram col_size 部分行列の列サイズ
//emlist[例][ruby]{
require 'matrix'
a1 = [ 1, 2, 3, 4, 5]
a2 = [11, 12, 13, 14, 15]
a3 = [21, 22, 23, 24, 25]
a4 = [31, 32, 33, 34, 35]
a5 = [51, 52, 53, 54, 55]
m = Matrix[a1, a2, a3, a4, a5]
p m.minor(0, 2, 1, 2) # => Matrix[[2, 3], [12, 13]]
//}... -
Matrix
# minor(from _ row . . to _ row , from _ col . . to _ col) -> Matrix (51409.0) -
selfの部分行列を返します。
...ram col_size 部分行列の列サイズ
//emlist[例][ruby]{
require 'matrix'
a1 = [ 1, 2, 3, 4, 5]
a2 = [11, 12, 13, 14, 15]
a3 = [21, 22, 23, 24, 25]
a4 = [31, 32, 33, 34, 35]
a5 = [51, 52, 53, 54, 55]
m = Matrix[a1, a2, a3, a4, a5]
p m.minor(0, 2, 1, 2) # => Matrix[[2, 3], [12, 13]]
//}... -
Matrix
# +(m) -> Matrix (51358.0) -
self に行列 m を加算した行列を返します。 self の column_size が 1 なら Vector オブジェクトも指定出来ます。
...した行列を返します。
self の column_size が 1 なら Vector オブジェクトも指定出来ます。
@param m 加算する行列。加算可能な行列やベクトルを指定します。
@raise ExceptionForMatrix::ErrDimensionMismatch 次元が合わない場合に発生します... -
Matrix
# -(m) -> Matrix (51358.0) -
self から行列mを減算した行列を返します。 self の column_size が 1 なら Vector オブジェクトも指定出来ます。
...した行列を返します。
self の column_size が 1 なら Vector オブジェクトも指定出来ます。
@param m 減算する行列。減算可能な行列やベクトルを指定します。
@raise ExceptionForMatrix::ErrDimensionMismatch 次元が合わない場合に発生します... -
Matrix
# column _ count -> Integer (51010.0) -
行列の列数を返します。
行列の列数を返します。 -
Matrix
# row _ count -> Integer (51010.0) -
行列の行数を返します。
行列の行数を返します。 -
Vector
. basis(size: , index:) -> Vector (24412.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... -
Vector
# +(v) -> Vector | Matrix (24364.0) -
self にベクトル v を加えたベクトルを返します。
...には column_size が 1 の Matrix オブジェクトも指定できます。
その場合は返り値も Matrix オブジェクトになります。
@param v 加算するベクトル。加算可能な行列やベクトルを指定します。
@raise ExceptionForMatrix::ErrDimensionMismatch 自... -
Vector
# -(v) -> Vector | Matrix (24364.0) -
self からベクトル v を減じたベクトルを返します。
...には column_size が 1 の Matrix オブジェクトも指定できます。
その場合は返り値も Matrix オブジェクトになります。
@param v 減算するベクトル。減算可能な行列やベクトルを指定します。
@raise ExceptionForMatrix::ErrDimensionMismatch 自... -
Vector
# each2(v) -> Enumerator (24025.0) -
ベクトルの各要素と、それに対応するインデックスを持つ引数 v の要素との組に対して (2引数の) ブロックを繰返し評価します。
...ロックを省略した場合は Enumerator を返します。
@param v 各要素と組を取るためのオブジェクト
@raise ExceptionForMatrix::ErrDimensionMismatch 自分自身と引数のベクト
ルの要素の数(次元)が異なっていたときに発生します。
@see Array... -
Vector
# each2(v) {|x , y| . . . } -> self (24025.0) -
ベクトルの各要素と、それに対応するインデックスを持つ引数 v の要素との組に対して (2引数の) ブロックを繰返し評価します。
...ロックを省略した場合は Enumerator を返します。
@param v 各要素と組を取るためのオブジェクト
@raise ExceptionForMatrix::ErrDimensionMismatch 自分自身と引数のベクト
ルの要素の数(次元)が異なっていたときに発生します。
@see Array...