=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/algnum.texi,v retrieving revision 1.7 retrieving revision 1.8 diff -u -p -r1.7 -r1.8 --- OpenXM/src/asir-doc/parts/algnum.texi 2003/04/20 08:01:24 1.7 +++ OpenXM/src/asir-doc/parts/algnum.texi 2007/02/15 02:41:38 1.8 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/algnum.texi,v 1.6 2003/04/19 15:44:55 noro Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/algnum.texi,v 1.7 2003/04/20 08:01:24 noro Exp $ \BJP @node 代数的数に関する演算,,, Top @chapter 代数的数に関する演算 @@ -11,12 +11,14 @@ @menu \BJP * 代数的数の表現:: +* 分散多項式による代数的数の表現:: * 代数的数の演算:: * 代数体上での 1 変数多項式の演算:: * 代数的数に関する函数のまとめ:: \E \BEG * Representation of algebraic numbers:: +* Representation of algebraic numbers by distributed polynomials:: * Operations over algebraic numbers:: * Operations for uni-variate polynomials over an algebraic number field:: * Summary of functions for algebraic numbers:: @@ -237,6 +239,10 @@ t#0 [100] @end example + +@example +@end example + \BJP @node 代数的数の演算,,, 代数的数に関する演算 @section 代数的数の演算 @@ -446,6 +452,79 @@ used for your own simplification. \E \BJP +@node 分散多項式による代数的数の表現,,, 代数的数に関する演算 +@section 分散多項式による代数的数の表現 +\E +\BEG +@node Representation of algebraic numbers by distributed polynomials,,, Algebraic numbers +@section Representation of algebraic numbers by distributed polynomials +\E + +@noindent +\BJP +前節で述べたように, @code{root} を含む代数的数に対する簡単化は +ユーザの判断で行う必要がある. これに対し, ここで解説するもう一つの代数的数の +表現については, 加減乗除, ベキなどを行ったあと自動的に簡単化が行われる. +この表現は, 逐次拡大の場合に特に効率よく計算が行われるよう設計されており, +グレブナー基底関係の関数における係数体として用いることができる. この表現は +内部的には, @code{DAlg} と呼ばれるオブジェクトとして定義されている. +@code{DAlg} は分数式の形で保持される. 分母は整数, 分子は整数係数の分散多項式である. +\E +\BEG +Simplification of algebraic numbers containing @code{root} +is not done automatically and should be done by users. +There is another representation of algebraic numbers, for which the +results of fundamental operations are automatically simplified. +This representations are designed so that operations are efficiently +performed especially when the field is a successive extension and +it can be used as a ground field for Groebner basis related functions. +Internally an algebraic number of this type is defined as an object +called @code{DAlg}. A @code{DAlg} is represented as a fraction. The +denominator is an integer and the numerator is a distributed polynomial +with integral coefficients. +\E + +\BJP +@code{DAlg} は,@code{set_field()} によりあらかじめ設定された代数体の +元として生成される. 生成方法は, @code{newalg()} で生成された代数的数を +含む数から @code{algtodalg()} で変換する, あるいは分散多項式から直接 +@code{dptodalg()} で変換する,の 2 通りある. +一旦 @code{DAlg} 形式に変換されれば, 演算後に自動的に簡単化される. +\E +\BEG +@code{DAlg} is generated as an element of an algebraic number field +set by @code{set_field()}. There are two methods to generate a @code{DAlg}. +@code{algtodalg()} converts an algebraic number containing @code{root} +to @code{DAlg}. @code{dptodalg()} directly converts a distributed polynomial to +@code{DAlg}. +\E +@example +[0] A=newalg(x^2+1); +(#0) +[1] B=newalg(x^3+A*x+A); +(#1) +[2] set_field([B,A]); +0 +[3] C=algtodalg(A+B); +((1)*<<1,0>>+(1)*<<0,1>>) +[4] C^5; +((-11)*<<2,1>>+(5)*<<2,0>>+(10)*<<1,1>>+(9)*<<1,0>>+(11)*<<0,1>> ++(-1)*<<0,0>>) +[5] 1/C; +((2)*<<2,1>>+(-1)*<<2,0>>+(1)*<<1,1>>+(2)*<<1,0>>+(-3)*<<0,1>> ++(-1)*<<0,0>>)/5 +@end example +\BJP +この例では, Q(a,b) (a^2+1=0, b^3+ab+b=0) において, (a+b)^5 および 1/(a+b) を +計算 (簡単化) している. 分子である分散多項式の表示は, 分散多項式の表示をそのまま流用している. +\E +\BEG +In this example Q(a,b) (a^2+1=0, b^3+ab+b=0) is set as the current ground field, +and (a+b)^5 and 1/(a+b) are simplified in the field. The numerators of the results +are printed as distributed polynomials. +\E + +\BJP @node 代数体上での 1 変数多項式の演算,,, 代数的数に関する演算 @section 代数体上での 1 変数多項式の演算 \E @@ -710,6 +789,8 @@ may yield a polynomial which differs by a constant. * sp_norm:: * asq af af_noalg:: * sp sp_noalg:: +* set_field:: +* algtodalg dalgtoalg dptodalg dalgtodp:: @end menu \JP @node newalg,,, 代数的数に関する函数のまとめ @@ -1451,3 +1532,151 @@ the builtin function @code{res()} is always used. @fref{asq af af_noalg}, @fref{defpoly}, @fref{algptorat}, @fref{sp_norm}. @end table +\JP @node set_field,,, 代数的数に関する函数のまとめ +\EG @node set_field,,, Summary of functions for algebraic numbers +@subsection @code{set_field} +@findex set_field + +@table @t +@item set_field(@var{rootlist}) +\JP :: 代数体を基礎体として設定する. +\EG :: Set an algebraic number field as the currernt ground field. +@end table + +@table @var +@item return +0 +@item rootlist +\JP @code{root} のリスト +\EG A list of @code{root} +@end table + +@itemize @bullet +@item +\JP @code{root} のリスト @var{rootlist} で生成される代数体を基礎体として設定する. +\BEG +@code{set_field()} sets an algebraic number field generated by @code{root} in +@var{rootlist} over Q. +\E +@item +\BJP +@code{root} は内部的に順序づけられているので, @var{rootlist} は集合として指定 +すればよい. (順序は気にしなくてよい.) +\E +\BEG +You don't care about the order of @code{root} in @var{rootlist}, because +@code{root} are automatically ordered internally. +\E +@end itemize + +@example +[0] A=newalg(x^2+1); +(#0) +[1] B=newalg(x^3+A); +(#1) +[2] C=newalg(x^4+B); +(#1) +[3] set_field([C,B,A]); +0 +@end example + +@table @t +\JP @item 参照 +\EG @item Reference +@fref{algtodalg dalgtoalg dptodalg dalgtodp} +@end table + +\JP @node algtodalg dalgtoalg dptodalg dalgtodp,,, 代数的数に関する函数のまとめ +\EG @node algtodalg dalgtoalg dptodalg dalgtodp,,, Summary of functions for algebraic numbers +@subsection @code{algtodalg}, @code{dalgtoalg}, @code{dptodalg}, @code{dalgtodp} +@findex algtodalg +@findex dalgtoalg +@findex dpodalg +@findex dalgtodp + +@table @t +@item algtodalg(@var{alg}) +\JP :: 代数的数 @var{alg} を @code{DAlg} に変換する. +\EG :: Converts an algebraic number @var{alg} to a @code{DAlg}. +@item dalgtoalg(@var{dalg}) +\JP :: @code{DAlg} @code{dalg} を代数的数に変換する. +\EG :: Converts a @code{DAlg} @code{dalg} to an algebraic number. +@item dptodalg(@var{dp}) +\JP :: 分散多項式 @var{dp} を @code{DAlg} に変換する. +\EG :: Converts an algebraic number @var{alg} to a @code{DAlg}. +@item dalgtodp(@var{dalg}) +\JP :: @code{DAlg} @code{dalg} を分散多項式に変換する. +\EG :: Converts a @code{DAlg} @code{dalg} to an algebraic number. +@end table + +@table @var +@item return +\JP 代数的数, @code{DAlg} または [分散多項式,分母] なるリスト +\EG An algebraic number, a @code{DAlg} or a list [distributed polynomial,denominator] +@item alg +\JP @code{root} を含む代数的数 +\EG an algebraic number containing @code{root} +@item dp +\JP 有理数係数分散多項式 +\EG a distributed polynomial over Q +@end table + +@itemize @bullet +@item +\JP @code{root} を含む代数的数, @code{DAlg} および分散多項式間の変換を行う. +\BEG +These functions are converters between @code{DAlg} and an algebraic number +containing @code{root}, or a distributed polynomial. +\E +@item +\BJP +@code{DAlg} が属すべき代数体は, @code{set_field()} により +あらかじめ設定しておく必要がある. +\E +\BEG +A ground field to which a @code{DAlg} belongs must be set by @code{set_field()} +in advance. +\E +@item +\BJP +@code{dalgtodp()} は, 分子である整数係数分散多項式と, 分母である整数を要素に持つ +リストを返す. +\E +\BEG +@code{dalgtodp()} returns a list containing the numerator (a distributed polynomial) +and the denominator (an integer). +\E +@item +\BJP +@code{algtodalg()}, @code{dptodalg()} は簡単化された結果を返す. +\E +\BEG +@code{algtodalg()}, @code{dptodalg()} return the simplified result. +\E +@end itemize + +@example +[0] A=newalg(x^2+1); +(#0) +[1] B=newalg(x^3+A*x+A); +(#1) +[2] set_field([B,A]); +0 +[3] C=algtodalg((A+B)^10); +((408)*<<2,1>>+(103)*<<2,0>>+(-36)*<<1,1>>+(-446)*<<1,0>> ++(-332)*<<0,1>>+(-218)*<<0,0>>) +[4] dalgtoalg(C); +((408*#0+103)*#1^2+(-36*#0-446)*#1-332*#0-218) +[5] D=dptodalg(<<10,10>>/10+2*<<5,5>>+1/3*<<0,0>>); +((-9)*<<2,1>>+(57)*<<2,0>>+(-63)*<<1,1>>+(-12)*<<1,0>> ++(-60)*<<0,1>>+(1)*<<0,0>>)/30 +[6] dalgtodp(D); +[(-9)*<<2,1>>+(57)*<<2,0>>+(-63)*<<1,1>>+(-12)*<<1,0>> ++(-60)*<<0,1>>+(1)*<<0,0>>,30] +@end example + +@table @t +\JP @item 参照 +\EG @item Reference +@fref{set_field} +@end table