るりまサーチ

最速Rubyリファレンスマニュアル検索!
521件ヒット [1-100件を表示] (0.097秒)

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

キーワード

検索結果

<< 1 2 3 ... > >>

Matrix#tr -> Integer | Float | Rational | Complex (30217.0)

トレース (trace) を返します。

...トレース (trace) を返します。

行列のトレース (trace) とは、対角要素の和です。

//emlist[例][ruby]{
require
'matrix'
Matrix
[[7,6], [3,9]].trace # => 16
//}

tr
ace は正方行列でのみ定義されます。

@
raise ExceptionForMatrix::ErrDimensionMismatch 行列が...

Matrix#entrywise_product(m) -> Matrix (18416.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]]
//}...

Matrix#trace -> Integer | Float | Rational | Complex (18217.0)

トレース (trace) を返します。

...トレース (trace) を返します。

行列のトレース (trace) とは、対角要素の和です。

//emlist[例][ruby]{
require
'matrix'
Matrix
[[7,6], [3,9]].trace # => 16
//}

tr
ace は正方行列でのみ定義されます。

@
raise ExceptionForMatrix::ErrDimensionMismatch 行列が...

Matrix#antisymmetric? -> bool (18216.0)

行列が反対称行列 (交代行列、歪〔わい〕対称行列とも) ならば true を返します。

... 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

Mat...
...rix[[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 (18216.0)

行列が反対称行列 (交代行列、歪〔わい〕対称行列とも) ならば true を返します。

... 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

Mat...
...rix[[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#hadamard_product(m) -> Matrix (15216.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]]
//}...

Matrix#hstack(*matrices) -> Matrix (9328.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#lup_decomposition -> Matrix::LUPDecomposition (9316.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#adjugate -> Matrix (9222.0)

余因子行列を返します。

...余因子行列を返します。

//emlist[例][ruby]{
require
'matrix'
Matrix
[[7,6],[3,9]].adjugate # => Matrix[[9, -6], [-3, 7]]
//}

@
raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方でない場合に発生します。
@
see Matrix#cofactor...

Matrix#collect(which = :all) {|x| ... } -> Matrix (9222.0)

行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。

...umerator を返します。

@
param which which に以下の Symbol を指定することで、
引数として使われる要素を限定できます。
デフォルトは、:all (全ての要素)です。
指定できる 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#eigensystem -> Matrix::EigenvalueDecomposition (9222.0)

行列の固有値と左右の固有ベクトルを保持したオブジェクトを返します。

...行列の固有値と左右の固有ベクトルを保持したオブジェクトを返します。

Matrix
::EigenvalueDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(右固有ベクトル、固有値行列、左固有ベクトル)
を得ることがで...
...mlist[例][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::Ei...
...genvalueDecomposition...
<< 1 2 3 ... > >>