るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

検索結果

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

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

...uby]{
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...

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

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

...uby]{
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...