209件ヒット
[1-100件を表示]
(0.200秒)
種類
- インスタンスメソッド (198)
- 特異メソッド (11)
ライブラリ
- matrix (209)
キーワード
- * (11)
-
/ (11) - == (11)
- coerce (11)
- collect (12)
- collect! (12)
- each (22)
-
each
_ with _ index (22) - eql? (11)
-
hadamard
_ product (7) - hash (11)
- hermitian? (11)
- hstack (22)
- map (12)
- map! (12)
- orthogonal? (11)
検索結果
先頭5件
-
Matrix
# each _ with _ index(which = :all) -> Enumerator (18301.0) -
行列の各要素をその位置とともに引数としてブロックを呼び出します。
...。
which で処理する要素の範囲を指定することができます。
Matrix#each と同じなのでそちらを参照してください。
ブロックを省略した場合、 Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each_with_index do......|e, row, col|
puts "#{e} at #{row}, #{col}"
end
# => 1 at 0, 0
# => 2 at 0, 1
# => 3 at 1, 0
# => 4 at 1, 1
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each... -
Matrix
# each _ with _ index(which = :all) {|e , row , col| . . . } -> self (18301.0) -
行列の各要素をその位置とともに引数としてブロックを呼び出します。
...。
which で処理する要素の範囲を指定することができます。
Matrix#each と同じなのでそちらを参照してください。
ブロックを省略した場合、 Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each_with_index do......|e, row, col|
puts "#{e} at #{row}, #{col}"
end
# => 1 at 0, 0
# => 2 at 0, 1
# => 3 at 1, 0
# => 4 at 1, 1
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each... -
Matrix
# hermitian? -> bool (12201.0) -
行列がエルミートならば true を返します。
...行列がエルミートならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# each(which = :all) -> Enumerator (9201.0) -
行列の各要素を引数としてブロックを呼び出します。
...、…という順番で処理します。
which に以下の Symbol を指定することで
引数として使われる要素を限定することができます。
* :all - すべての要素(デフォルト)
* :diagonal - 対角要素
* :off_diagonal 対角要素以外
* :lower 対角成......* :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_lowe......r).to_a # => [3]
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#map... -
Matrix
# each(which = :all) {|e| . . . } -> self (9201.0) -
行列の各要素を引数としてブロックを呼び出します。
...、…という順番で処理します。
which に以下の Symbol を指定することで
引数として使われる要素を限定することができます。
* :all - すべての要素(デフォルト)
* :diagonal - 対角要素
* :off_diagonal 対角要素以外
* :lower 対角成......* :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_lowe......r).to_a # => [3]
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#map... -
Matrix
# hash -> Integer (9201.0) -
行列のHash値を返します。
...行列のHash値を返します。... -
Matrix
# hstack(*matrices) -> Matrix (9201.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
. hstack(*matrices) -> Matrix (9201.0) -
行列 matrices を横に並べた行列を生成します。
...行列 matrices を横に並べた行列を生成します。
//emlist[例][ruby]{
require 'matrix'
x = Matrix[[1, 2], [3, 4]]
y = Matrix[[5, 6], [7, 8]]
Matrix.hstack(x, y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]
//}
@param matrices 並べる行列。すべての行列の行数が一致してい......なければならない
@raise ExceptionForMatrix::ErrDimensionMismatch 行数の異なる行列がある場合に発生します
@see Matrix.vstack, Matrix#hstack... -
Matrix
# orthogonal? -> bool (9101.0) -
行列が直交行列ならば true を返します。
...行列が直交行列ならば true を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方行列でない場合に発生します... -
Matrix
# hadamard _ product(m) -> Matrix (6201.0) -
アダマール積(要素ごとの積)を返します。
...ダマール積(要素ごとの積)を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します。
//emlist[例][ruby]{
require 'matrix'
Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) # => Matrix[[1, 4], [9, 8]]
//}...