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.
112 lines
3.1 KiB
112 lines
3.1 KiB
<HTML>
|
|
<HEAD>
|
|
<!-- Created by texi2html 1.56k from cln.texi on 5 May 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
|
|
<cl_ring.h>
|
|
</PRE>
|
|
|
|
<P>
|
|
Rings can be compared for equality:
|
|
|
|
|
|
<DL COMPACT>
|
|
|
|
<DT><CODE>bool operator== (const cl_ring&, const cl_ring&)</CODE>
|
|
<DD>
|
|
<DT><CODE>bool operator!= (const cl_ring&, const cl_ring&)</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->fprint (cl_ostream stream, const cl_ring_element& x)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_boolean R->equal (const cl_ring_element& x, const cl_ring_element& y)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->zero ()</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_boolean R->zerop (const cl_ring_element& x)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->plus (const cl_ring_element& x, const cl_ring_element& y)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->minus (const cl_ring_element& x, const cl_ring_element& y)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->uminus (const cl_ring_element& x)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->one ()</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->canonhom (const cl_I& x)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->mul (const cl_ring_element& x, const cl_ring_element& y)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->square (const cl_ring_element& x)</CODE>
|
|
<DD>
|
|
<DT><CODE>cl_ring_element R->expt_pos (const cl_ring_element& x, const cl_I& 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& x, const cl_number_ring& R)</CODE>
|
|
<DD>
|
|
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>
|