るりまサーチ

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

別のキーワード

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

クラス

キーワード

検索結果

<< < 1 2 >>

Vector#collect2(v) {|x, y| ... } -> Array (33.0)

ベクトルの各要素と引数 v の要素との組に対してブロックを評価し、その結果を要素として持つ配列を返します。

...erator を返します。

@
param v ブロック内で評価される(ベクトル or 配列)

@
raise ExceptionForMatrix::ErrDimensionMismatch 自分自身と引数のベクト
ルの要素の数(次元)が異なっていたときに発生します。

@
see Vector#map2

次の例は、2つ...
...のベクトルの要素毎の積を要素とする配列を生成します。

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

v1 = Vector[2, 3, 5]
v2 = Vector[7, 9, 11]
a = Array[7, 9, 11]

z = v1.collect2(v2){ |x, y| x * y }
p z # => [14, 27, 55]

z = v1.collect2(a) { |x, y| x * y } # Array でも OK
p z...

Matrix#each(which = :all) -> Enumerator (27.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#map...

Matrix#each(which = :all) {|e| ... } -> self (27.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#map...

Matrix#collect -> Enumerator (23.0)

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

...適用を繰り返した結果を、要素として持つ行列を生成します。

ブロックがない場合、 Enumerator を返します。


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

m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
//}

@
see Matrix#each...

Matrix#collect {|x| ... } -> Matrix (23.0)

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

...適用を繰り返した結果を、要素として持つ行列を生成します。

ブロックがない場合、 Enumerator を返します。


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

m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
//}

@
see Matrix#each...

絞り込み条件を変える

<< < 1 2 >>