るりまサーチ

最速Rubyリファレンスマニュアル検索!
288件ヒット [1-100件を表示] (0.025秒)
トップページ > ライブラリ:matrix[x] > クエリ:matrix[x] > クラス:Matrix[x] > クエリ:-[x] > クエリ:column[x]

別のキーワード

  1. matrix collect
  2. matrix each
  3. matrix index
  4. matrix []
  5. matrix *

キーワード

検索結果

<< 1 2 3 > >>

Matrix#column(j) -> Vector | nil (35247.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 (35247.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#-(m) -> Matrix (35220.0)

self から行列mを減算した行列を返します。 self の column_size が 1 なら Vector オブジェクトも指定出来ます。

...行列mを減算した行列を返します。
self の column_size が 1 なら Vector オブジェクトも指定出来ます。

@param m 減算する行列。減算可能な行列やベクトルを指定します。

@raise ExceptionForMatrix::ErrDimensionMismatch 次元が合わない場合に...

Matrix.columns(columns) -> Matrix (23512.0)

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

...引数 columns を列ベクトルの集合とする行列を生成します。

@param columns 配列の配列を渡します。

=== 注意

Matrix
.rows との違いは引数として渡す配列の配列を列ベクトルの配列とみなして行列を生成します。

//emlist[例][ruby]{
re...
...quire 'matrix'

a1 = [1, 2, 3]
a2 = [4, 5, 6]
a3 = [-1, -2, -3]

# 配列を行ベクトルとして生成
m = Matrix.rows([a1, a2, a3], true)
p m # => Matrix[[1, 2, 3], [4, 5, 6], [-1, -2, -3]]
# 行列としてのイメージ => [ 1, 2, 3]
# [ 4, 5, 6]
#...
...[-1, -2, -3]

# 配列を列ベクトルとして生成
m = Matrix.columns([a1, a2, a3])
p m # => Matrix[[1, 4, -1], [2, 5, -2], [3, 6, -3]]
# 行列としてのイメージ => [1, 4, -1]
# [2, 5, -2]
# [3, 6, -3]
//}...

Matrix.column_vector(column) -> Matrix (23428.0)

要素がcolumnの(n,1)型の行列(列ベクトル)を生成します。

...要素がcolumnの(n,1)型の行列(列ベクトル)を生成します。

@param column (n,1)型の行列として生成するVector Array オブジェクト...

絞り込み条件を変える

Matrix#column_vectors -> [Vector] (23240.0)

自分自身を列ベクトルの配列として返します。

...自分自身を列ベクトルの配列として返します。

//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_vectors # => [Vector[1, 10, -1], Vector[2, 15, -2], Vector[3, 20, 1.5]]
//}...

Matrix#column_count -> Integer (23205.0)

行列の列数を返します。

行列の列数を返します。

Matrix#column_size -> Integer (23205.0)

行列の列数を返します。

行列の列数を返します。

Matrix.build(row_size, column_size = row_size) {|row, col| ... } -> Matrix (17364.0)

row_size×column_sizeの行列をブロックの返り値から生成します。

...ize×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 行列の列数...
<< 1 2 3 > >>