(代数方程式のためのユーティリティー)
方程式と体のためのファイル
Algebra.MinimalDecompositionField(poly [,fac0]))
多項式polyの最小分解体を ext_field、拡大に要した既約多項式 の配列を modulus、poly を最小分解体上で1次式の積に因数分解し たものを facts、多項式の根の配列を roots、基礎体に添加した元 の配列を addelems として、
[ext_field, modulus, facts, roots, addelems]
を返す。基礎体上の因数分解 fac0 を添えると高速化に役立つ。 (facts の要素と fact0 は Algebra::Factors オブジェクト。
例:
require "algebra" PQ = Polynomial(Rational, "x") x = PQ.var f = x**4 + 2 field, modulus, facts, roots, addelems = Algebra.MinimalDecompositionField(f) p modulus #=> [a^4 + 2, b^2 + a^2] p facts #=> (x - a)(x + a)(x - b)(x + b) p roots #=> [a, -a, b, -b] p addelems #=> [a, b] fp = Polynomial(field, "x") x = fp.var facts1 = Factors.new(facts.collect{|g, n| [g.call(x), n]}) p facts1.pi == f.convert_to(fp) #=> true
Algebra::Polynomial#minimal_decompositon_field([fact0])
Algebra.MinimalDecompositionField(self [,fact0])) と同じ。
Algebra.MinimalPolynomial(element, poly1[, poly2[, poly3...]])
poly1, poly2, poly3...
を法とした、element の最小多項式
を求めます。
例: ルート2 + ルート3 + ルート5 の最小多項式を求める。
PQ = MPolynomial(Rational) a, b, c = PQ.vars("abc") p MinimalPolynomial(a + b + c, a**2-2, b**2-3, c**2-5) #=> x^8 - 40x^6 + 352x^4 - 960x^2 + 576