]> www.ginac.de Git - cln.git/blob - doc/cln_6.html
* All Files have been modified for inclusion of namespace cln;
[cln.git] / doc / cln_6.html
1 <HTML>
2 <HEAD>
3 <!-- Created by texi2html 1.56k from cln.texi on 28 August 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="SEC48" HREF="cln_toc.html#TOC48">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;cln/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 <A NAME="IDX241"></A>
47 <DT><CODE>cl_boolean R-&#62;equal (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
48 <DD>
49 <A NAME="IDX242"></A>
50 <DT><CODE>cl_ring_element R-&#62;zero ()</CODE>
51 <DD>
52 <A NAME="IDX243"></A>
53 <DT><CODE>cl_boolean R-&#62;zerop (const cl_ring_element&#38; x)</CODE>
54 <DD>
55 <A NAME="IDX244"></A>
56 <DT><CODE>cl_ring_element R-&#62;plus (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
57 <DD>
58 <A NAME="IDX245"></A>
59 <DT><CODE>cl_ring_element R-&#62;minus (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
60 <DD>
61 <A NAME="IDX246"></A>
62 <DT><CODE>cl_ring_element R-&#62;uminus (const cl_ring_element&#38; x)</CODE>
63 <DD>
64 <A NAME="IDX247"></A>
65 <DT><CODE>cl_ring_element R-&#62;one ()</CODE>
66 <DD>
67 <A NAME="IDX248"></A>
68 <DT><CODE>cl_ring_element R-&#62;canonhom (const cl_I&#38; x)</CODE>
69 <DD>
70 <A NAME="IDX249"></A>
71 <DT><CODE>cl_ring_element R-&#62;mul (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
72 <DD>
73 <A NAME="IDX250"></A>
74 <DT><CODE>cl_ring_element R-&#62;square (const cl_ring_element&#38; x)</CODE>
75 <DD>
76 <A NAME="IDX251"></A>
77 <DT><CODE>cl_ring_element R-&#62;expt_pos (const cl_ring_element&#38; x, const cl_I&#38; y)</CODE>
78 <DD>
79 <A NAME="IDX252"></A>
80 </DL>
81
82 <P>
83 The following rings are built-in.
84
85
86 <DL COMPACT>
87
88 <DT><CODE>cl_null_ring cl_0_ring</CODE>
89 <DD>
90 The null ring, containing only zero.
91
92 <DT><CODE>cl_complex_ring cl_C_ring</CODE>
93 <DD>
94 The ring of complex numbers. This corresponds to the type <CODE>cl_N</CODE>.
95
96 <DT><CODE>cl_real_ring cl_R_ring</CODE>
97 <DD>
98 The ring of real numbers. This corresponds to the type <CODE>cl_R</CODE>.
99
100 <DT><CODE>cl_rational_ring cl_RA_ring</CODE>
101 <DD>
102 The ring of rational numbers. This corresponds to the type <CODE>cl_RA</CODE>.
103
104 <DT><CODE>cl_integer_ring cl_I_ring</CODE>
105 <DD>
106 The ring of integers. This corresponds to the type <CODE>cl_I</CODE>.
107 </DL>
108
109 <P>
110 Type tests can be performed for any of <CODE>cl_C_ring</CODE>, <CODE>cl_R_ring</CODE>,
111 <CODE>cl_RA_ring</CODE>, <CODE>cl_I_ring</CODE>:
112
113
114 <DL COMPACT>
115
116 <DT><CODE>cl_boolean instanceof (const cl_number&#38; x, const cl_number_ring&#38; R)</CODE>
117 <DD>
118 <A NAME="IDX253"></A>
119 Tests whether the given number is an element of the number ring R.
120 </DL>
121
122 <P><HR><P>
123 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>.
124 </BODY>
125 </HTML>