12件ヒット
[1-12件を表示]
(0.083秒)
別のキーワード
種類
- インスタンスメソッド (10)
- モジュール関数 (2)
ライブラリ
- ビルトイン (2)
-
bigdecimal
/ ludcmp (2) - csv (3)
- matrix (5)
クラス
- CSV (1)
-
CSV
:: Row (1) -
CSV
:: Table (1) - Matrix (4)
- UncaughtThrowError (2)
- Vector (1)
モジュール
- LUSolve (2)
キーワード
-
cofactor
_ expansion (1) - covector (1)
- inspect (3)
-
laplace
_ expansion (1) - ludecomp (1)
- lusolve (1)
-
row
_ vectors (1) - tag (1)
- value (1)
検索結果
先頭5件
-
Matrix
# row(i) -> Vector | nil (54679.0) -
i 番目の行を Vector オブジェクトで返します。 i 番目の行が存在しない場合は nil を返します。 ブロックが与えられた場合はその行の各要素についてブロックを繰り返します。
i 番目の行を Vector オブジェクトで返します。
i 番目の行が存在しない場合は nil を返します。
ブロックが与えられた場合はその行の各要素についてブロックを繰り返します。
Vector オブジェクトは Matrix オブジェクトとの演算の際には列ベクトルとして扱われることに注意してください。
@param i 行の位置を指定します。
先頭の行が 0 番目になります。i の値が負の時には末尾から
のインデックスと見倣します。末尾の行が -1 番目になります。
//emlist[例][ruby]{
require 'matrix'
a1 = ... -
CSV
:: Row # inspect -> String (45673.0) -
ASCII 互換であるエンコーディングの文字列で自身の情報を返します。
ASCII 互換であるエンコーディングの文字列で自身の情報を返します。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header1"], [1, 2, 3])
row.inspect # => "#<CSV::Row \"header1\":1 \"header2\":2 \"header1\":3>"
//} -
Matrix
# row _ vectors -> [Vector] (36940.0) -
自分自身を行ベクトルの配列として返します。
自分自身を行ベクトルの配列として返します。
//emlist[例][ruby]{
require 'matrix'
a1 = [ 1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]
p m.row_vectors # => [Vector[1, 2, 3], Vector[10, 15, 20], Vector[-1, -2, 1.5]]
//} -
CSV
:: Table # inspect -> String (36655.0) -
モードとサイズを US-ASCII な文字列で返します。
モードとサイズを US-ASCII な文字列で返します。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.inspect # => "#<CSV::Table mode:col_or_row row_count:2>"
//} -
CSV
# inspect -> String (36637.0) -
ASCII 互換文字列で自身の情報を表したものを返します。
ASCII 互換文字列で自身の情報を表したものを返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2")
csv.inspect # => "<#CSV io_type:StringIO encoding:UTF-8 lineno:0 col_sep:\",\" row_sep:\"\\n\" quote_char:\"\\\"\">"
//} -
LUSolve
. # ludecomp(a , n , zero = 0 , one = 1) -> [Integer] (36619.0) -
n 次正方行列を表す配列 a を破壊的に変更し、返り値と併せて元の行列の LU 分解を提供します。
n 次正方行列を表す配列 a を破壊的に変更し、返り値と併せて元の行列の LU 分解を提供します。
LUSolve.#lusolve の引数を構築するために使います。
@param a 行列を BigDecimal の配列で指定します。(各要素を
Row-major order で 1 次元の配列にしたオブジェクトを指定し
ます)
@param n 引数 a の次元を整数で指定します。
@param zero 0 を表す値を指定します。
@param one 1 を表す値を指定します。
@return ピボットの位置を表す Integer の配... -
Vector
# covector -> Matrix (27355.0) -
Matrix オブジェクトへ変換します。
Matrix オブジェクトへ変換します。
列ベクトル (行列)、すなわち、(n, 1) 型の行列に変換します。
実際には Matrix.row_vector(self) を適用します。
//emlist[例][ruby]{
require 'matrix'
v = Vector[2, 3, 5]
p v # => Vector[2, 3, 5]
m = v.covector
p m # => Matrix[[2, 3, 5]]
//} -
Matrix
# cofactor _ expansion(row: nil , column: nil) -> object | Integer | Rational | Float (19027.0) -
row 行、もしくは column 列に関するラプラス展開をする。
row 行、もしくは column 列に関するラプラス展開をする。
通常の行列に対してはこれは単に固有値を計算するだけです。かわりにMatrix#determinant を
利用すべきです。
変則的な形状の行列に対してはそれ以上の意味を持ちます。例えば
row行/column列が行列やベクトルである場合には
//emlist[例][ruby]{
require 'matrix'
# Matrix[[7,6], [3,9]].laplace_expansion(column: 1) # => 45
Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].... -
Matrix
# laplace _ expansion(row: nil , column: nil) -> object | Integer | Rational | Float (19027.0) -
row 行、もしくは column 列に関するラプラス展開をする。
row 行、もしくは column 列に関するラプラス展開をする。
通常の行列に対してはこれは単に固有値を計算するだけです。かわりにMatrix#determinant を
利用すべきです。
変則的な形状の行列に対してはそれ以上の意味を持ちます。例えば
row行/column列が行列やベクトルである場合には
//emlist[例][ruby]{
require 'matrix'
# Matrix[[7,6], [3,9]].laplace_expansion(column: 1) # => 45
Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].... -
UncaughtThrowError
# tag -> object (9319.0) -
Kernel.#throw に指定した tag を返します。
Kernel.#throw に指定した tag を返します。
//emlist[例:][ruby]{
def do_complicated_things
throw :uncaught_label
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.tag # => ":uncaught_label"
end
//} -
UncaughtThrowError
# value -> object (9319.0) -
Kernel.#throw に指定した value を返します。
Kernel.#throw に指定した value を返します。
//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label, "uncaught_value"
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.value # => "uncaught_value"
end
//} -
LUSolve
. # lusolve(a , b , ps , zero = 0 . 0) -> [BigDecimal] (637.0) -
LU 分解を用いて、連立1次方程式 Ax = b の解 x を求めて返します。
...します。
//emlist[][ruby]{
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 = lud...