るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < ... 3 4 5 >>

Vector#collect! -> Enumerator (6129.0)

ベクトルの各要素を順番にブロックに渡して評価し、その結果で要素を置き換えます。

...果で要素を置き換えます。

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

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

v = Vector[1, 2, 3]
p v.map!{ |el| el * 2 } #=> Vector[2, 4, 6]
p v #=> Vector[2, 4,...

Vector#collect! {|element| ... } -> self (6129.0)

ベクトルの各要素を順番にブロックに渡して評価し、その結果で要素を置き換えます。

...果で要素を置き換えます。

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

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

v = Vector[1, 2, 3]
p v.map!{ |el| el * 2 } #=> Vector[2, 4, 6]
p v #=> Vector[2, 4,...

Vector#map! -> Enumerator (6129.0)

ベクトルの各要素を順番にブロックに渡して評価し、その結果で要素を置き換えます。

...果で要素を置き換えます。

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

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

v = Vector[1, 2, 3]
p v.map!{ |el| el * 2 } #=> Vector[2, 4, 6]
p v #=> Vector[2, 4,...

Vector#map! {|element| ... } -> self (6129.0)

ベクトルの各要素を順番にブロックに渡して評価し、その結果で要素を置き換えます。

...果で要素を置き換えます。

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

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

v = Vector[1, 2, 3]
p v.map!{ |el| el * 2 } #=> Vector[2, 4, 6]
p v #=> Vector[2, 4,...

Set#collect! {|o| ...} -> self (6127.0)

集合の各要素についてブロックを評価し、その結果で元の集合を置き換えます。

...集合の各要素についてブロックを評価し、その結果で元の集合を置き換えます。

//emlist[][ruby]{
require 'set'
set = Set['hello', 'world']
set.map! {|str| str.capitalize}
p set # => #<Set: {"Hello", "World"}>
//}

@see Enumerable#collect...
...集合の各要素についてブロックを評価し、その結果で元の集合を置き換えます。

//emlist[][ruby]{
set = Set['hello', 'world']
set.map! {|str| str.capitalize}
p set # => #<Set: {"Hello", "World"}>
//}

@see Enumerable#collect...

絞り込み条件を変える

Set#map! {|o| ...} -> self (6127.0)

集合の各要素についてブロックを評価し、その結果で元の集合を置き換えます。

...集合の各要素についてブロックを評価し、その結果で元の集合を置き換えます。

//emlist[][ruby]{
require 'set'
set = Set['hello', 'world']
set.map! {|str| str.capitalize}
p set # => #<Set: {"Hello", "World"}>
//}

@see Enumerable#collect...
...集合の各要素についてブロックを評価し、その結果で元の集合を置き換えます。

//emlist[][ruby]{
set = Set['hello', 'world']
set.map! {|str| str.capitalize}
p set # => #<Set: {"Hello", "World"}>
//}

@see Enumerable#collect...

Enumerable#lazy -> Enumerator::Lazy (55.0)

自身を lazy な Enumerator に変換したものを返します。

...メソッドが遅延評価を行う (つまり、配列ではな
くEnumeratorを返す) ように再定義されています。

* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡...
...b, c の組) を
列挙するプログラムです。

//emlist[例][ruby]{
def pythagorean_triples
(1..Float::INFINITY).lazy.flat_map {|z|
(1..z).flat_map {|x|
(x..z).select {|y|
x**2 + y**2 == z**2
}.map {|y|
[x, y, z]
}
}
}
end
# 最初の10個のピ...
<< < ... 3 4 5 >>