るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Matrix#column(j) -> Vector | nil (21220.0)

j 番目の列を Vector オブジェクトで返します。 j 番目の列が存在しない場合は nil を返します。 ブロックが与えられた場合はその列の各要素についてブロックを繰り返します。

...j 番目の列を Vector オブジェクトで返します。
j 番目の列が存在しない場合は nil を返します。
ブロックが与えられた場合はその列の各要素についてブロックを繰り返します。


@param j 列の位置を指定します。
先頭の...
...ックスと見倣します。末尾の列が -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 (21120.0)

j 番目の列を Vector オブジェクトで返します。 j 番目の列が存在しない場合は nil を返します。 ブロックが与えられた場合はその列の各要素についてブロックを繰り返します。

...j 番目の列を Vector オブジェクトで返します。
j 番目の列が存在しない場合は nil を返します。
ブロックが与えられた場合はその列の各要素についてブロックを繰り返します。


@param j 列の位置を指定します。
先頭の...
...ックスと見倣します。末尾の列が -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
//}...

RubyVM::AbstractSyntaxTree::Node#first_column -> Integer (18213.0)

ソースコード中で、self を表すテキストが最初に現れる列番号を返します。

...ソースコード中で、self を表すテキストが最初に現れる列番号を返します。

列番号は0-originで、バイト単位で表されます。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_column # => 0
//}...

RubyVM::AbstractSyntaxTree::Node#last_column -> Integer (18213.0)

ソースコード中で、self を表すテキストが最後に現れる列番号を返します。

...ソースコード中で、self を表すテキストが最後に現れる列番号を返します。

列番号は0-originで、バイト単位で表されます。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.last_column # => 5
//}...

Matrix#column_vectors -> [Vector] (12313.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.columns(columns) -> Matrix (9306.0)

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

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

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

=== 注意

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

//emlist[例][ruby]{
req...
...uire '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#cofactor_expansion(row: nil, column: nil) -> object | Integer | Rational | Float (6248.0)

row 行、もしくは column 列に関するラプラス展開をする。

...row 行、もしくは column 列に関するラプラス展開をする。

通常の行列に対してはこれは単に固有値を計算するだけです。かわりにMatrix#determinant
利用すべきです。

変則的な形状の行列に対してはそれ以上の意味を持ちま...
...場合には

//emlist[例][ruby]{
require 'matrix'
# Matrix[[7,6], [3,9]].laplace_expansion(column: 1) # => 45
Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(row: 0) # => Vector[3, -2]
//}

@param row 行
@param column
@raise ArgumentError row と column を両方指定した...
...、もしくは両方とも指定していない、場合に発生します
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方でない場合に発生します
@see Matrix#cofactor...

CSV::Table#delete_if {|column_name, values| ... } -> self (6225.0)

ブロックを評価した結果が真である行か列を削除します。

...ist[例 ロウモード][ruby]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "valid"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "invalid"])
row3 = CSV::Row.new(["header1", "header2"], ["row3_1", "valid"])
t
able = CSV::Table.new([row1, row2, row3])
t
able.delete_...
..." }
t
able.to_a # => [["header1", "header2"], ["row1_1", "valid"], ["row3_1", "valid"]]
//}

//emlist[例 カラムモード][ruby]{
require "csv"
row1 = CSV::Row.new(["id", "name"], [1, "tanaka"])
row2 = CSV::Row.new(["id", "name"], [2, "suzuki"])
row3 = CSV::Row.new(["id", "name"], [3, "sato"])
t
ab...
...le = CSV::Table.new([row1, row2, row3])
t
able.by_col!
t
able.delete_if { |column_name, values| column_name == "id" }
t
able.to_a # => [["name"], ["tanaka"], ["suzuki"], ["sato"]]
//}

@see CSV::Table#delete...

Matrix.empty(row_size=0, column_size=0) -> Matrix (6225.0)

要素を持たない行列を返します。

...とです。

row_size 、 column_size のいずれか一方は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_size 行列の列数
@raise ArgumentError row_size, column_size が両方とも0でない場合に発生します...

CSV::Table#delete_if {|row| ... } -> self (6125.0)

ブロックを評価した結果が真である行か列を削除します。

...ist[例 ロウモード][ruby]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "valid"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "invalid"])
row3 = CSV::Row.new(["header1", "header2"], ["row3_1", "valid"])
t
able = CSV::Table.new([row1, row2, row3])
t
able.delete_...
..." }
t
able.to_a # => [["header1", "header2"], ["row1_1", "valid"], ["row3_1", "valid"]]
//}

//emlist[例 カラムモード][ruby]{
require "csv"
row1 = CSV::Row.new(["id", "name"], [1, "tanaka"])
row2 = CSV::Row.new(["id", "name"], [2, "suzuki"])
row3 = CSV::Row.new(["id", "name"], [3, "sato"])
t
ab...
...le = CSV::Table.new([row1, row2, row3])
t
able.by_col!
t
able.delete_if { |column_name, values| column_name == "id" }
t
able.to_a # => [["name"], ["tanaka"], ["suzuki"], ["sato"]]
//}

@see CSV::Table#delete...

絞り込み条件を変える

<< 1 2 3 ... > >>