るりまサーチ

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

別のキーワード

  1. each enumerator
  2. enumerator with_index
  3. enumerator with_object
  4. enumerator new

クラス

キーワード

検索結果

<< 1 2 3 > >>

Matrix#each(which = :all) -> Enumerator (18230.0)

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

...upper 対角成分の上側

ブロックを省略した場合、 Enumerator を返します。

//emlist[例][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#map...

Vector#each -> Enumerator (18212.0)

ベクトルの各要素をブロックの引数として順にブロックを呼び出します。

...ックの引数として順にブロックを呼び出します。

このクラスは Enumerable を include しているため、
このメソッドを経由して Enumerable の各メソッドを使うことができます。

ブロックを省略した場合は Enumerator を返します。...

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

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

...upper 対角成分の上側

ブロックを省略した場合、 Enumerator を返します。

//emlist[例][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#map...

Vector#each {|e| ... } -> self (18112.0)

ベクトルの各要素をブロックの引数として順にブロックを呼び出します。

...ックの引数として順にブロックを呼び出します。

このクラスは Enumerable を include しているため、
このメソッドを経由して Enumerable の各メソッドを使うことができます。

ブロックを省略した場合は Enumerator を返します。...

Matrix#each_with_index(which = :all) -> Enumerator (6230.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...

絞り込み条件を変える

Vector#each2(v) -> Enumerator (6212.0)

ベクトルの各要素と、それに対応するインデックスを持つ引数 v の要素との組に対して (2引数の) ブロックを繰返し評価します。

...オブジェクトです。
Vector も使えます。

ブロックを省略した場合は Enumerator を返します。

@param v 各要素と組を取るためのオブジェクト
@raise ExceptionForMatrix::ErrDimensionMismatch 自分自身と引数のベクト
ルの要素の数(次元)...

Matrix#each_with_index(which = :all) {|e, row, col| ... } -> self (6130.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...

Vector#each2(v) {|x, y| ... } -> self (6112.0)

ベクトルの各要素と、それに対応するインデックスを持つ引数 v の要素との組に対して (2引数の) ブロックを繰返し評価します。

...オブジェクトです。
Vector も使えます。

ブロックを省略した場合は Enumerator を返します。

@param v 各要素と組を取るためのオブジェクト
@raise ExceptionForMatrix::ErrDimensionMismatch 自分自身と引数のベクト
ルの要素の数(次元)...

Matrix#collect!(which = :all) -> Enumerator (123.0)

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

...ロックの適用を繰り返した結果で要素を置き換えます。

ブロックのない場合は、自身と map! から生成した Enumerator オブジェクトを返します。

@param which which に以下の 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#collect(which = :all) -> Enumerator (123.0)

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

... Enumerator を返します。

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

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

絞り込み条件を変える

<< 1 2 3 > >>