You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

113 lines
3.1 KiB

<HTML>
<HEAD>
<!-- Created by texi2html 1.56k from cln.texi on 2 June 2000 -->
<TITLE>CLN, a Class Library for Numbers - 6. Rings</TITLE>
</HEAD>
<BODY>
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>.
<P><HR><P>
<H1><A NAME="SEC48" HREF="cln_toc.html#TOC48">6. Rings</A></H1>
<P>
CLN has a class of abstract rings.
<PRE>
Ring
cl_ring
&#60;cl_ring.h&#62;
</PRE>
<P>
Rings can be compared for equality:
<DL COMPACT>
<DT><CODE>bool operator== (const cl_ring&#38;, const cl_ring&#38;)</CODE>
<DD>
<DT><CODE>bool operator!= (const cl_ring&#38;, const cl_ring&#38;)</CODE>
<DD>
These compare two rings for equality.
</DL>
<P>
Given a ring <CODE>R</CODE>, the following members can be used.
<DL COMPACT>
<DT><CODE>void R-&#62;fprint (cl_ostream stream, const cl_ring_element&#38; x)</CODE>
<DD>
<DT><CODE>cl_boolean R-&#62;equal (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;zero ()</CODE>
<DD>
<DT><CODE>cl_boolean R-&#62;zerop (const cl_ring_element&#38; x)</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;plus (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;minus (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;uminus (const cl_ring_element&#38; x)</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;one ()</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;canonhom (const cl_I&#38; x)</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;mul (const cl_ring_element&#38; x, const cl_ring_element&#38; y)</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;square (const cl_ring_element&#38; x)</CODE>
<DD>
<DT><CODE>cl_ring_element R-&#62;expt_pos (const cl_ring_element&#38; x, const cl_I&#38; y)</CODE>
<DD>
</DL>
<P>
The following rings are built-in.
<DL COMPACT>
<DT><CODE>cl_null_ring cl_0_ring</CODE>
<DD>
The null ring, containing only zero.
<DT><CODE>cl_complex_ring cl_C_ring</CODE>
<DD>
The ring of complex numbers. This corresponds to the type <CODE>cl_N</CODE>.
<DT><CODE>cl_real_ring cl_R_ring</CODE>
<DD>
The ring of real numbers. This corresponds to the type <CODE>cl_R</CODE>.
<DT><CODE>cl_rational_ring cl_RA_ring</CODE>
<DD>
The ring of rational numbers. This corresponds to the type <CODE>cl_RA</CODE>.
<DT><CODE>cl_integer_ring cl_I_ring</CODE>
<DD>
The ring of integers. This corresponds to the type <CODE>cl_I</CODE>.
</DL>
<P>
Type tests can be performed for any of <CODE>cl_C_ring</CODE>, <CODE>cl_R_ring</CODE>,
<CODE>cl_RA_ring</CODE>, <CODE>cl_I_ring</CODE>:
<DL COMPACT>
<DT><CODE>cl_boolean instanceof (const cl_number&#38; x, const cl_number_ring&#38; R)</CODE>
<DD>
<A NAME="IDX240"></A>
Tests whether the given number is an element of the number ring R.
</DL>
<P><HR><P>
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>.
</BODY>
</HTML>