[index-ja]
(局所化環クラス)
与えられた環を分子・分母にした分数環を構成します。 実際のクラスを生成するには、クラスメソッド ::create あるいは関数 Algebra.LocalizedRing() を用います。
なし
Algebra.LocalizedRing(ring)
Algebra.RationalFunctionField(ring, obj)
環 ring、変数を表すオブジェクトを obj として有理関数体 を作ります。クラスメソッド ::var で変数を得ることができます。
例: 有理関数体
require "algebra/localized-ring" require "rational" F = Algebra.RationalFunctionField(Rational, "x") x = F.var p ( 1 / (x**2 - 1) - 1 / (x**3 - 1) ) #=> x^2/(x^4 + x^3 - x - 1)
Algebra.MRationalFunctionField(ring, [obj1[, obj2, ...]])
環 ring、変数を表すオブジェクトを obj1, obj2,... として有理関数体を作ります。クラスメソッド ::vars で変数を得ることができます。
例: 有理関数体
require "algebra/localized-ring" require "rational" G = Algebra.MRationalFunctionField(Rational, "x", "y", "z") x, y, z = G.vars f = (x + z) / (x + y) - z / (x + y) p f #=> (x^2 + xy)/(x^2 + 2xy + y^2) p f.simplify #=> x/(x + y)
::create(ring)
クラスringで表現されるを環の元を分子・分母とする分数環 を作ります。
この戻り値は Algebra::LocalizedRing クラスのサブクラスです。 このサブクラスにはクラスメソッドとして ::ground が定義され ring を返します。
生成したクラスにはクラスメソッド::[]
が定義され、基礎環の
元 x
に対して分数環の元 x/1
を返します。
例: 有理数を作る
require "localized-ring" F = Algebra.LocalizedRing(Integer) p F.new(1, 2) + F.new(2, 3) #=> 7/6
例: 整数上の多項式環の商体
require "polynomial" require "localized-ring" P = Algebra.Polynomial(Integer, "x") F = Algebra.LocalizedRing(P) x = F[P.var] p ( 1 / (x**2 - 1) - 1 / (x**3 - 1) ) #=> (x^3 - x^2)/(x^5 - x^3 - x^2 + 1)
::zero
::unity
zero?
zero
unity
==(other)
<=>(other)
+(other)
-(other)
*(other)
**(n)
/(other)