るりまサーチ

最速Rubyリファレンスマニュアル検索!
61件ヒット [1-61件を表示] (0.049秒)
トップページ > クエリ:ruby[x] > クエリ:solve[x]

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

Matrix::LUPDecomposition#solve(b) -> Vector | Matrix (18125.0)

self が正方行列 A の LUP 分解の時、一次方程式 Ax = b の解を返します。 b には Vector, Matrix, 数値の配列を指定出来ます。

...程式の定数項を指定します。

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

lup = Matrix[[2, 1], [1, 2]].lup

lup.solve([1, -1]) #=> Vector[(1/1), (-1/1)]
lup.solve(Vector[3, 0]) #=> Vector[(2/1), (-1/1)]
lup.solve(Matrix[[1, 3], [-1, 0]]) #=> Matrix[[(1/1), (2/1)], [(...

RubyVM.resolve_feature_path (9134.0)

require を呼んだときに読み込まれるファイルを特定します。 このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。

...require を呼んだときに読み込まれるファイルを特定します。
このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。

//emlist[][ruby]{
p RubyVM.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.6.0/lib/ruby/2.6.0/set.rb"]
//}...

LUSolve.#lusolve(a, b, ps, zero = 0.0) -> [BigDecimal] (9106.0)

LU 分解を用いて、連立1次方程式 Ax = b の解 x を求めて返します。

...にし、
LUSolve.#ludecomp で変換したものを指定します。

@param b ベクトルを BigDecimal の配列で指定します。

@param ps LUSolve.#ludecomp の返り値を指定します。

@param zero 0.0 を表す値を指定します。

//emlist[][ruby]{
require 'bigdecimal...
...al/ludcmp'

include LUSolve

a = [['1.0', '2.0'], ['3.0', '1.0']].flatten.map(&:to_d)
# x = ['1.0', -1.0']
b = ['-1.0', '2.0'].map(&:to_d)

zero = '0.0'.to_d
one = '1.0'.to_d
# 以下の 2 行は
ps = ludecomp(a, b.size, zero, one) # a が破壊的に変更される
x = lusolve(a, b, ps, zero)
#...
...こう書いてもよい
# x = lusolve(a, b, ludecomp(a, b.size, zero, one), zero)

p x.map(&:to_f) #=> [1.0, -1.0]
//}...

Rake::FileList#resolve -> self (6106.0)

追加リストと除外リストを評価します。

...][ruby]{
# Rakefile での記載例とする

IO.write("test.rb", "test")
IO.write("test.java", "test")
IO.write("test.js", "test")

task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("*.rb")
file_list.include("*.java")
file_list.exclude("*.js")
file_list.resolve #...

Matrix#lup -> Matrix::LUPDecomposition (12.0)

行列の LUP 分解を保持したオブジェクトを返します。

...L*U = P*self を満たします。

//emlist[例][ruby]{
require 'matrix'
a = Matrix[[1, 2], [3, 4]]
l, u, p = a.lup
l.lower_triangular? # => true
u.upper_triangular? # => true
p.permutation? # => true
l * u == p * a # => true
a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)]
//}

@see Matrix...

絞り込み条件を変える

Matrix#lup_decomposition -> Matrix::LUPDecomposition (12.0)

行列の LUP 分解を保持したオブジェクトを返します。

...L*U = P*self を満たします。

//emlist[例][ruby]{
require 'matrix'
a = Matrix[[1, 2], [3, 4]]
l, u, p = a.lup
l.lower_triangular? # => true
u.upper_triangular? # => true
p.permutation? # => true
l * u == p * a # => true
a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)]
//}

@see Matrix...