/usr/share/mozart/doc/cpiref/node5.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>1.5 The class OZ_FiniteDomain</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node4.html#r_fdint"><< Prev</A></TD><TD><A href="ip.html">- Up -</A></TD><TD><A href="node6.html#r_fsvar">Next >></A></TD></TR></TABLE><DIV id="r_fd"><H2><A name="r_fd">1.5 The class <CODE>OZ_FiniteDomain</CODE></A></H2><P>Instances of this class represent the domains for finite domain integer variables. A domain may have holes and can range from 0 to <CODE>OZ_getFDSup()</CODE>, which is currently <IMG alt="134\;217\;726" src="latex2.png">. </P><P>The representation of a finite domain consists of two parts. As long as there are no holes in the domain it suffices to store the lower and upper bound of the domain. Holes are stored in the so-called extension of the domain representation. This extension is either a bit-vector or a list of intervals. The kind of extension used is automatically determined and not visible outside. </P><P>The smallest element of a domain <IMG alt="d" src="latex3.png"> is denoted by <IMG alt="min(d)" src="latex4.png"> and the largest element by <IMG alt="max(d)" src="latex5.png">. </P><P> </P><DIV id="r_fd.misc"><H3><A name="r_fd.misc">1.5.1 Miscellaneous</A></H3><P> </P><DL><DT class="enumtype"><CODE>OZ_FDState</CODE> <A name="label73"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>enumerable type</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="keyword">enum</SPAN> <SPAN class="type">OZ_FDState</SPAN> {<SPAN class="variablename">fd_empty</SPAN>, <SPAN class="variablename">fd_full</SPAN>, <SPAN class="variablename">fd_bool</SPAN>, <SPAN class="variablename">fd_singl</SPAN>};</CODE> </P></BLOCKQUOTE></DD><DD><P>Values of this enumerable type are used when constructing an instance of the class <CODE>OZ_FiniteDomain</CODE> or in conjunction with operators <CODE>==</CODE> resp. <CODE>!=</CODE>.</P><P></P><TABLE align="center" bgcolor="#f0f0e0"><TR valign="top"><TH><P>value</P></TH><TH><P>explanation</P></TH></TR><TR valign="top"><TD><P><CODE>fd_empty</CODE></P></TD><TD><P>The domain does not contain any element.</P></TD></TR><TR valign="top"><TD><P><CODE>fd_full</CODE></P></TD><TD><P>The domain contains all elements possible,</P></TD></TR><TR valign="top"><TD><P></P></TD><TD>i. e.<P><IMG alt="0, \ldots, \mbox{\tt OZ\_getFDSup()}." src="latex6.png"></P></TD></TR><TR valign="top"><TD><P><CODE>fd_bool</CODE></P></TD><TD><P>The domain contains 0 and 1.</P></TD></TR><TR valign="top"><TD><P><CODE>fd_singl</CODE></P></TD><TD><P>The domain contains a single element.</P></TD></TR></TABLE><P> </P></DD></DL><P> </P></DIV><DIV id="r_fd.member"><H3><A name="r_fd.member">1.5.2 Constructor Member Functions</A></H3><P> </P><DL><DT class="default"><CODE>OZ_FiniteDomain</CODE> <A name="label74"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>default constructor</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>OZ_FiniteDomain(<SPAN class="type">void</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This default constructor creates an <EM>uninitialized</EM> instance. </P></DD><DT class="copy"><CODE>OZ_FiniteDomain</CODE> <A name="label75"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constructor</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>OZ_FiniteDomain(<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FiniteDomain</SPAN> &<SPAN class="variablename">d</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This copy constructor copies the current domain of <CODE>d</CODE> to <CODE>*<SPAN class="keyword">this</SPAN></CODE>, so that <CODE>d</CODE> and <CODE>*<SPAN class="keyword">this</SPAN></CODE> denote the same domain but are independent representations of it. </P></DD><DT class="overloaded"><CODE>OZ_FiniteDomain</CODE> <A name="label76"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>overloaded constructor</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>OZ_FiniteDomain(<SPAN class="type">OZ_FDState</SPAN> <SPAN class="variablename">state</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This constructor creates an object which represents a domain according to the value of <CODE>state</CODE>. Valid values for <CODE>state</CODE> are <CODE>fd_empty</CODE> and <CODE>fd_full</CODE>. </P></DD><DT class="overloaded"><CODE>OZ_FiniteDomain</CODE> <A name="label77"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>overloaded constructor</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>OZ_FiniteDomain(<SPAN class="type">OZ_Term</SPAN> <SPAN class="variablename">t</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This constructor is the composition of the default constructor and the member function <CODE>initDescr()</CODE>. </P></DD><DT class="overloaded"><CODE>OZ_FiniteDomain</CODE> <A name="label78"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>overloaded constructor</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>OZ_FiniteDomain(<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FSetValue</SPAN> &<SPAN class="variablename">fs</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This constructor initialises <CODE>*<SPAN class="keyword">this</SPAN></CODE> with the values contained in the finite set <CODE>fs</CODE>. </P></DD></DL><P> </P></DIV><DIV id="r_fd.init"><H3><A name="r_fd.init">1.5.3 Initialisation Member Functions</A></H3><P> The return value of all initialisation member functions is the size of the domain they initialised.</P><P> </P><DL><DT class="member"><CODE>initRange</CODE> <A name="label79"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="reference">OZ_FiniteDomain</SPAN>::<SPAN class="functionname">initRange</SPAN>(<SPAN class="type">int</SPAN> <SPAN class="variablename">l</SPAN>, <SPAN class="type">int</SPAN> <SPAN class="variablename">u</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>Initialises an instance of class <CODE>OZ_FiniteDomain</CODE> to the domain <IMG alt="\{l, \ldots, u\}" src="latex7.png">. </P><P> In case <CODE>l</CODE> > <CODE>u</CODE>, the domain is set to be empty. </P></DD><DT class="member"><CODE>initSingleton</CODE> <A name="label80"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="reference">OZ_FiniteDomain</SPAN>::<SPAN class="functionname">initSingleton</SPAN>(<SPAN class="type">int</SPAN> <SPAN class="variablename">l</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>Initialises an instance of class <CODE>OZ_FiniteDomain</CODE> to the domain <IMG alt="\{l\}" src="latex8.png">. </P></DD><DT class="member"><CODE>initDescr</CODE> <A name="label81"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="reference">OZ_FiniteDomain</SPAN>::<SPAN class="functionname">initDescr</SPAN>(<SPAN class="type">OZ_Term</SPAN> <SPAN class="variablename">d</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>Initialises an instance of class <CODE>OZ_FiniteDomain</CODE> to a domain according to the domain description <CODE>d</CODE>. The domain description must be conform with <EM>level4</EM> (see syntax definition of a domain description in <A href="node2.html#expect.checkconstr">Section 1.2.4</A>, entry <CODE>expectDomDesc</CODE>). </P></DD><DT class="member"><CODE>initFull</CODE> <A name="label82"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="reference">OZ_FiniteDomain</SPAN>::<SPAN class="functionname">initFull</SPAN>(<SPAN class="type">void</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>Initialises an instance of class <CODE>OZ_FiniteDomain</CODE> to the domain <IMG alt="\{0, \ldots, \mbox{\tt OZ\_getFDSup()}\}" src="latex9.png">. </P></DD><DT class="member"><CODE>initEmpty</CODE> <A name="label83"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="reference">OZ_FiniteDomain</SPAN>::<SPAN class="functionname">initEmpty</SPAN>(<SPAN class="type">void</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>Initialises an instance of class <CODE>OZ_FiniteDomain</CODE> to the empty domain. </P></DD><DT class="member"><CODE>initBool</CODE> <A name="label84"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="reference">OZ_FiniteDomain</SPAN>::<SPAN class="functionname">initBool</SPAN>(<SPAN class="type">void</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>Initialises an instance of class <CODE>OZ_FiniteDomain</CODE> to the domain <IMG alt="\{0,1\}" src="latex1.png">. </P></DD></DL><P> </P></DIV><DIV id="r_fd.reflect"><H3><A name="r_fd.reflect">1.5.4 Reflection Member Functions</A></H3><P> </P><DL><DT class="constant"><CODE>getMidElem</CODE> <A name="label85"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getMidElem</SPAN>(<SPAN class="type">void</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the element in the middle of the domain. For the domain <IMG alt="d" src="latex3.png"> it is <IMG alt="(max(d)-min(d))\; div\;
2" src="latex10.png">. If this value happens to be a hole the element closest to it will be returned. In case there are two elements with the same distance to the middle of the domain the smaller one will be taken. </P></DD><DT class="constant"><CODE>getNextSmallerElem</CODE> <A name="label86"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getNextSmallerElem</SPAN>(<SPAN class="type">int</SPAN> <SPAN class="variablename">v</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the largest element in the domain smaller than <CODE>v</CODE>. In case <CODE>v</CODE> is the smallest element it returns -1. </P></DD><DT class="constant"><CODE>getNextLargerElem</CODE> <A name="label87"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getNextLargerElem</SPAN>(<SPAN class="type">int</SPAN> <SPAN class="variablename">v</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the smallest element in the domain larger than <CODE>v</CODE>. In case <CODE>v</CODE> is the largest element it returns -1. </P></DD><DT class="constant"><CODE>getLowerIntervalBd</CODE> <A name="label88"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getLowerIntervalBd</SPAN>(<SPAN class="type">int</SPAN> <SPAN class="variablename">v</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the smallest value of the interval <CODE>v</CODE> belongs to. In case <CODE>v</CODE> does not belong to any interval the function returns -1. </P></DD><DT class="constant"><CODE>getUpperIntervalBd</CODE> <A name="label89"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getUpperIntervalBd</SPAN>(<SPAN class="type">int</SPAN> <SPAN class="variablename">v</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the largest value of the interval <CODE>v</CODE> belongs to. In case <CODE>v</CODE> does not belong to any interval the function returns -1. </P></DD><DT class="constant"><CODE>getSize</CODE> <A name="label90"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getSize</SPAN>(<SPAN class="type">void</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the size of the domain, i. e. the number of elements in the domain. </P></DD><DT class="constant"><CODE>getMinElem</CODE> <A name="label91"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getMinElem</SPAN>(<SPAN class="type">void</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the smallest element of the domain. </P></DD><DT class="constant"><CODE>getMaxElem</CODE> <A name="label92"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getMaxElem</SPAN>(<SPAN class="type">void</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the largest element of the domain. </P></DD><DT class="constant"><CODE>getSingleElem</CODE> <A name="label93"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">getSingleElem</SPAN>(<SPAN class="type">void</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the element of a singleton domain. In case the domain is not a singleton domain it returns -1. </P></DD></DL><P> </P></DIV><DIV id="r_fd.op"><H3><A name="r_fd.op">1.5.5 Operator Member Functions</A></H3><P> </P><DL><DT class="operator"><CODE><SPAN class="keyword">operator</SPAN> =</CODE> <A name="label94"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FiniteDomain</SPAN> &<SPAN class="keyword">operator</SPAN> <SPAN class="functionname">=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FiniteDomain</SPAN> &<SPAN class="variablename">fd</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This assignment operator copies <CODE>fd</CODE> to its left hand side, so that both domains are the same but are independent of each other. </P></DD><DT class="constant"><CODE><SPAN class="keyword">operator</SPAN> ==</CODE> <A name="label95"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">OZ_Boolean</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">==</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FDState</SPAN> <SPAN class="variablename">s</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This operator returns <CODE>OZ_TRUE</CODE> if the domain corresponds to the value of <CODE>s</CODE>. Otherwise it returns <CODE>OZ_FALSE</CODE>. </P></DD><DT class="constant"><CODE><SPAN class="keyword">operator</SPAN> ==</CODE> <A name="label96"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">OZ_Boolean</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">==</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">int</SPAN> <SPAN class="variablename">i</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This operator returns <CODE>OZ_TRUE</CODE> if the domain contains only <CODE>i</CODE>. Otherwise it returns <CODE>OZ_FALSE</CODE>. </P></DD><DT class="constant"><CODE><SPAN class="keyword">operator</SPAN> !=</CODE> <A name="label97"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">OZ_Boolean</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">!=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FDState</SPAN> <SPAN class="variablename">s</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This operator returns <CODE>OZ_TRUE</CODE> if the domain does <EM>not</EM> correspond to the value of <CODE>s</CODE>. Otherwise it returns <CODE>OZ_FALSE</CODE>. </P></DD><DT class="constant"><CODE><SPAN class="keyword">operator</SPAN> !=</CODE> <A name="label98"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">OZ_Boolean</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">!=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">int</SPAN> <SPAN class="variablename">i</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This operator returns <CODE>OZ_TRUE</CODE> if the domain does <EM>not</EM> contain <CODE>i</CODE> or contains more than one element. Otherwise it returns <CODE>OZ_FALSE</CODE>. </P></DD><DT class="constant"><CODE><SPAN class="keyword">operator</SPAN> &</CODE> <A name="label99"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">OZ_FiniteDomain</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">&</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FiniteDomain</SPAN> &<SPAN class="variablename">y</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the intersection of the finite domains represented by <CODE>y</CODE> and <CODE>*<SPAN class="keyword">this</SPAN></CODE>. </P></DD><DT class="constant"><CODE><SPAN class="keyword">operator</SPAN> |</CODE> <A name="label100"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">OZ_FiniteDomain</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">|</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FiniteDomain</SPAN> &<SPAN class="variablename">y</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the union of the finite domains represented by <CODE>y</CODE> and <CODE>*<SPAN class="keyword">this</SPAN></CODE>. </P></DD><DT class="constant"><CODE><SPAN class="keyword">operator</SPAN> ~</CODE> <A name="label101"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>OZ_FiniteDomain <SPAN class="keyword">operator</SPAN> ~ (<SPAN class="type">void</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns the negation of the finite domain represented by <CODE>*<SPAN class="keyword">this</SPAN></CODE>. The negation is computed by removing all elements in <CODE>*<SPAN class="keyword">this</SPAN></CODE> from <IMG alt="\{0, \ldots, \mbox{\tt
OZ\_getFDSup()}\}" src="latex11.png">. </P></DD><DT class="operator"><CODE><SPAN class="keyword">operator</SPAN> &=</CODE> <A name="label102"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE><SPAN class="type">int</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">&=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FiniteDomain</SPAN> &<SPAN class="variablename">y</SPAN>);<BR><SPAN class="type">int</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">&=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">int</SPAN> <SPAN class="variablename">y</SPAN>);</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>This member function computes the intersection of the finite domains represented by <CODE>y</CODE> and <CODE>*<SPAN class="keyword">this</SPAN></CODE> and assigns the result to <CODE>*<SPAN class="keyword">this</SPAN></CODE>. Further, the size of the updated domain is returned. </P></DD><DT class="operator"><CODE><SPAN class="keyword">operator</SPAN> +=</CODE> <A name="label103"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">+=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">int</SPAN> <SPAN class="variablename">y</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function adds the element <CODE>y</CODE> to the domain represented by <CODE>*<SPAN class="keyword">this</SPAN></CODE> and returns the size of the updated domain. </P></DD><DT class="operator"><CODE><SPAN class="keyword">operator</SPAN> -=</CODE> <A name="label104"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">-=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">int</SPAN> <SPAN class="variablename">y</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function removes the element <CODE>y</CODE> from the domain represented by <CODE>*<SPAN class="keyword">this</SPAN></CODE> and returns the size of the updated domain. </P></DD><DT class="operator"><CODE><SPAN class="keyword">operator</SPAN> -=</CODE> <A name="label105"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">-=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">OZ_FiniteDomain</SPAN> &<SPAN class="variablename">y</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function removes all elements contained in the domain represented by <CODE>y</CODE> from the domain represented by <CODE>*<SPAN class="keyword">this</SPAN></CODE> and returns the size of the updated domain. </P></DD><DT class="operator"><CODE><SPAN class="keyword">operator</SPAN> <=</CODE> <A name="label106"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname"><=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">int</SPAN> <SPAN class="variablename">y</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function removes all elements being larger than <CODE>y</CODE> from the domain represented by <CODE>*<SPAN class="keyword">this</SPAN></CODE> and returns the size of the updated domain. </P></DD><DT class="operator"><CODE><SPAN class="keyword">operator</SPAN> >=</CODE> <A name="label107"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>operator member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="keyword">operator</SPAN> <SPAN class="functionname">>=</SPAN> (<SPAN class="keyword">const</SPAN> <SPAN class="type">int</SPAN> <SPAN class="variablename">y</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function removes all elements being smaller than <CODE>y</CODE> from the domain represented by <CODE>*<SPAN class="keyword">this</SPAN></CODE> and returns the size of the updated domain. </P></DD></DL><P> </P></DIV><DIV id="r_fd.aux"><H3><A name="r_fd.aux">1.5.6 Auxiliary Member Functions</A></H3><P> </P><DL><DT class="member"><CODE>intersectWithBool</CODE> <A name="label108"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">intersectWithBool</SPAN>(<SPAN class="type">void</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function intersects the current domain with the domain <IMG alt="\{0,1\}" src="latex1.png"> and produces the following return value.</P><P> </P><TABLE align="center" bgcolor="#f0f0e0"><TR valign="top"><TH><P>return value</P></TH><TH><P>meaning</P></TH></TR><TR valign="top"><TD><P>-2</P></TD><TD><P>The resulting domain is empty.</P></TD></TR><TR valign="top"><TD><P>-1</P></TD><TD><P>The resulting domain is <IMG alt="\{0,1\}" src="latex1.png"></P></TD></TR><TR valign="top"><TD><P>otherwise</P></TD><TD><P>The remaining element is returned.</P></TD></TR></TABLE><P> </P></DD><DT class="member"><CODE>constrainBool</CODE> <A name="label109"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">int</SPAN> <SPAN class="functionname">constrainBool</SPAN>(<SPAN class="type">void</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function intersects the current domain with the domain <IMG alt="\{0,1\}" src="latex1.png"> and returns the size of resulting domain. </P></DD><DT class="member"><CODE>isIn</CODE> <A name="label110"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">OZ_Boolean</SPAN> <SPAN class="functionname">isIn</SPAN>(<SPAN class="type">int</SPAN> <SPAN class="variablename">i</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function returns <CODE>OZ_TRUE</CODE> if <CODE>i</CODE> is contained in the domain represented by <CODE>*<SPAN class="keyword">this</SPAN></CODE>. Otherwise it returns <CODE>OZ_FALSE</CODE>. </P></DD><DT class="member"><CODE>copyExtension</CODE> <A name="label111"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">void</SPAN> <SPAN class="functionname">copyExtension</SPAN>(<SPAN class="type">void</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function replaces the current extension of the domain representation by a copy of it. </P></DD><DT class="member"><CODE>disposeExtension</CODE> <A name="label112"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">void</SPAN> <SPAN class="functionname">disposeExtension</SPAN>(<SPAN class="type">void</SPAN>);</CODE> </P></BLOCKQUOTE></DD><DD><P>This member function frees the heap memory occupied by the extension of the domain. </P></DD><DT class="constant"><CODE>toString</CODE> <A name="label113"></A><SPAN class="entrycategory"><SPAN class="entrycategorybracket"> [</SPAN><I>constant member function</I><SPAN class="entrycategorybracket">]</SPAN></SPAN></DT><DD><BLOCKQUOTE class="synopsis"><P><CODE><SPAN class="type">char</SPAN> * <SPAN class="functionname">toString</SPAN>(<SPAN class="type">void</SPAN>) <SPAN class="keyword">const</SPAN>;</CODE> </P></BLOCKQUOTE></DD><DD><P>Returns a textual representation of the finite domain pointing to a static array of <CODE><SPAN class="type">char</SPAN></CODE>s. </P></DD></DL><P> </P><P> </P></DIV></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node4.html#r_fdint"><< Prev</A></TD><TD><A href="ip.html">- Up -</A></TD><TD><A href="node6.html#r_fsvar">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~tmueller/">Tobias Müller</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|