るりまサーチ

最速Rubyリファレンスマニュアル検索!
339件ヒット [201-300件を表示] (0.045秒)

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. bodytypebasic param
  4. win32ole_param new
  5. win32ole_param name

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 > >>

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

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

...返します。

@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#column(j) -> Vector | nil (20.0)

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

...します。


@param j 列の位置を指定します。
先頭の列が 0 番目になります。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 (20.0)

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

...します。


@param j 列の位置を指定します。
先頭の列が 0 番目になります。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#each(which = :all) -> Enumerator (20.0)

行列の各要素を引数としてブロックを呼び出します。

...][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_lower).to_a # => [3]
//}

@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#ma...

Matrix#each(which = :all) {|e| ... } -> self (20.0)

行列の各要素を引数としてブロックを呼び出します。

...][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_lower).to_a # => [3]
//}

@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#ma...

絞り込み条件を変える

Matrix#each_with_index(which = :all) -> Enumerator (20.0)

行列の各要素をその位置とともに引数としてブロックを呼び出します。

...る要素の範囲を指定することができます。
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 (20.0)

行列の各要素をその位置とともに引数としてブロックを呼び出します。

...る要素の範囲を指定することができます。
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#hstack(*matrices) -> Matrix (20.0)

行列 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#map!(which = :all) -> Enumerator (20.0)

行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。

...返します。

@param which which に以下の Symbol を指定することで、
引数として使われる要素を限定できます。
デフォルトは、:all (全ての要素)です。
指定できる Symbol の詳細は、 Matrix#each の項目...
...を参照して下さい。


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

m = Matrix[[1, 2], [3, 4]]

p m.map! { |element| element * 10 } #=> Matrix[[10, 20], [30, 40]]
p m #=> Matrix[[10, 20], [30, 40]]
//}

@see Matrix#each, Matrix#map...

Matrix#map!(which = :all) {|element| ... } -> self (20.0)

行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。

...返します。

@param which which に以下の Symbol を指定することで、
引数として使われる要素を限定できます。
デフォルトは、:all (全ての要素)です。
指定できる Symbol の詳細は、 Matrix#each の項目...
...を参照して下さい。


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

m = Matrix[[1, 2], [3, 4]]

p m.map! { |element| element * 10 } #=> Matrix[[10, 20], [30, 40]]
p m #=> Matrix[[10, 20], [30, 40]]
//}

@see Matrix#each, Matrix#map...

絞り込み条件を変える

<< < 1 2 3 4 > >>