るりまサーチ

最速Rubyリファレンスマニュアル検索!
160件ヒット [101-160件を表示] (0.033秒)
トップページ > クエリ:ruby[x] > クエリ:Ruby[x] > クラス:Matrix[x] > ライブラリ:matrix[x] > 種類:特異メソッド[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

キーワード

検索結果

<< < 1 2 >>

Matrix.empty(row_size=0, column_size=0) -> Matrix (16.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...

Matrix.hstack(*matrices) -> Matrix (16.0)

行列 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::ErrDimension...
...Mismatch 行数の異なる行列がある場合に発生します
@see Matrix.vstack, Matrix#hstack...

Matrix.rows(rows, copy = true) -> Matrix (16.0)

引数 rows を行ベクトルの列とする行列を生成します。

...行いません。

//emlist[例][ruby]{
require 'matrix'

a1 = [1, 2, 3]
a2 = [10, 15, 20]

m = Matrix.rows([a1, a2], false) # 配列を複製せずに行列を生成
p m # => Matrix[[1, 2, 3], [10, 15, 20]]
a2[1] = 1000 # 配列のデータを変更
p m # => Matrix[[1, 2, 3], [10, 1000, 20]]
//}...

Matrix.scalar(n, value) -> Matrix (16.0)

対角要素が全てvalue(数)で、非対角要素が全て0であるようなn次の正方行列を生成します。

...角要素が全て0であるようなn次の正方行列を生成します。

@param n 生成する行列の次元
@param value 生成する行列の対角要素の値


//emlist[例][ruby]{
require 'matrix'

m = Matrix.scalar(3, 2.5)
p m # => Matrix[[2.5, 0, 0], [0, 2.5, 0], [0, 0, 2.5]]
//}...

Matrix.vstack(*matrices) -> Matrix (16.0)

行列 matrices を縦に並べた行列を生成します。

...emlist[例][ruby]{
require 'matrix'
x = Matrix[[1, 2], [3, 4]]
y = Matrix[[5, 6], [7, 8]]
Matrix
.vstack(x, y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
//}

@param matrices 並べる行列。すべての行列の列数が一致していなければならない
@raise ExceptionForMatrix::ErrDimensi...
...onMismatch 列数の異なる行列がある場合に発生します
@see Matrix.hstack, Matrix#vstack...

絞り込み条件を変える

<< < 1 2 >>