320件ヒット
[1-100件を表示]
(0.038秒)
別のキーワード
ライブラリ
- English (24)
- ビルトイン (82)
- drb (12)
- rake (36)
-
rake
/ loaders / makefile (12) -
rake
/ packagetask (60)
クラス
- Array (24)
- NameError (10)
- Object (12)
- Proc (12)
-
Rake
:: MakefileLoader (12) -
Rake
:: PackageTask (60)
モジュール
- Kernel (36)
- ObjectSpace (12)
- RakeFileUtils (36)
キーワード
-
$ INPUT _ LINE _ NUMBER (12) -
$ NR (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - DRbProtocol (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) - abort (12)
-
bigdecimal
/ ludcmp (12) -
bigdecimal
/ newton (12) - binding (12)
- irb (12)
- load (12)
-
need
_ tar (12) -
need
_ tar _ bz2 (12) -
need
_ tar _ bz2= (12) -
need
_ tar _ gz (12) -
need
_ zip (12) -
nowrite
_ flag (12) - optparse (12)
- receiver (10)
-
respond
_ to _ missing? (12) -
ruby 1
. 8 . 4 feature (12) -
undefine
_ finalizer (12) -
verbose
_ flag (12) -
verbose
_ flag= (12)
検索結果
先頭5件
-
bigdecimal
/ ludcmp (26022.0) -
LU 分解を用いて、連立1次方程式 Ax = b の解 x を求める機能を提供します。
...LU 分解を用いて、連立1次方程式 Ax = b の解 x を求める機能を提供します。
Ruby のソースコード中の以下のサンプルスクリプトも参考にしてください。
* https://github.com/ruby/ruby/blob/master/ext/bigdecimal/sample/linear.rb... -
bigdecimal
/ newton (26012.0) -
ニュートン法を用いて非線形方程式 f(x) = 0 の解 x を求める機能を提供しま す。
...非線形方程式 f(x) = 0 の解 x を求める機能を提供しま
す。
本サブライブラリは BigDecimal に依存しません。
実行例:
require "bigdecimal"
require "bigdecimal/newton"
...
n = Newton.nlsolve(f, x)
引数 f には関数を表すオブジェクトを指.......eps
収束の基準になる epsilon 値を返します。2 つの値が異なる値かどうかを比
較するのに使用されます。|a - b| < f.eps となる 2 つの値は同じ値である
とみなされます。
引数 x には探索を開始する点を数値の配列で指定......変更されます。x から解を取得します。
戻り値 n は計算した回数を整数で返します。
Ruby のソースコード中の以下のサンプルスクリプトも参考にしてください。
* https://github.com/ruby/ruby/blob/master/ext/bigdecimal/sample/nlsolve.rb... -
Array
# sample -> object | nil (18228.0) -
配列の要素を1個(引数を指定した場合は自身の要素数を越えない範囲で n 個) ランダムに選んで返します。
...。
//emlist[例][ruby]{
a = (1..10).to_a
p a.sample #=> 9
p a.sample #=> 10
p a.sample(3) #=> [1, 9, 3]
p a #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
//}
random SecureRandom などの乱数生成器を渡すことができます。
//emlist[例][ruby]{
require 'securer......andom'
a = (1..10).to_a
p a.sample(random: SecureRandom) #=> 2
//}... -
Array
# sample(random: Random) -> object | nil (18228.0) -
配列の要素を1個(引数を指定した場合は自身の要素数を越えない範囲で n 個) ランダムに選んで返します。
...。
//emlist[例][ruby]{
a = (1..10).to_a
p a.sample #=> 9
p a.sample #=> 10
p a.sample(3) #=> [1, 9, 3]
p a #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
//}
random SecureRandom などの乱数生成器を渡すことができます。
//emlist[例][ruby]{
require 'securer......andom'
a = (1..10).to_a
p a.sample(random: SecureRandom) #=> 2
//}... -
Proc
# binding -> Binding (6212.0) -
Proc オブジェクトが保持するコンテキストを Binding オブジェクトで返します。
...Proc オブジェクトが保持するコンテキストを
Binding オブジェクトで返します。
//emlist[例][ruby]{
def fred(param)
proc {}
end
sample_proc = fred(99)
eval("param", sample_proc.binding) # => 99
//}... -
RakeFileUtils
. verbose _ flag -> bool (6212.0) -
この値が真の場合、詳細を表示します。
...この値が真の場合、詳細を表示します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :sample_file_task
file :sample_file_task do |t|
# --verbose で rake を実行する
RakeFileUtils.verbose_flag # => true
end
//}... -
Kernel
$ $ INPUT _ LINE _ NUMBER -> Integer (6112.0) -
$. の別名
...$. の別名
1 e
2 f
3 g
4 h
5 i
# end of a.txt
require "English"
File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb
ruby sample.rb a.txt
#=> 5... -
RakeFileUtils
. verbose _ flag=(flag) (6112.0) -
詳細を表示するかどうか設定します。
...します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :sample_file_task
file :sample_file_task do |t|
# --verbose で rake を実行する
p RakeFileUtils.verbose_flag # => true
RakeFileUtils.verbose_flag = false
p RakeFileUtils.verbose_flag # => false
end
//}... -
Kernel
. # abort -> () (6106.0) -
Ruby プログラムをエラーメッセージ付きで終了します。終了ステータスは 1 固定です。
...Ruby プログラムをエラーメッセージ付きで終了します。終了ステータスは 1 固定です。
このメソッドと Kernel.#exit との違いは、プログラムの終了ステー
タスが 1 (正確にはCレベルの定数 EXIT_FAILURE の値)固定であることと、......エラーメッセージ文字列です。
//emlist[][ruby]{
puts 'start'
begin
puts 'start1...'
abort "error1"
rescue SystemExit => err
puts "end1 with #{err.inspect}"
end
begin
puts 'start2...'
raise RuntimeError.new
rescue
abort
ensure
puts 'end2...'
end
puts 'end' #実行され......#(標準出力)
#=> start
# start1...
# end1 with #<SystemExit: error1>
# start2...
# end2...
#終了ステータス:1
#(標準エラー出力)
#=> error1
# Traceback (most recent call last):
# sample.rb:11:in `<main>': RuntimeError (RuntimeError)
//}
@see Kernel.#exit,Kernel.#exit!...