algebra 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +53 -0
  3. data/.travis.yml +7 -0
  4. data/CODE_OF_CONDUCT.md +49 -0
  5. data/Gemfile +7 -0
  6. data/Gemfile.lock +28 -0
  7. data/LICENSE.txt +21 -0
  8. data/README-ja.txt +60 -0
  9. data/README.md +61 -0
  10. data/Rakefile +43 -0
  11. data/algebra.gemspec +33 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/doc-ja/README-ja.html +69 -0
  15. data/doc-ja/README-ja.rd +60 -0
  16. data/doc-ja/README.html +0 -0
  17. data/doc-ja/README.rd +0 -0
  18. data/doc-ja/algebra-ja.html +66 -0
  19. data/doc-ja/algebra-ja.rd +60 -0
  20. data/doc-ja/algebraic-equation-ja.html +36 -0
  21. data/doc-ja/algebraic-equation-ja.rd +26 -0
  22. data/doc-ja/algebraic-extension-field-ja.html +122 -0
  23. data/doc-ja/algebraic-extension-field-ja.rd +118 -0
  24. data/doc-ja/algebraic-parser-ja.html +87 -0
  25. data/doc-ja/algebraic-parser-ja.rd +95 -0
  26. data/doc-ja/changes.html +161 -0
  27. data/doc-ja/changes.rd +119 -0
  28. data/doc-ja/elementary-divisor-ja.html +56 -0
  29. data/doc-ja/elementary-divisor-ja.rd +45 -0
  30. data/doc-ja/euclidian-ring-ja.html +78 -0
  31. data/doc-ja/euclidian-ring-ja.rd +69 -0
  32. data/doc-ja/finite-group-ja.html +285 -0
  33. data/doc-ja/finite-group-ja.rd +276 -0
  34. data/doc-ja/finite-map-ja.html +224 -0
  35. data/doc-ja/finite-map-ja.rd +227 -0
  36. data/doc-ja/finite-set-ja.html +393 -0
  37. data/doc-ja/finite-set-ja.rd +408 -0
  38. data/doc-ja/index-ja.html +113 -0
  39. data/doc-ja/index-ja.rd +112 -0
  40. data/doc-ja/jordan-form-ja.html +106 -0
  41. data/doc-ja/jordan-form-ja.rd +99 -0
  42. data/doc-ja/localized-ring-ja.html +121 -0
  43. data/doc-ja/localized-ring-ja.rd +131 -0
  44. data/doc-ja/m-polynomial-ja.html +542 -0
  45. data/doc-ja/m-polynomial-ja.rd +596 -0
  46. data/doc-ja/matrix-algebra-ja.html +686 -0
  47. data/doc-ja/matrix-algebra-ja.rd +727 -0
  48. data/doc-ja/matrix-algebra-triplet-ja.html +124 -0
  49. data/doc-ja/matrix-algebra-triplet-ja.rd +129 -0
  50. data/doc-ja/permutation-group-ja.html +159 -0
  51. data/doc-ja/permutation-group-ja.rd +151 -0
  52. data/doc-ja/polynomial-converter-ja.html +64 -0
  53. data/doc-ja/polynomial-converter-ja.rd +54 -0
  54. data/doc-ja/polynomial-ja.html +446 -0
  55. data/doc-ja/polynomial-ja.rd +473 -0
  56. data/doc-ja/residue-class-ring-ja.html +112 -0
  57. data/doc-ja/residue-class-ring-ja.rd +113 -0
  58. data/doc-ja/sample-algebraic-equation01.rb.v.rd +11 -0
  59. data/doc-ja/sample-algebraic-equation02.rb.v.rd +11 -0
  60. data/doc-ja/sample-algebraic-root01.rb.v.rd +20 -0
  61. data/doc-ja/sample-algebraicfield01.rb.v.rd +26 -0
  62. data/doc-ja/sample-algebraicfield02.rb.v.rd +15 -0
  63. data/doc-ja/sample-cayleyhamilton01.rb.v.rd +14 -0
  64. data/doc-ja/sample-diagonalization01.rb.v.rd +48 -0
  65. data/doc-ja/sample-divmod01.rb.v.rd +17 -0
  66. data/doc-ja/sample-elementary-divisor01.rb.v.rd +48 -0
  67. data/doc-ja/sample-factorize01.rb.v.rd +11 -0
  68. data/doc-ja/sample-factorize02.rb.v.rd +13 -0
  69. data/doc-ja/sample-factorize03.rb.v.rd +14 -0
  70. data/doc-ja/sample-factorize04.rb.v.rd +14 -0
  71. data/doc-ja/sample-factorize05.rb.v.rd +53 -0
  72. data/doc-ja/sample-galois-group01.rb.v.rd +27 -0
  73. data/doc-ja/sample-gaussian-elimination01.rb.v.rd +19 -0
  74. data/doc-ja/sample-geometry01.rb.v.rd +33 -0
  75. data/doc-ja/sample-geometry02.rb.v.rd +34 -0
  76. data/doc-ja/sample-geometry03.rb.v.rd +45 -0
  77. data/doc-ja/sample-geometry04.rb.v.rd +33 -0
  78. data/doc-ja/sample-geometry07.rb.v.rd +62 -0
  79. data/doc-ja/sample-groebner01.rb.v.rd +13 -0
  80. data/doc-ja/sample-groebner02.rb.v.rd +18 -0
  81. data/doc-ja/sample-groebner03.rb.v.rd +19 -0
  82. data/doc-ja/sample-group01.rb.v.rd +21 -0
  83. data/doc-ja/sample-jordan-form01.rb.v.rd +56 -0
  84. data/doc-ja/sample-jordanform01.rb.v.rd +55 -0
  85. data/doc-ja/sample-lagrange-multiplier01.rb.v.rd +35 -0
  86. data/doc-ja/sample-m-factorize01.rb.v.rd +15 -0
  87. data/doc-ja/sample-m-factorize02.rb.v.rd +12 -0
  88. data/doc-ja/sample-m-polynomial01.rb.v.rd +10 -0
  89. data/doc-ja/sample-map01.rb.v.rd +9 -0
  90. data/doc-ja/sample-polynomial01.rb.v.rd +9 -0
  91. data/doc-ja/sample-polynomial02.rb.v.rd +11 -0
  92. data/doc-ja/sample-primefield01.rb.v.rd +13 -0
  93. data/doc-ja/sample-quotientfield01.rb.v.rd +11 -0
  94. data/doc-ja/sample-quotientfield02.rb.v.rd +18 -0
  95. data/doc-ja/sample-quotientfield03.rb.v.rd +16 -0
  96. data/doc-ja/sample-quotientfield04.rb.v.rd +16 -0
  97. data/doc-ja/sample-set01.rb.v.rd +18 -0
  98. data/doc-ja/sample-splitting-field01.rb.v.rd +19 -0
  99. data/doc-ja/samples-ja.html +885 -0
  100. data/doc-ja/samples-ja.rd +221 -0
  101. data/doc-ja/style.css +85 -0
  102. data/doc-ja/todo.html +20 -0
  103. data/doc-ja/todo.rd +9 -0
  104. data/lib/algebra.rb +36 -0
  105. data/lib/algebra/algebraic-equation.rb +56 -0
  106. data/lib/algebra/algebraic-extension-field.rb +135 -0
  107. data/lib/algebra/algebraic-parser.rb +160 -0
  108. data/lib/algebra/algebraic-system.rb +224 -0
  109. data/lib/algebra/annihilate.rb +52 -0
  110. data/lib/algebra/array-supplement.rb +53 -0
  111. data/lib/algebra/auto-require.rb +84 -0
  112. data/lib/algebra/chinese-rem-th.rb +135 -0
  113. data/lib/algebra/combinatorial.rb +145 -0
  114. data/lib/algebra/elementary-divisor.rb +193 -0
  115. data/lib/algebra/euclidian-ring.rb +161 -0
  116. data/lib/algebra/factors.rb +305 -0
  117. data/lib/algebra/finite-group.rb +374 -0
  118. data/lib/algebra/finite-map.rb +201 -0
  119. data/lib/algebra/finite-set.rb +456 -0
  120. data/lib/algebra/galois-group.rb +129 -0
  121. data/lib/algebra/gaussian-elimination.rb +385 -0
  122. data/lib/algebra/groebner-basis-coeff.rb +228 -0
  123. data/lib/algebra/groebner-basis.rb +197 -0
  124. data/lib/algebra/import-module-single-thread.rb +86 -0
  125. data/lib/algebra/import-module.rb +491 -0
  126. data/lib/algebra/jordan-form.rb +114 -0
  127. data/lib/algebra/linear-algebra.rb +143 -0
  128. data/lib/algebra/localized-ring.rb +294 -0
  129. data/lib/algebra/m-index.rb +282 -0
  130. data/lib/algebra/m-polynomial-factor-int.rb +186 -0
  131. data/lib/algebra/m-polynomial-factor-zp.rb +114 -0
  132. data/lib/algebra/m-polynomial-factor.rb +315 -0
  133. data/lib/algebra/m-polynomial-gcd.rb +40 -0
  134. data/lib/algebra/m-polynomial.rb +875 -0
  135. data/lib/algebra/matrix-algebra-triplet.rb +292 -0
  136. data/lib/algebra/matrix-algebra.rb +929 -0
  137. data/lib/algebra/numeric-supplement.rb +123 -0
  138. data/lib/algebra/permutation-group.rb +257 -0
  139. data/lib/algebra/polynomial-converter.rb +193 -0
  140. data/lib/algebra/polynomial-factor-alg.rb +148 -0
  141. data/lib/algebra/polynomial-factor-int.rb +252 -0
  142. data/lib/algebra/polynomial-factor-zp.rb +165 -0
  143. data/lib/algebra/polynomial-factor.rb +140 -0
  144. data/lib/algebra/polynomial.rb +592 -0
  145. data/lib/algebra/powers.rb +31 -0
  146. data/lib/algebra/prime-gen.rb +32 -0
  147. data/lib/algebra/rational.rb +81 -0
  148. data/lib/algebra/residue-class-ring.rb +219 -0
  149. data/lib/algebra/sets-system.rb +43 -0
  150. data/lib/algebra/splitting-field.rb +103 -0
  151. data/lib/algebra/version.rb +3 -0
  152. data/sample/Makefile +10 -0
  153. data/sample/do-testscripts.rb +100 -0
  154. data/sample/sample-algebraic-equation01.rb +6 -0
  155. data/sample/sample-algebraic-equation02.rb +6 -0
  156. data/sample/sample-algebraic-root01.rb +15 -0
  157. data/sample/sample-algebraicfield01.rb +21 -0
  158. data/sample/sample-algebraicfield02.rb +10 -0
  159. data/sample/sample-cayleyhamilton01.rb +9 -0
  160. data/sample/sample-diagonalization01.rb +43 -0
  161. data/sample/sample-divmod01.rb +12 -0
  162. data/sample/sample-elementary-divisor01.rb +43 -0
  163. data/sample/sample-factorize01.rb +6 -0
  164. data/sample/sample-factorize02.rb +8 -0
  165. data/sample/sample-factorize03.rb +9 -0
  166. data/sample/sample-factorize04.rb +9 -0
  167. data/sample/sample-factorize05.rb +48 -0
  168. data/sample/sample-galois-group01.rb +22 -0
  169. data/sample/sample-gaussian-elimination01.rb +14 -0
  170. data/sample/sample-geometry01.rb +28 -0
  171. data/sample/sample-geometry02.rb +29 -0
  172. data/sample/sample-geometry03.rb +40 -0
  173. data/sample/sample-geometry04.rb +28 -0
  174. data/sample/sample-geometry07.rb +58 -0
  175. data/sample/sample-groebner01.rb +8 -0
  176. data/sample/sample-groebner02.rb +13 -0
  177. data/sample/sample-groebner03.rb +14 -0
  178. data/sample/sample-group01.rb +16 -0
  179. data/sample/sample-jordan-form01.rb +51 -0
  180. data/sample/sample-lagrange-multiplier01.rb +30 -0
  181. data/sample/sample-m-factorize01.rb +10 -0
  182. data/sample/sample-m-factorize02.rb +7 -0
  183. data/sample/sample-m-polynomial01.rb +5 -0
  184. data/sample/sample-map01.rb +4 -0
  185. data/sample/sample-polynomial01.rb +4 -0
  186. data/sample/sample-polynomial02.rb +6 -0
  187. data/sample/sample-primefield01.rb +8 -0
  188. data/sample/sample-quotientfield01.rb +6 -0
  189. data/sample/sample-quotientfield02.rb +13 -0
  190. data/sample/sample-quotientfield03.rb +11 -0
  191. data/sample/sample-quotientfield04.rb +11 -0
  192. data/sample/sample-set01.rb +13 -0
  193. data/sample/sample-splitting-field01.rb +14 -0
  194. data/sample/test-00-cayley-hamilton.rb +76 -0
  195. data/sample/test-00-groebner-basis.rb +274 -0
  196. data/sample/test-00-polynomial-factor-alg.rb +89 -0
  197. data/sample/test-00.list +4 -0
  198. data/sample/time-trial.rb +65 -0
  199. metadata +373 -0
@@ -0,0 +1,112 @@
1
+ =begin
2
+ [((<README-ja|URL:README-ja.html>))] [((<English|URL:../doc/index.html>))]
3
+ = 代数パッケージ
4
+
5
+ Version: 0.72 (2006.09.16)
6
+ Author: 原 信一郎 (sinara@blade.nagaokaut.ac.jp)
7
+
8
+ これは1変数あるいは多変数の多項式を計算するためのライブラリです。
9
+
10
+ == 0. 最初の一歩
11
+
12
+ 最も簡単な利用法は require "algebra" として、計算を始めることです。
13
+
14
+ require "algebra"
15
+ x = Polynomial(Integer, "x").var
16
+ puts( (x+1)**7 )
17
+ #=> x^7 + 7x^6 + 21x^5 + 35x^4 + 35x^3 + 21x^2 + 7x + 1
18
+ puts( (x**7 + 7*x**6 + 21*x**5 + 35*x**4 + 35*x**3 + 21*x**2 + 7*x + 1).factorize )
19
+ #=> (x + 1)^7
20
+
21
+ == 1. 例題
22
+
23
+ * ((<Samples|URL:samples-ja.html>))
24
+
25
+ == 2. 主なクラス・モジュール
26
+
27
+ * ((<Algebra|URL:algebra-ja.html>)) (代数モジュール)
28
+ * ((<Algebra::Polynomial|URL:polynomial-ja.html>)) (1変数多項式環クラス)
29
+ * ((<Algebra::EuclidianRing|URL:euclidian-ring-ja.html>)) (ユークリッド環モジュール)
30
+ * ((<Algebra::MPolynomial|URL:m-polynomial-ja.html>)) (多変数多項式環クラス)
31
+ * ((<Algebra::ResidueClassRing|URL:residue-class-ring-ja.html>)) (剰余環クラス)
32
+ * ((<Algebra::AlgebraicExtensionField|URL:algebraic-extension-field-ja.html>)) (代数拡大体クラス)
33
+ * ((<Algebra::LocalizedRing|URL:localized-ring-ja.html>)) (局所化環クラス)
34
+ * ((<Algebra::MatrixAlgebra|URL:matrix-algebra-ja.html>)) (行列代数クラス)
35
+ * ((<Algebra::AlgebraicParser|URL:algebraic-parser-ja.html>)) (代数式を表す文字列の評価クラス)
36
+ * ((<Algebra::Set|URL:finite-set-ja.html>)) (集合のクラス)
37
+ * ((<Algebra::Map|URL:finite-map-ja.html>)) (写像のクラス)
38
+ * ((<Algebra::Group|URL:finite-group-ja.html>)) (群のクラス)
39
+ * ((<Algebra::PermutationGroup|URL:permutation-group-ja.html>)) (置換群のクラス)
40
+ == 3. その他
41
+
42
+ * ((<Algebra::ElementaryDivisor|URL:elementary-divisor-ja.html>)) (単因子モジュール)
43
+ * ((<Algebra::JordanForm|URL:jordan-form-ja.html>)) (ジョルダン行列クラス)
44
+ * ((<Algebra::MatrixAlgebraTriplet|URL:matrix-algebra-triplet-ja.html>)) (3つ組行列のクラス)
45
+ * ((<代数方程式ハンドルユーティリティー|URL:algebraic-equation-ja.html>))
46
+ * ((<多項式環相互変換ユーティリティー|URL:polynomial-converter-ja.html>))
47
+
48
+ == 4. パッケージ内容
49
+
50
+ === 総合
51
+ algebra.rb Algebra ライブラリ一般利用ファイル
52
+
53
+ === 一変数関係
54
+ polynomial.rb 1変数多項式環のクラス
55
+ euclidian-ring.rb ユークリッド整域ユティリティー(G.C.D.の計算)
56
+ polynomial-factor.rb 1変数多項式因数分解ライブラリ
57
+ polynomial-factor-int.rb 整数係数版
58
+ polynomial-factor-zp.rb Zp係数版
59
+ polynomial-factor-alg.rb 代数的数係数版
60
+
61
+ === 多変数関係
62
+ m-polynomial.rb 多変数多項式環のクラス
63
+ m-index.rb m-polynomial.rb の下請け
64
+ m-polynomial-factor.rb 1変数多項式因数分解ライブラリ
65
+ m-polynomial-factor-int.rb 整数係数版
66
+ m-polynomial-factor-zp.rb Zp係数版
67
+ groebner-basis.rb グレブナ基底の計算モジュール
68
+ groebner-basis-coeff.rb 除算の計算モジュール
69
+
70
+ === 代数全般
71
+ localized-ring.rb 商体作成ライブラリ
72
+ matrix-algebra.rb 行列代数のクラス
73
+ elementary-divisor.rb 単因子操作モジュール
74
+ matrix-algebra.triplete.rb 3つ組行列クラス
75
+ jordan-form.rb ジョルダン行列クラス
76
+ residue-class-ring.rb 多項式環の剰余環
77
+ algebraic-extention-field.rb 代数拡大体
78
+ splitting-field.rb 多項式の最小分解体
79
+ galois-group.rb Galois 群
80
+ linear-algebra.rb 線形代数ライブラリ
81
+ algebraic-equation.rb 代数方程式ライブラリ
82
+
83
+ === 基礎部分
84
+
85
+ finite-set.rb 集合のクラス
86
+ finite-map.rb 写像のクラス
87
+ finite-group.rb 群のクラス
88
+ permutation-group.rb 置換群のクラス
89
+
90
+ === 共通部分
91
+ prime-gen.rb 素数生成クラス
92
+ numeric-supplement.rb Numeric の補完
93
+ polynomial-converter.rb 多項式環相互変換ユーティリティー
94
+ algebra-system.rb 代数系の共通仕様
95
+ algebraic-parser.rb 多元環の式の文字列表現を評価するモジュール
96
+
97
+ === その他
98
+ array-supplement.rb Array の補完
99
+ doc-ja/ マニュアル日本語版(RD, HTML, TXT)
100
+ doc/ マニュアル英語版(RD, HTML, TXT)
101
+ sample/ サンプルコード
102
+ work/ (開発作業場所)
103
+
104
+ == 5. ToDo
105
+ #<<< todo.rd
106
+ * ((<todo.html|URL:todo.html>))
107
+
108
+ == 6. Changes
109
+ #<<< changes.rd
110
+ * ((<changes.html|URL:changes.html>))
111
+
112
+ =end
@@ -0,0 +1,106 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml">
6
+ <head>
7
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
8
+ <title>doc-ja/jordan-form-ja.rd</title>
9
+ <link href="style.css" type="text/css" rel="stylesheet" />
10
+ </head>
11
+ <body>
12
+ <p>[<a href="index-ja.html">index-ja</a>] </p>
13
+ <h1><a name="label-0" id="label-0">Algebra::JordanForm</a></h1><!-- RDLabel: "Algebra::JordanForm" -->
14
+ <p><em>(ジョルダン行列クラス)</em></p>
15
+ <p>ジョルダン行列を表現するクラスです。</p>
16
+ <h2><a name="label-1" id="label-1">ファイル名:</a></h2><!-- RDLabel: "ファイル名:" -->
17
+ <ul>
18
+ <li><var>jordan-form.rb</var></li>
19
+ </ul>
20
+ <h2><a name="label-2" id="label-2">スーパークラス:</a></h2><!-- RDLabel: "スーパークラス:" -->
21
+ <ul>
22
+ <li><var>Object</var></li>
23
+ </ul>
24
+ <h2><a name="label-3" id="label-3">インクルードしているモジュール:</a></h2><!-- RDLabel: "インクルードしているモジュール:" -->
25
+ <p>なし</p>
26
+ <h2><a name="label-4" id="label-4">関連する関数:</a></h2><!-- RDLabel: "関連する関数:" -->
27
+ <dl>
28
+ <dt><a name="label-5" id="label-5"><code>Algebra::MatrixAlgebra#jordan_form</code></a></dt><!-- RDLabel: "Algebra::MatrixAlgebra#jordan_form" -->
29
+ <dd>
30
+ <var>self</var>のジョルダン標準形を返します。</dd>
31
+ <dt><a name="label-6" id="label-6"><code>Algebra::MatrixAlgebra#jordan_form_info</code></a></dt><!-- RDLabel: "Algebra::MatrixAlgebra#jordan_form_info" -->
32
+ <dd>
33
+ <!-- Reference, RDLabel "Algebra::JordanForm.decompose" doesn't exist --><em class="label-not-found">Algebra::JordanForm.decompose</em><!-- Reference end -->(self) と同じです。</dd>
34
+ </dl>
35
+ <h2><a name="label-7" id="label-7">クラスメソッド:</a></h2><!-- RDLabel: "クラスメソッド:" -->
36
+ <dl>
37
+ <dt><a name="label-8" id="label-8"><code>::new(<var>array</var>)</code></a></dt><!-- RDLabel: "::new" -->
38
+ <dd>
39
+ <p><!-- Reference, RDLabel "JordanForm" doesn't exist --><em class="label-not-found">JordanForm</em><!-- Reference end --> オブジェクトを返します。<var>array</var> は、
40
+ <code>[対角成分, サイズ]</code> を要素とする配列です。行列を得るには
41
+ メソッド <a href="#label-12">to_matrix</a> を施すことにより、(上三角)ジョルダン
42
+ 行列が得られます。下三角にするには<a href="#label-14">to_matrix_l</a>を用います。</p>
43
+ <p>例:</p>
44
+ <pre>j = Algebra::JordanForm.new([[2, 3], [-1, 2]])
45
+ j.to_matrix.display #=&gt;
46
+ # 2, 1, 0, 0, 0
47
+ # 0, 2, 1, 0, 0
48
+ # 0, 0, 2, 0, 0
49
+ # 0, 0, 0, -1, 1
50
+ # 0, 0, 0, 0, -1</pre></dd>
51
+ <dt><a name="label-9" id="label-9"><code>::construct(<var>elem_divs</var>, <var>facts</var>, <var>field</var>, <var>pfield</var>)</code></a></dt><!-- RDLabel: "::construct" -->
52
+ <dd>
53
+ 略。</dd>
54
+ <dt><a name="label-10" id="label-10"><code>::decompose(<var>m</var>)</code></a></dt><!-- RDLabel: "::decompose" -->
55
+ <dd>
56
+ <p>行列 <var>m</var> のジョルダン行列を <var>jm</var>、<var>m</var> を <var>jm</var> に
57
+ 変形するために必要な左変形を <var>tL</var>、右変形を <var>sR</var>、ジョルダン
58
+ 分解をするのに必要な最小分解体を <var>field</var> 、最小分解体まで基礎体
59
+ を拡大するのに必要な方程式の配列を <var>modulus</var> とするとき、</p>
60
+ <pre>[jm, tL, sR, field, modulus]</pre>
61
+ <p>を返します。(<code>tL * sR == 単位行列</code> です。)</p>
62
+ <p>例:</p>
63
+ <pre>m = Algebra.SquareMatrix(Rational, a.size)[
64
+ [-1, 1, 2, -1],
65
+ [-5, 3, 4, -2],
66
+ [3, -1, 0, 1],
67
+ [5, -2, -2, 0]
68
+ ]
69
+ jf, p, q, field, modulus = Algebra::JordanForm.decompose(m)
70
+ jf.display; puts #=&gt;
71
+ # 2, 0, 0, 0
72
+ # 0, a, 0, 0
73
+ # 0, 0, b, 0
74
+ # 0, 0, 0, -b - a
75
+
76
+ p modulus #=&gt; [a^3 + 3a - 1, b^2 + ab + a^2 + 3]
77
+
78
+ print "P =\n"; p.display; puts
79
+ print "P^-1 =\n"; q.display; puts
80
+
81
+ m = m.convert_to(field)
82
+ p jf == p * m * q #=&gt; true</pre></dd>
83
+ </dl>
84
+ <h2><a name="label-11" id="label-11">メソッド:</a></h2><!-- RDLabel: "メソッド:" -->
85
+ <dl>
86
+ <dt><a name="label-12" id="label-12"><code>to_matrix(<var>ring</var>)</code></a></dt><!-- RDLabel: "to_matrix" -->
87
+ <dd>
88
+ <p><var>ring</var> 上のジョルダン行列(上三角)を返します。</p>
89
+ <p>例:</p>
90
+ <pre>j = Algebra::JordanForm.new([[2, 3], [-1, 2]])
91
+ j.to_matrix(Integer).display #=&gt;
92
+ # 2, 1, 0, 0, 0
93
+ # 0, 2, 1, 0, 0
94
+ # 0, 0, 2, 0, 0
95
+ # 0, 0, 0, -1, 1
96
+ # 0, 0, 0, 0, -1</pre></dd>
97
+ <dt><a name="label-13" id="label-13"><code>to_matrix_r(<var>ring</var>)</code></a></dt><!-- RDLabel: "to_matrix_r" -->
98
+ <dd>
99
+ <a href="#label-12">to_matrix</a> と同じ。</dd>
100
+ <dt><a name="label-14" id="label-14"><code>to_matrix_l(<var>ring</var>)</code></a></dt><!-- RDLabel: "to_matrix_l" -->
101
+ <dd>
102
+ ジョルダン行列(下三角)を返します。</dd>
103
+ </dl>
104
+
105
+ </body>
106
+ </html>
@@ -0,0 +1,99 @@
1
+ =begin
2
+ [((<index-ja|URL:index-ja.html>))]
3
+ = Algebra::JordanForm
4
+ ((*(ジョルダン行列クラス)*))
5
+
6
+ ジョルダン行列を表現するクラスです。
7
+
8
+ == ファイル名:
9
+ * ((|jordan-form.rb|))
10
+
11
+ == スーパークラス:
12
+
13
+ * ((|Object|))
14
+
15
+ == インクルードしているモジュール:
16
+
17
+ なし
18
+
19
+ == 関連する関数:
20
+
21
+ --- Algebra::MatrixAlgebra#jordan_form
22
+ ((|self|))のジョルダン標準形を返します。
23
+
24
+ --- Algebra::MatrixAlgebra#jordan_form_info
25
+ ((<Algebra::JordanForm.decompose>))(self) と同じです。
26
+
27
+ == クラスメソッド:
28
+
29
+ --- ::new(array)
30
+ ((<JordanForm>)) オブジェクトを返します。((|array|)) は、
31
+ (({[対角成分, サイズ]})) を要素とする配列です。行列を得るには
32
+ メソッド ((<to_matrix>)) を施すことにより、(上三角)ジョルダン
33
+ 行列が得られます。下三角にするには((<to_matrix_l>))を用います。
34
+
35
+ 例:
36
+ j = Algebra::JordanForm.new([[2, 3], [-1, 2]])
37
+ j.to_matrix.display #=>
38
+ # 2, 1, 0, 0, 0
39
+ # 0, 2, 1, 0, 0
40
+ # 0, 0, 2, 0, 0
41
+ # 0, 0, 0, -1, 1
42
+ # 0, 0, 0, 0, -1
43
+
44
+ --- ::construct(elem_divs, facts, field, pfield)
45
+ 略。
46
+
47
+ --- ::decompose(m)
48
+ 行列 ((|m|)) のジョルダン行列を ((|jm|))、((|m|)) を ((|jm|)) に
49
+ 変形するために必要な左変形を ((|tL|))、右変形を ((|sR|))、ジョルダン
50
+ 分解をするのに必要な最小分解体を ((|field|)) 、最小分解体まで基礎体
51
+ を拡大するのに必要な方程式の配列を ((|modulus|)) とするとき、
52
+
53
+ [jm, tL, sR, field, modulus]
54
+
55
+ を返します。((({tL * sR == 単位行列})) です。)
56
+
57
+ 例:
58
+ m = Algebra.SquareMatrix(Rational, a.size)[
59
+ [-1, 1, 2, -1],
60
+ [-5, 3, 4, -2],
61
+ [3, -1, 0, 1],
62
+ [5, -2, -2, 0]
63
+ ]
64
+ jf, p, q, field, modulus = Algebra::JordanForm.decompose(m)
65
+ jf.display; puts #=>
66
+ # 2, 0, 0, 0
67
+ # 0, a, 0, 0
68
+ # 0, 0, b, 0
69
+ # 0, 0, 0, -b - a
70
+
71
+ p modulus #=> [a^3 + 3a - 1, b^2 + ab + a^2 + 3]
72
+
73
+ print "P =\n"; p.display; puts
74
+ print "P^-1 =\n"; q.display; puts
75
+
76
+ m = m.convert_to(field)
77
+ p jf == p * m * q #=> true
78
+
79
+ == メソッド:
80
+
81
+ --- to_matrix(ring)
82
+ ((|ring|)) 上のジョルダン行列(上三角)を返します。
83
+
84
+ 例:
85
+ j = Algebra::JordanForm.new([[2, 3], [-1, 2]])
86
+ j.to_matrix(Integer).display #=>
87
+ # 2, 1, 0, 0, 0
88
+ # 0, 2, 1, 0, 0
89
+ # 0, 0, 2, 0, 0
90
+ # 0, 0, 0, -1, 1
91
+ # 0, 0, 0, 0, -1
92
+
93
+ --- to_matrix_r(ring)
94
+ ((<to_matrix>)) と同じ。
95
+
96
+ --- to_matrix_l(ring)
97
+ ジョルダン行列(下三角)を返します。
98
+
99
+ =end
@@ -0,0 +1,121 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml">
6
+ <head>
7
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
8
+ <title>doc-ja/localized-ring-ja.rd</title>
9
+ <link href="style.css" type="text/css" rel="stylesheet" />
10
+ </head>
11
+ <body>
12
+ <p>[<a href="index-ja.html">index-ja</a>] </p>
13
+ <h1><a name="label-0" id="label-0">Algebra::LocalizedRing</a></h1><!-- RDLabel: "Algebra::LocalizedRing" -->
14
+ <p><em>(局所化環クラス)</em></p>
15
+ <p>与えられた環を分子・分母にした分数環を構成します。
16
+ 実際のクラスを生成するには、クラスメソッド <a href="#label-9">::create</a>
17
+ あるいは関数 <a href="#label-5">Algebra.LocalizedRing</a>() を用います。</p>
18
+ <h2><a name="label-1" id="label-1">ファイル名:</a></h2><!-- RDLabel: "ファイル名:" -->
19
+ <ul>
20
+ <li><var>localized-ring.rb</var></li>
21
+ </ul>
22
+ <h2><a name="label-2" id="label-2">スーパークラス:</a></h2><!-- RDLabel: "スーパークラス:" -->
23
+ <ul>
24
+ <li><var>Object</var></li>
25
+ </ul>
26
+ <h2><a name="label-3" id="label-3">インクルードしているモジュール:</a></h2><!-- RDLabel: "インクルードしているモジュール:" -->
27
+ <p>なし</p>
28
+ <h2><a name="label-4" id="label-4">関連する関数:</a></h2><!-- RDLabel: "関連する関数:" -->
29
+ <dl>
30
+ <dt><a name="label-5" id="label-5"><code>Algebra.LocalizedRing(<var>ring</var>)</code></a></dt><!-- RDLabel: "Algebra.LocalizedRing" -->
31
+ <dd>
32
+ <a href="#label-9">::create</a>(ring) と同じです。</dd>
33
+ <dt><a name="label-6" id="label-6"><code>Algebra.RationalFunctionField(<var>ring</var>, <var>obj</var>)</code></a></dt><!-- RDLabel: "Algebra.RationalFunctionField" -->
34
+ <dd>
35
+ <p>環 <var>ring</var>、変数を表すオブジェクトを <var>obj</var> として有理関数体
36
+ を作ります。クラスメソッド <var>::var</var> で変数を得ることができます。</p>
37
+ <p>例: 有理関数体</p>
38
+ <pre>require "algebra/localized-ring"
39
+ require "rational"
40
+ F = Algebra.RationalFunctionField(Rational, "x")
41
+ x = F.var
42
+ p ( 1 / (x**2 - 1) - 1 / (x**3 - 1) )
43
+ #=&gt; x^2/(x^4 + x^3 - x - 1)</pre></dd>
44
+ <dt><a name="label-7" id="label-7"><code>Algebra.MRationalFunctionField(<var>ring</var>, [<var>obj1</var>[, <var>obj2</var>, ...]])</code></a></dt><!-- RDLabel: "Algebra.MRationalFunctionField" -->
45
+ <dd>
46
+ <p>環 <var>ring</var>、変数を表すオブジェクトを <var>obj1</var>, <var>obj2</var>,... として有理関数体を作ります。クラスメソッド <var>::vars</var> で変数を得ることができます。</p>
47
+ <p>例: 有理関数体</p>
48
+ <pre>require "algebra/localized-ring"
49
+ require "rational"
50
+ G = Algebra.MRationalFunctionField(Rational, "x", "y", "z")
51
+ x, y, z = G.vars
52
+ f = (x + z) / (x + y) - z / (x + y)
53
+ p f #=&gt; (x^2 + xy)/(x^2 + 2xy + y^2)
54
+ p f.simplify #=&gt; x/(x + y)</pre></dd>
55
+ </dl>
56
+ <h2><a name="label-8" id="label-8">クラスメソッド:</a></h2><!-- RDLabel: "クラスメソッド:" -->
57
+ <dl>
58
+ <dt><a name="label-9" id="label-9"><code>::create(<var>ring</var>)</code></a></dt><!-- RDLabel: "::create" -->
59
+ <dd>
60
+ <p>クラス<var>ring</var>で表現されるを環の元を分子・分母とする分数環
61
+ を作ります。</p>
62
+ <p>この戻り値は Algebra::LocalizedRing クラスのサブクラスです。
63
+ このサブクラスにはクラスメソッドとして <var>::ground</var> が定義され
64
+ <var>ring</var> を返します。</p>
65
+ <p>生成したクラスにはクラスメソッド<code>::[]</code>が定義され、基礎環の
66
+ 元 <code>x</code> に対して分数環の元 <code>x/1</code> を返します。</p>
67
+ <p>例: 有理数を作る</p>
68
+ <pre>require "localized-ring"
69
+ F = Algebra.LocalizedRing(Integer)
70
+ p F.new(1, 2) + F.new(2, 3) #=&gt; 7/6</pre>
71
+ <p>例: 整数上の多項式環の商体</p>
72
+ <pre>require "polynomial"
73
+ require "localized-ring"
74
+ P = Algebra.Polynomial(Integer, "x")
75
+ F = Algebra.LocalizedRing(P)
76
+ x = F[P.var]
77
+ p ( 1 / (x**2 - 1) - 1 / (x**3 - 1) )
78
+ #=&gt; (x^3 - x^2)/(x^5 - x^3 - x^2 + 1)</pre></dd>
79
+ <dt><a name="label-10" id="label-10"><code>::zero</code></a></dt><!-- RDLabel: "::zero" -->
80
+ <dd>
81
+ 零元を返します。</dd>
82
+ <dt><a name="label-11" id="label-11"><code>::unity</code></a></dt><!-- RDLabel: "::unity" -->
83
+ <dd>
84
+ 単位元を返します。</dd>
85
+ </dl>
86
+ <h2><a name="label-12" id="label-12">メソッド:</a></h2><!-- RDLabel: "メソッド:" -->
87
+ <dl>
88
+ <dt><a name="label-13" id="label-13"><code>zero?</code></a></dt><!-- RDLabel: "zero?" -->
89
+ <dd>
90
+ 零元であるとき真を返します。</dd>
91
+ <dt><a name="label-14" id="label-14"><code>zero</code></a></dt><!-- RDLabel: "zero" -->
92
+ <dd>
93
+ 零元を返します。</dd>
94
+ <dt><a name="label-15" id="label-15"><code>unity</code></a></dt><!-- RDLabel: "unity" -->
95
+ <dd>
96
+ 単位元を返します。</dd>
97
+ <dt><a name="label-16" id="label-16"><code>==(<var>other</var>)</code></a></dt><!-- RDLabel: "==" -->
98
+ <dd>
99
+ 等しいとき真を返します。</dd>
100
+ <dt><a name="label-17" id="label-17"><code>&lt;=&gt;(<var>other</var>)</code></a></dt><!-- RDLabel: "<=>" -->
101
+ <dd>
102
+ 大小関係を求めます。</dd>
103
+ <dt><a name="label-18" id="label-18"><code>+(<var>other</var>)</code></a></dt><!-- RDLabel: "+" -->
104
+ <dd>
105
+ 和を計算します。</dd>
106
+ <dt><a name="label-19" id="label-19"><code>-(<var>other</var>)</code></a></dt><!-- RDLabel: "-" -->
107
+ <dd>
108
+ 差を計算します。</dd>
109
+ <dt><a name="label-20" id="label-20"><code>*(<var>other</var>)</code></a></dt><!-- RDLabel: "*" -->
110
+ <dd>
111
+ 積を計算します。</dd>
112
+ <dt><a name="label-21" id="label-21"><code>**(<var>n</var>)</code></a></dt><!-- RDLabel: "**" -->
113
+ <dd>
114
+ <var>n</var> 乗を計算します。</dd>
115
+ <dt><a name="label-22" id="label-22"><code>/(<var>other</var>)</code></a></dt><!-- RDLabel: "/" -->
116
+ <dd>
117
+ 商を計算します。</dd>
118
+ </dl>
119
+
120
+ </body>
121
+ </html>
@@ -0,0 +1,131 @@
1
+ =begin
2
+ [((<index-ja|URL:index-ja.html>))]
3
+ = Algebra::LocalizedRing
4
+ ((*(局所化環クラス)*))
5
+
6
+ 与えられた環を分子・分母にした分数環を構成します。
7
+ 実際のクラスを生成するには、クラスメソッド ((<::create>))
8
+ あるいは関数 ((<Algebra.LocalizedRing>))() を用います。
9
+
10
+ == ファイル名:
11
+ * ((|localized-ring.rb|))
12
+
13
+ == スーパークラス:
14
+
15
+ * ((|Object|))
16
+
17
+ == インクルードしているモジュール:
18
+
19
+ なし
20
+
21
+ == 関連する関数:
22
+
23
+ --- Algebra.LocalizedRing(ring)
24
+ ((<::create>))(ring) と同じです。
25
+
26
+ --- Algebra.RationalFunctionField(ring, obj)
27
+ 環 ((|ring|))、変数を表すオブジェクトを ((|obj|)) として有理関数体
28
+ を作ります。クラスメソッド ((|::var|)) で変数を得ることができます。
29
+
30
+ 例: 有理関数体
31
+ require "algebra/localized-ring"
32
+ require "rational"
33
+ F = Algebra.RationalFunctionField(Rational, "x")
34
+ x = F.var
35
+ p ( 1 / (x**2 - 1) - 1 / (x**3 - 1) )
36
+ #=> x^2/(x^4 + x^3 - x - 1)
37
+
38
+ --- Algebra.MRationalFunctionField(ring, [obj1[, obj2, ...]])
39
+ 環 ((|ring|))、変数を表すオブジェクトを ((|obj1|)), ((|obj2|)),... として有理関数体を作ります。クラスメソッド ((|::vars|)) で変数を得ることができます。
40
+
41
+ 例: 有理関数体
42
+ require "algebra/localized-ring"
43
+ require "rational"
44
+ G = Algebra.MRationalFunctionField(Rational, "x", "y", "z")
45
+ x, y, z = G.vars
46
+ f = (x + z) / (x + y) - z / (x + y)
47
+ p f #=> (x^2 + xy)/(x^2 + 2xy + y^2)
48
+ p f.simplify #=> x/(x + y)
49
+
50
+ == クラスメソッド:
51
+
52
+ --- ::create(ring)
53
+ クラス((|ring|))で表現されるを環の元を分子・分母とする分数環
54
+ を作ります。
55
+
56
+ この戻り値は Algebra::LocalizedRing クラスのサブクラスです。
57
+ このサブクラスにはクラスメソッドとして ((|::ground|)) が定義され
58
+ ((|ring|)) を返します。
59
+
60
+ 生成したクラスにはクラスメソッド(({::[]}))が定義され、基礎環の
61
+ 元 (({x})) に対して分数環の元 (({x/1})) を返します。
62
+
63
+ 例: 有理数を作る
64
+ require "localized-ring"
65
+ F = Algebra.LocalizedRing(Integer)
66
+ p F.new(1, 2) + F.new(2, 3) #=> 7/6
67
+
68
+ 例: 整数上の多項式環の商体
69
+ require "polynomial"
70
+ require "localized-ring"
71
+ P = Algebra.Polynomial(Integer, "x")
72
+ F = Algebra.LocalizedRing(P)
73
+ x = F[P.var]
74
+ p ( 1 / (x**2 - 1) - 1 / (x**3 - 1) )
75
+ #=> (x^3 - x^2)/(x^5 - x^3 - x^2 + 1)
76
+
77
+ --- ::zero
78
+ 零元を返します。
79
+
80
+ --- ::unity
81
+ 単位元を返します。
82
+
83
+ #--- ::[](num, den = nil)
84
+
85
+ #--- ::reduce(num, den)
86
+
87
+
88
+ == メソッド:
89
+
90
+ #--- monomial?; true; end
91
+
92
+
93
+
94
+ --- zero?
95
+ 零元であるとき真を返します。
96
+
97
+ --- zero
98
+ 零元を返します。
99
+
100
+ --- unity
101
+ 単位元を返します。
102
+
103
+ --- ==(other)
104
+ 等しいとき真を返します。
105
+
106
+ --- <=>(other)
107
+ 大小関係を求めます。
108
+
109
+ --- +(other)
110
+ 和を計算します。
111
+
112
+ --- -(other)
113
+ 差を計算します。
114
+
115
+ --- *(other)
116
+ 積を計算します。
117
+
118
+ --- **(n)
119
+ ((|n|)) 乗を計算します。
120
+
121
+ --- /(other)
122
+ 商を計算します。
123
+
124
+
125
+ #--- to_s
126
+
127
+ #--- inspect
128
+
129
+ #--- hash
130
+
131
+ =end