]> www.ginac.de Git - cln.git/blob - doc/cln_6.html
Initial revision
[cln.git] / doc / cln_6.html
1 <HTML>
2 <HEAD>
3 <!-- Created by texi2html 1.56k from cln.texi on 14 January 2000 -->
4
5 <TITLE>CLN, a Class Library for Numbers - 6. Rings</TITLE>
6 </HEAD>
7 <BODY>
8 Go to the <A HREF="cln_1.html">first</A>, <A HREF="cln_5.html">previous</A>, <A HREF="cln_7.html">next</A>, <A HREF="cln_13.html">last</A> section, <A HREF="cln_toc.html">table of contents</A>.
9 <P><HR><P>
10
11
12 <H1><A NAME="SEC47" HREF="cln_toc.html#TOC47">6. Rings</A></H1>
13
14 <P>
15 CLN has a class of abstract rings.
16
17
18
19 <PRE>
20                          Ring
21                        cl_ring
22                       &#60;cl_ring.h&#62;
23 </PRE>
24
25 <P>
26 Rings can be compared for equality:
27
28
29 <DL COMPACT>
30
31 <DT><CODE>bool operator== (const cl_ring&#38;, const cl_ring&#38;)</CODE>
32 <DD>
33 <DT><CODE>bool operator!= (const cl_ring&#38;, const cl_ring&#38;)</CODE>
34 <DD>
35 These compare two rings for equality.
36 </DL>
37
38 <P>
39 Given a ring <CODE>R</CODE>, the following members can be used.
40
41
42 <DL COMPACT>
43
44 <DT><CODE>void R-&#62;fprint (cl_ostream stream, const cl_ring_element&#38; x)</CODE>
45 <DD>
46 <DT><CODE>cl_boolean R-&#62;equal (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
47 <DD>
48 <DT><CODE>cl_ring_element R-&#62;zero ()</CODE>
49 <DD>
50 <DT><CODE>cl_boolean R-&#62;zerop (const cl_ring_element&#38; x)</CODE>
51 <DD>
52 <DT><CODE>cl_ring_element R-&#62;plus (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
53 <DD>
54 <DT><CODE>cl_ring_element R-&#62;minus (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
55 <DD>
56 <DT><CODE>cl_ring_element R-&#62;uminus (const cl_ring_element&#38; x)</CODE>
57 <DD>
58 <DT><CODE>cl_ring_element R-&#62;one ()</CODE>
59 <DD>
60 <DT><CODE>cl_ring_element R-&#62;canonhom (const cl_I&#38; x)</CODE>
61 <DD>
62 <DT><CODE>cl_ring_element R-&#62;mul (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
63 <DD>
64 <DT><CODE>cl_ring_element R-&#62;square (const cl_ring_element&#38; x)</CODE>
65 <DD>
66 <DT><CODE>cl_ring_element R-&#62;expt_pos (const cl_ring_element&#38; x, const cl_I&#38; y)</CODE>
67 <DD>
68 </DL>
69
70 <P>
71 The following rings are built-in.
72
73
74 <DL COMPACT>
75
76 <DT><CODE>cl_null_ring cl_0_ring</CODE>
77 <DD>
78 The null ring, containing only zero.
79
80 <DT><CODE>cl_complex_ring cl_C_ring</CODE>
81 <DD>
82 The ring of complex numbers. This corresponds to the type <CODE>cl_N</CODE>.
83
84 <DT><CODE>cl_real_ring cl_R_ring</CODE>
85 <DD>
86 The ring of real numbers. This corresponds to the type <CODE>cl_R</CODE>.
87
88 <DT><CODE>cl_rational_ring cl_RA_ring</CODE>
89 <DD>
90 The ring of rational numbers. This corresponds to the type <CODE>cl_RA</CODE>.
91
92 <DT><CODE>cl_integer_ring cl_I_ring</CODE>
93 <DD>
94 The ring of integers. This corresponds to the type <CODE>cl_I</CODE>.
95 </DL>
96
97 <P>
98 Type tests can be performed for any of <CODE>cl_C_ring</CODE>, <CODE>cl_R_ring</CODE>,
99 <CODE>cl_RA_ring</CODE>, <CODE>cl_I_ring</CODE>:
100
101
102 <DL COMPACT>
103
104 <DT><CODE>cl_boolean instanceof (const cl_number&#38; x, const cl_number_ring&#38; R)</CODE>
105 <DD>
106 Tests whether the given number is an element of the number ring R.
107 </DL>
108
109 <P><HR><P>
110 Go to the <A HREF="cln_1.html">first</A>, <A HREF="cln_5.html">previous</A>, <A HREF="cln_7.html">next</A>, <A HREF="cln_13.html">last</A> section, <A HREF="cln_toc.html">table of contents</A>.
111 </BODY>
112 </HTML>