12件ヒット
[1-12件を表示]
(0.015秒)
モジュール
- LUSolve (12)
検索結果
-
LUSolve
. # lusolve(a , b , ps , zero = 0 . 0) -> [BigDecimal] (26.0) -
LU 分解を用いて、連立1次方程式 Ax = b の解 x を求めて返します。
...]{
require 'bigdecimal'
require 'bigdecimal/util'
require 'bigdecimal/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)...