source: git/ntl/doc/tour-ex5.html @ 2cfffe

spielwiese
Last change on this file since 2cfffe was 2cfffe, checked in by Hans Schönemann <hannes@…>, 21 years ago
This commit was generated by cvs2svn to compensate for changes in r6316, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@6317 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.3 KB
Line 
1<html>
2<head>
3<title>
4A Tour of NTL: Examples: Extension Rings and Fields </title>
5</head>
6
7<body bgcolor="#fff9e6">
8<center>
9<a href="tour-ex4.html"><img src="arrow1.gif" alt="[Previous]" align=bottom></a>
10 <a href="tour-examples.html"><img src="arrow2.gif" alt="[Up]" align=bottom></a> 
11<a href="tour-ex6.html"> <img src="arrow3.gif" alt="[Next]" align=bottom></a>
12</center>
13
14<h1> 
15<p align=center>
16A Tour of NTL: Examples: Extension Rings and Fields
17</p>
18</h1>
19
20<p> <hr> <p>
21
22NTL also supports extension rings and fields over finite fields,
23and polynomial arithmetic over such extensions.
24Here is a little program that illustrates this.
25
26<p>
27<pre>
28#include &lt;NTL/ZZ_pXFactoring.h&gt;
29#include &lt;NTL/ZZ_pEX.h&gt;
30
31int main()
32{
33   ZZ_p::init(to_ZZ(17)); // define GF(17)
34
35   ZZ_pX P;
36   BuildIrred(P, 10); // generate an irreducible polynomial P
37                      // of degree 10 over GF(17)
38
39   ZZ_pE::init(P); // define GF(17^10)
40
41   ZZ_pEX f, g, h;  // declare polynomials over GF(17^10)
42
43   random(f, 20);  // f is a random, monic polynomial of degree 20
44   SetCoeff(f, 20);
45
46   random(h, 20); // h is a random polynomial of degree less than 20
47
48   g = MinPolyMod(h, f); // compute the minimum polynomial of h modulo f
49
50   if (g == 0) Error("oops (1)"); // check that g != 0
51
52   if (CompMod(g, h, f) != 0) // check that g(h) = 0 mod f
53      Error("oops (2)");
54}
55</pre>
56
57<p>
58This example illustrates building extension rings over <tt>ZZ_p</tt>.
59One can also use <tt>zz_p</tt> and <tt>GF2</tt> as base classes;
60the syntax is exactly the same.
61
62<p>
63See <a href="ZZ_pE.txt"><tt>ZZ_pE.txt</tt></a> for the basics of the extension
64ring <tt>ZZ_pE</tt> over <tt>ZZ_p</tt>.
65Also see <a href="ZZ_pEX.txt"><tt>ZZ_pEX.txt</tt></a> for polynomial
66arithmetic over <tt>ZZ_pE</tt>, and
67<a href="ZZ_pEXFactoring.txt"><tt>ZZ_pEXFactoring.txt</tt></a> for factoring
68routines over <tt>ZZ_pE</tt>.
69See <a href="vec_ZZ_pE.txt"><tt>vec_ZZ_pE.txt</tt></a> for vectors over <tt>ZZ_pE</tt>,
70and <a href="mat_ZZ_pE.txt"><tt>mat_ZZ_pE.txt</tt></a> for matrices over <tt>ZZ_pE</tt>.
71
72<p>
73See <a href="lzz_pE.txt"><tt>lzz_pE.txt</tt></a> for the basics of the extension
74ring <tt>zz_pE</tt> over <tt>zz_p</tt>.
75Also see <a href="lzz_pEX.txt"><tt>lzz_pEX.txt</tt></a> for polynomial
76arithmetic over <tt>zz_pE</tt>, and
77<a href="lzz_pEXFactoring.txt"><tt>lzz_pEXFactoring.txt</tt></a> for factoring
78routines over <tt>zz_pE</tt>.
79See <a href="vec_lzz_pE.txt"><tt>vec_lzz_pE.txt</tt></a> for vectors over <tt>zz_pE</tt>,
80and <a href="mat_lzz_pE.txt"><tt>mat_lzz_pE.txt</tt></a> for matrices over <tt>zz_pE</tt>.
81
82<p>
83See <a href="GF2E.txt"><tt>GF2E.txt</tt></a> for the basics of the extension
84ring <tt>GF2E</tt> over <tt>GF2</tt>.
85Also see <a href="GF2EX.txt"><tt>GF2EX.txt</tt></a> for polynomial
86arithmetic over <tt>GF2E</tt>, and
87<a href="GF2EXFactoring.txt"><tt>GF2EXFactoring.txt</tt></a> for factoring
88routines over <tt>GF2E</tt>.
89See <a href="vec_GF2E.txt"><tt>vec_GF2E.txt</tt></a> for vectors over <tt>GF2E</tt>,
90and <a href="mat_GF2E.txt"><tt>mat_GF2E.txt</tt></a> for matrices over <tt>GF2E</tt>.
91
92
93<center>
94<a href="tour-ex4.html"><img src="arrow1.gif" alt="[Previous]" align=bottom></a>
95 <a href="tour-examples.html"><img src="arrow2.gif" alt="[Up]" align=bottom></a> 
96<a href="tour-ex6.html"> <img src="arrow3.gif" alt="[Next]" align=bottom></a>
97</center>
98
99</body>
100</html>
Note: See TracBrowser for help on using the repository browser.