るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

Fiddle::CStruct.size -> Integer (18108.0)

構造体のサイズをバイト数で返します。

...構造体のサイズをバイト数で返します。

このメソッドが返す値は C の構造体としてのサイズです。
Ruby
のオブジェクトとしてはより大きなメモリを消費しています。...

RubyVM::InstructionSequence.disasm(body) -> String (3007.0)

引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。

...
Ruby
VM::InstructionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。

@param body Proc、Method オブジェクトを指定します。

例1:Proc オブジェクトを指定した場合

# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::I...
...: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|------------------------------------------------------------------------
local table (size:...
...オブジェクトを指定した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

puts RubyVM::InstructionSequence.disasm(method(:hello))

出力:

== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8...

RubyVM::InstructionSequence.disassemble(body) -> String (3007.0)

引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。

...
Ruby
VM::InstructionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。

@param body Proc、Method オブジェクトを指定します。

例1:Proc オブジェクトを指定した場合

# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::I...
...: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|------------------------------------------------------------------------
local table (size:...
...オブジェクトを指定した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

puts RubyVM::InstructionSequence.disasm(method(:hello))

出力:

== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace 8...

Matrix.build(row_size, column_size = row_size) -> Enumerable (357.0)

row_size×column_sizeの行列をブロックの返り値から生成します。

...row_size×column_sizeの行列をブロックの返り値から生成します。

行列の各要素の位置がブロックに渡され、それの返り値が行列の要素となります。

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

//emlist[例][ruby]{
require 'matri...
...x'
m = Matrix.build(2, 4) {|row, col| col - row }
# => Matrix[[0, 1, 2, 3], [-1, 0, 1, 2]]
m = Matrix.build(3) { rand }
# => a 3x3 matrix with random elements
//}

@param row_size 行列の行数
@param column_size 行列の列数...

Matrix.build(row_size, column_size = row_size) {|row, col| ... } -> Matrix (357.0)

row_size×column_sizeの行列をブロックの返り値から生成します。

...row_size×column_sizeの行列をブロックの返り値から生成します。

行列の各要素の位置がブロックに渡され、それの返り値が行列の要素となります。

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

//emlist[例][ruby]{
require 'matri...
...x'
m = Matrix.build(2, 4) {|row, col| col - row }
# => Matrix[[0, 1, 2, 3], [-1, 0, 1, 2]]
m = Matrix.build(3) { rand }
# => a 3x3 matrix with random elements
//}

@param row_size 行列の行数
@param column_size 行列の列数...

絞り込み条件を変える

Matrix.empty(row_size=0, column_size=0) -> Matrix (245.0)

要素を持たない行列を返します。

...「要素を持たない」とは、行数もしくは列数が0の行列のことです。

row_size 、 column_size のいずれか一方は0である必要があります。

//emlist[例][ruby]{
require 'matrix'
m = Matrix.empty(2, 0)
m == Matrix[ [], [] ]
# => true
n = Matrix.empty(0, 3)
n ==...
...Matrix.columns([ [], [], [] ])
# => true
m * n
# => Matrix[[0, 0, 0], [0, 0, 0]]
//}

@param row_size 行列の行数
@param column_size 行列の列数
@raise ArgumentError row_size, column_size が両方とも0でない場合に発生します...

Array.new(size) {|index| ... } -> Array (141.0)

長さ size の配列を生成し、各要素のインデックスを引数としてブロックを実行し、 各要素の値をブロックの評価結果に設定します。

...長さ size の配列を生成し、各要素のインデックスを引数としてブロックを実行し、
各要素の値をブロックの評価結果に設定します。

ブロックは要素毎に実行されるので、全要素をあるオブジェクトの複製にすることがで...
...きます。

@param size 配列の長さを数値で指定します。

//emlist[例][ruby]{
ary = Array.new(3){|index| "hoge#{index}"}
p ary #=> ["hoge0", "hoge1", "hoge2"]
//}

//emlist[例][ruby]{
ary = Array.new(3){ "foo" }
p ary #=> ["foo", "foo", "foo...

Array.new(size = 0, val = nil) -> Array (136.0)

長さ size の配列を生成し、各要素を val で初期化して返します。

...長さ size の配列を生成し、各要素を val で初期化して返します。

要素毎に val が複製されるわけではないことに注意してください。
全要素が同じオブジェクト val を参照します。
後述の例では、配列の各要素は全て同一の...
...文字列を指します。

@param size 配列の長さを数値で指定します。

@param val 配列の要素の値を指定します。

//emlist[例][ruby]{
ary = Array.new(3, "foo")
p ary #=> ["foo", "foo", "foo"]
ary[0].capitalize!
p ary #=> ["Foo", "...

Vector.basis(size:, index:) -> Vector (136.0)

size 次元ベクトル空間の index 番目の標準基底を返します。

...
size
次元ベクトル空間の index 番目の標準基底を返します。

//emlist[例][ruby]{
require 'matrix'
Vector.basis(size: 3, index: 1) # => Vector[0, 1, 0]
//}

@param size ベクトルの次元
@param index 標準基底の何番目か。0 origin...
<< 1 2 3 ... > >>