1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>polylib: types.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<h1>types.h</h1><a href="types_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* types-polylib.h</span>
<a name="l00002"></a>00002 <span class="comment"> COPYRIGHT</span>
<a name="l00003"></a>00003 <span class="comment"> Both this software and its documentation are</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> Copyright 1993, IRISA /Universite de Rennes I - France</span>
<a name="l00006"></a>00006 <span class="comment"> Copyright 1996,1997,1998, Doran Wilde and Vincent Loechner</span>
<a name="l00007"></a>00007 <span class="comment"> All rights reserved.</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment"> Permission is granted to copy, use, and distribute</span>
<a name="l00010"></a>00010 <span class="comment"> for any commercial or noncommercial purpose under the terms</span>
<a name="l00011"></a>00011 <span class="comment"> of the GNU General Public license, version 2, June 1991</span>
<a name="l00012"></a>00012 <span class="comment"> (see file : LICENSING).</span>
<a name="l00013"></a>00013 <span class="comment">*/</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="preprocessor">#ifndef _types_polylib_h_</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define _types_polylib_h_</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <span class="preprocessor">#ifdef GNUMP</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#include<gmp.h></span>
<a name="l00020"></a>00020 <span class="preprocessor">#endif </span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="preprocessor">#include <limits.h></span>
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="comment">/*********************** USER DEFINES ******************************/</span>
<a name="l00025"></a>00025
<a name="l00026"></a>00026 <span class="comment">/* first parameter name char. */</span>
<a name="l00027"></a><a class="code" href="types_8h.html#0983cb88d8aefa8ac53282de30590726">00027</a> <span class="preprocessor">#define FIRST_PARAMETER_NAME 'P'</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 <span class="comment">/******************* END OF USER DEFINES ***************************/</span>
<a name="l00030"></a>00030
<a name="l00031"></a>00031
<a name="l00032"></a><a class="code" href="types_8h.html#39e85cb3471b4808b39bdde4fb125cbe">00032</a> <span class="preprocessor">#define PCHAR (FIRST_PARAMETER_NAME-1)</span>
<a name="l00033"></a><a class="code" href="types_8h.html#7a3726264ecf2f0985882e0c1adb4ddb">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define MAXNOOFRAYS 200 </span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#if defined(LINEAR_VALUE_IS_LONGLONG)</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define P_VALUE_FMT "%4lld "</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#elif defined(LINEAR_VALUE_IS_LONG)</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define P_VALUE_FMT "%4ld "</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#elif defined(LINEAR_VALUE_IS_CHARS)</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define P_VALUE_FMT "%s "</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#elif defined(LINEAR_VALUE_IS_INT) </span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define P_VALUE_FMT "%4d "</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#else </span><span class="comment">/* GNUMP */</span>
<a name="l00044"></a><a class="code" href="types_8h.html#e6f16bcd4a42ba51cbb003e3d1e1cde6">00044</a> <span class="preprocessor">#define P_VALUE_FMT "%4s "</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span>
<a name="l00047"></a>00047 <span class="comment">/* Used in lower_upper_bounds */</span>
<a name="l00048"></a><a class="code" href="types_8h.html#b3e4132829e88232125e7bf259520a18">00048</a> <span class="preprocessor">#define LB_INFINITY 1</span>
<a name="l00049"></a><a class="code" href="types_8h.html#629bf0301263815e35636f493380b9dd">00049</a> <span class="preprocessor"></span><span class="preprocessor">#define UB_INFINITY 2</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span>
<a name="l00051"></a>00051 <span class="comment">/* MSB, TOP, and NEXT are defined over integer type, not on value type */</span>
<a name="l00052"></a>00052 <span class="comment">/* Put a one in the most significant bit of an int (portable) */</span>
<a name="l00053"></a><a class="code" href="types_8h.html#11f27b3b63dfc15c4b4fbb665a3ce3fe">00053</a> <span class="preprocessor">#define MSB ((unsigned)(((unsigned)1)<<(sizeof(int)*8-1)))</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>
<a name="l00055"></a>00055 <span class="comment">/* Largest representable positive number */</span>
<a name="l00056"></a><a class="code" href="types_8h.html#fc0eef637f1016e8786e45e106a4881e">00056</a> <span class="preprocessor">#define TOP ((int)(MSB-1))</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span>
<a name="l00058"></a>00058 <span class="comment">/* Right shift the one bit in b and increment j if the last bit in b is one */</span>
<a name="l00059"></a><a class="code" href="types_8h.html#3dd66db5db700555d4e24314974a2ea1">00059</a> <span class="preprocessor">#define NEXT(j,b) { if (!((b)>>=1)) { (b)=MSB; (j)++; } }</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span>
<a name="l00061"></a>00061 <span class="comment">/* Status of last Polyhedron operation */</span>
<a name="l00062"></a>00062 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="errormsg_8c.html#a587bf4e8c763fa5e95542df7eb070b7">Pol_status</a>;
<a name="l00063"></a>00063
<a name="l00064"></a><a class="code" href="types_8h.html#827ee0a650c714bebc02dfa7da978b5f">00064</a> <span class="preprocessor">#define POL_HIGH_BIT (UINT_MAX - (UINT_MAX >> 1))</span>
<a name="l00065"></a><a class="code" href="types_8h.html#754586a0aee88f21ad4c98b1cddee1be">00065</a> <span class="preprocessor"></span><span class="preprocessor">#define POL_NO_DUAL (POL_HIGH_BIT | 0x0001)</span>
<a name="l00066"></a><a class="code" href="types_8h.html#d8b11210e90424f4d7be767b93ae2f72">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define POL_INTEGER (POL_HIGH_BIT | 0x0002)</span>
<a name="l00067"></a><a class="code" href="types_8h.html#223261a4719dd67ef2048c192bb34099">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define POL_ISSET(flags,f) ((flags & f) == f)</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a><a class="code" href="structVector.html">00069</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
<a name="l00070"></a><a class="code" href="structVector.html#424501dd99036dd1dc1c4e009c5b00f9">00070</a> <span class="keywordtype">unsigned</span> Size;
<a name="l00071"></a><a class="code" href="structVector.html#ecf9fddd3ad47d143da2e041fdff37cc">00071</a> Value *<a class="code" href="vector_8c.html#a45b2e3dcf291527c5aedc420819adfc">p</a>;
<a name="l00072"></a>00072 } <a class="code" href="structVector.html">Vector</a>;
<a name="l00073"></a>00073
<a name="l00074"></a><a class="code" href="structmatrix.html">00074</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structmatrix.html">matrix</a> {
<a name="l00075"></a><a class="code" href="structmatrix.html#16ad614d15c6e81c0041e877b623c72d">00075</a> <span class="keywordtype">unsigned</span> <a class="code" href="structmatrix.html#16ad614d15c6e81c0041e877b623c72d">NbRows</a>, <a class="code" href="structmatrix.html#68858fd3b57684ef38bdfce13c65d182">NbColumns</a>;
<a name="l00076"></a><a class="code" href="structmatrix.html#2c6d840d8d911ae95c2ae4fc96f4b5ba">00076</a> Value **<a class="code" href="structmatrix.html#2c6d840d8d911ae95c2ae4fc96f4b5ba">p</a>;
<a name="l00077"></a><a class="code" href="structmatrix.html#9c294a3fd4d273963e27a0c8cd819bd5">00077</a> Value *<a class="code" href="structmatrix.html#9c294a3fd4d273963e27a0c8cd819bd5">p_Init</a>;
<a name="l00078"></a><a class="code" href="structmatrix.html#5dc523eba55ca76f0a7eba9ec325cbe5">00078</a> <span class="keywordtype">int</span> <a class="code" href="structmatrix.html#5dc523eba55ca76f0a7eba9ec325cbe5">p_Init_size</a>; <span class="comment">/* needed to free the memory allocated by mpz_init */</span>
<a name="l00079"></a>00079 } <a class="code" href="structmatrix.html">Matrix</a>;
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <span class="comment">/* Macros to init/set/clear/test flags. */</span>
<a name="l00082"></a><a class="code" href="types_8h.html#cd3e6da08aea98ada4bad87b9a63a4e0">00082</a> <span class="preprocessor">#define FL_INIT(l, f) (l) = (f) </span><span class="comment">/* Specific flags location. */</span>
<a name="l00083"></a><a class="code" href="types_8h.html#d564ff71777a709191756eacebd5721a">00083</a> <span class="preprocessor">#define FL_SET(l, f) ((l) |= (f))</span>
<a name="l00084"></a><a class="code" href="types_8h.html#287b3b51b0f3bf633e9f00d23b69da46">00084</a> <span class="preprocessor"></span><span class="preprocessor">#define FL_CLR(l, f) ((l) &= ~(f))</span>
<a name="l00085"></a><a class="code" href="types_8h.html#f6497c16618b94a803a1b43f31629f9c">00085</a> <span class="preprocessor"></span><span class="preprocessor">#define FL_ISSET(l, f) ((l) & (f))</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span>
<a name="l00087"></a><a class="code" href="types_8h.html#5283dcd004bd2fcfaab76b89c6c9322b">00087</a> <span class="preprocessor">#define F_INIT(p, f) FL_INIT((p)->flags, f) </span><span class="comment">/* Structure element flags. */</span>
<a name="l00088"></a><a class="code" href="types_8h.html#b04b7b56e2789336fbc544896cb477f9">00088</a> <span class="preprocessor">#define F_SET(p, f) FL_SET((p)->flags, f)</span>
<a name="l00089"></a><a class="code" href="types_8h.html#bf7ccc8dc487c568afdb1efd664d1e61">00089</a> <span class="preprocessor"></span><span class="preprocessor">#define F_CLR(p, f) FL_CLR((p)->flags, f)</span>
<a name="l00090"></a><a class="code" href="types_8h.html#19f1ae711bb0e3063ba1962cb8a898a0">00090</a> <span class="preprocessor"></span><span class="preprocessor">#define F_ISSET(p, f) FL_ISSET((p)->flags, f)</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span>
<a name="l00092"></a><a class="code" href="structpolyhedron.html">00092</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structpolyhedron.html">polyhedron</a> {
<a name="l00093"></a><a class="code" href="structpolyhedron.html#74cba037f5ac1c7182bf960d79d3f124">00093</a> <span class="keywordtype">unsigned</span> <a class="code" href="structpolyhedron.html#2a02cea8b7ba3dde415041b8b2373bc8">Dimension</a>, <a class="code" href="structpolyhedron.html#2db05293e731089b9198d45cf027bd1c">NbConstraints</a>, <a class="code" href="structpolyhedron.html#74cba037f5ac1c7182bf960d79d3f124">NbRays</a>, <a class="code" href="structpolyhedron.html#f316f6440017b2e02fa3a387b2818cc9">NbEq</a>, <a class="code" href="structpolyhedron.html#9e7c80deeddf472a57bd54217f75c717">NbBid</a>;
<a name="l00094"></a><a class="code" href="structpolyhedron.html#b2691b8eb5d2dc43a509ac2094d2bc73">00094</a> Value **<a class="code" href="structpolyhedron.html#b2691b8eb5d2dc43a509ac2094d2bc73">Constraint</a>;
<a name="l00095"></a><a class="code" href="structpolyhedron.html#1332db86327e189effc8798ab230f36a">00095</a> Value **<a class="code" href="structpolyhedron.html#1332db86327e189effc8798ab230f36a">Ray</a>;
<a name="l00096"></a><a class="code" href="structpolyhedron.html#3681618067c7bf2a0bd5e805871283f5">00096</a> Value *<a class="code" href="structpolyhedron.html#3681618067c7bf2a0bd5e805871283f5">p_Init</a>;
<a name="l00097"></a><a class="code" href="structpolyhedron.html#c2aa52aede2212101bd130ba7a67663a">00097</a> <span class="keywordtype">int</span> <a class="code" href="structpolyhedron.html#c2aa52aede2212101bd130ba7a67663a">p_Init_size</a>;
<a name="l00098"></a><a class="code" href="structpolyhedron.html#ab97126cb9e56431d40eaf4e68b3953d">00098</a> <span class="keyword">struct </span><a class="code" href="structpolyhedron.html">polyhedron</a> *<a class="code" href="structpolyhedron.html#ab97126cb9e56431d40eaf4e68b3953d">next</a>;
<a name="l00099"></a><a class="code" href="types_8h.html#1869e11b8e9a1e9e89e8145c242e0eea">00099</a> <span class="preprocessor">#define POL_INEQUALITIES 0x00000001</span>
<a name="l00100"></a><a class="code" href="types_8h.html#def192e3530c5e1fcb2c44858a78f703">00100</a> <span class="preprocessor"></span><span class="preprocessor">#define POL_FACETS 0x00000002</span>
<a name="l00101"></a><a class="code" href="types_8h.html#acccb2db7ed6cb45d5e324216aa5ea3f">00101</a> <span class="preprocessor"></span><span class="preprocessor">#define POL_POINTS 0x00000004</span>
<a name="l00102"></a><a class="code" href="types_8h.html#18cb4aab2aec424306ea8f67f6dfc9b0">00102</a> <span class="preprocessor"></span><span class="preprocessor">#define POL_VERTICES 0x00000008</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="comment">/* The flags field contains "valid" information,</span>
<a name="l00104"></a>00104 <span class="comment"> * i.e., the structure was created by PolyLib.</span>
<a name="l00105"></a>00105 <span class="comment"> */</span>
<a name="l00106"></a><a class="code" href="types_8h.html#2ac4c28a3acbe4578e03ad20db7939cc">00106</a> <span class="preprocessor">#define POL_VALID 0x00000010</span>
<a name="l00107"></a><a class="code" href="structpolyhedron.html#c1fb864c352ef93ef3030c35e98c2aed">00107</a> <span class="preprocessor"></span> <span class="keywordtype">unsigned</span> <a class="code" href="structpolyhedron.html#c1fb864c352ef93ef3030c35e98c2aed">flags</a>;
<a name="l00108"></a>00108 } <a class="code" href="structpolyhedron.html">Polyhedron</a>;
<a name="l00109"></a>00109
<a name="l00110"></a><a class="code" href="structinterval.html">00110</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structinterval.html">interval</a> {
<a name="l00111"></a><a class="code" href="structinterval.html#3af72063ac42a7959562dd87586acb70">00111</a> Value <a class="code" href="structinterval.html#3af72063ac42a7959562dd87586acb70">MaxN</a>, <a class="code" href="structinterval.html#ec5d91911af4c48d899c363c1637b6fe">MaxD</a>;
<a name="l00112"></a><a class="code" href="structinterval.html#671bae1e764608a6f6da4449f8158098">00112</a> Value <a class="code" href="structinterval.html#671bae1e764608a6f6da4449f8158098">MinN</a>, <a class="code" href="structinterval.html#0470f7cbd4da9aa8b77a579af53c65a3">MinD</a>;
<a name="l00113"></a><a class="code" href="structinterval.html#4a85bcb34b14c468511a4a783673bfcb">00113</a> <span class="keywordtype">int</span> <a class="code" href="structinterval.html#0bcde6d5bb239a8786de8401adf60489">MaxI</a>, <a class="code" href="structinterval.html#4a85bcb34b14c468511a4a783673bfcb">MinI</a>;
<a name="l00114"></a>00114 } <a class="code" href="structinterval.html">Interval</a>;
<a name="l00115"></a>00115
<a name="l00116"></a>00116 <span class="comment">/* Test whether P is an empty polyhedron */</span>
<a name="l00117"></a><a class="code" href="types_8h.html#156641ae25106f9a6ac5c5c2a624c168">00117</a> <span class="preprocessor">#define emptyQ(P) \</span>
<a name="l00118"></a>00118 <span class="preprocessor"> ((F_ISSET(P, POL_INEQUALITIES) && P->NbEq > P->Dimension) || \</span>
<a name="l00119"></a>00119 <span class="preprocessor"> (F_ISSET(P, POL_POINTS) && P->NbRays == 0))</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span>
<a name="l00121"></a>00121 <span class="comment">/* Test whether P is a universe polyheron */</span>
<a name="l00122"></a><a class="code" href="types_8h.html#355595bc9326db6a3ec78b2e5c2a0f97">00122</a> <span class="preprocessor">#define universeQ(P) (P->Dimension==P->NbBid)</span>
<a name="l00123"></a>00123 <span class="preprocessor"></span>
<a name="l00124"></a><a class="code" href="struct__Param__Vertex.html">00124</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__Param__Vertex.html">_Param_Vertex</a> {
<a name="l00125"></a><a class="code" href="struct__Param__Vertex.html#d61ebc6810df483f7b0e25fea5c6cdf1">00125</a> <a class="code" href="structmatrix.html">Matrix</a> *<a class="code" href="struct__Param__Vertex.html#d61ebc6810df483f7b0e25fea5c6cdf1">Vertex</a>; <span class="comment">/* Each row is a coordinate of the vertex. The first */</span>
<a name="l00126"></a>00126 <span class="comment">/* "m" values of each row are the coefficients of the */</span>
<a name="l00127"></a>00127 <span class="comment">/* parameters. The (m+1)th value is the constant, the */</span>
<a name="l00128"></a>00128 <span class="comment">/* The (m+2)th value is the common denominator. */</span>
<a name="l00129"></a><a class="code" href="struct__Param__Vertex.html#09d8d34daf37b7cbcff6761b80761f26">00129</a> <a class="code" href="structmatrix.html">Matrix</a> *<a class="code" href="struct__Param__Vertex.html#09d8d34daf37b7cbcff6761b80761f26">Domain</a>; <span class="comment">/* Constraints on parameters (in Polyhedral format) */</span>
<a name="l00130"></a><a class="code" href="struct__Param__Vertex.html#f7ff9a4be6a5202a9bcf741a8b233c9e">00130</a> <span class="keywordtype">unsigned</span> *<a class="code" href="struct__Param__Vertex.html#f7ff9a4be6a5202a9bcf741a8b233c9e">Facets</a>; <span class="comment">/* Bit array of facets defining the vertex. */</span>
<a name="l00131"></a><a class="code" href="struct__Param__Vertex.html#1115989a70826c590a1c71923cdeee68">00131</a> <span class="keyword">struct </span><a class="code" href="struct__Param__Vertex.html">_Param_Vertex</a> *<a class="code" href="struct__Param__Vertex.html#1115989a70826c590a1c71923cdeee68">next</a>; <span class="comment">/* Pointer to the next structure */</span>
<a name="l00132"></a>00132 } <a class="code" href="struct__Param__Vertex.html">Param_Vertices</a>;
<a name="l00133"></a>00133
<a name="l00134"></a><a class="code" href="struct__Param__Domain.html">00134</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__Param__Domain.html">_Param_Domain</a> {
<a name="l00135"></a><a class="code" href="struct__Param__Domain.html#c87a60cf654cb9b80ddcac469d6ee81a">00135</a> <span class="keywordtype">unsigned</span> *<a class="code" href="struct__Param__Domain.html#c87a60cf654cb9b80ddcac469d6ee81a">F</a>; <span class="comment">/* Bit array of faces */</span>
<a name="l00136"></a><a class="code" href="struct__Param__Domain.html#ac7b708b50ebee4352fddebed2eaba7c">00136</a> <a class="code" href="structpolyhedron.html">Polyhedron</a> *<a class="code" href="struct__Param__Domain.html#ac7b708b50ebee4352fddebed2eaba7c">Domain</a>; <span class="comment">/* Pointer to Domain (constraints on parameters) */</span>
<a name="l00137"></a><a class="code" href="struct__Param__Domain.html#5e0de697b290be8c04aeb01af780c557">00137</a> <span class="keyword">struct </span><a class="code" href="struct__Param__Domain.html">_Param_Domain</a> *<a class="code" href="struct__Param__Domain.html#5e0de697b290be8c04aeb01af780c557">next</a>; <span class="comment">/* Pointer to the next structure */</span>
<a name="l00138"></a>00138 } <a class="code" href="struct__Param__Domain.html">Param_Domain</a>;
<a name="l00139"></a>00139
<a name="l00140"></a><a class="code" href="struct__Param__Polyhedron.html">00140</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__Param__Polyhedron.html">_Param_Polyhedron</a> {
<a name="l00141"></a><a class="code" href="struct__Param__Polyhedron.html#baa0a017c7bef81b5ed9f6d2fd3f6f58">00141</a> <span class="keywordtype">int</span> <a class="code" href="struct__Param__Polyhedron.html#baa0a017c7bef81b5ed9f6d2fd3f6f58">nbV</a>; <span class="comment">/* Number of parameterized vertices */</span>
<a name="l00142"></a><a class="code" href="struct__Param__Polyhedron.html#183b47f3f8b8c27079a840c934e7b972">00142</a> <a class="code" href="struct__Param__Vertex.html">Param_Vertices</a> *<a class="code" href="struct__Param__Polyhedron.html#183b47f3f8b8c27079a840c934e7b972">V</a>; <span class="comment">/* Pointer to the list of parameteric vertices */</span>
<a name="l00143"></a><a class="code" href="struct__Param__Polyhedron.html#23eb52a684bb212c4cf1fbcbd9db066c">00143</a> <a class="code" href="struct__Param__Domain.html">Param_Domain</a> *<a class="code" href="struct__Param__Polyhedron.html#23eb52a684bb212c4cf1fbcbd9db066c">D</a>; <span class="comment">/* Pointer to the list of validity domains */</span>
<a name="l00144"></a><a class="code" href="struct__Param__Polyhedron.html#c89157421ffc9312f82b11cb89a05dfe">00144</a> <a class="code" href="structmatrix.html">Matrix</a> *<a class="code" href="struct__Param__Polyhedron.html#c89157421ffc9312f82b11cb89a05dfe">Constraints</a>;<span class="comment">/* Constraints referred to by V->Facets */</span>
<a name="l00145"></a><a class="code" href="struct__Param__Polyhedron.html#3daced8ddb352cfa5ed1eeb949f102c5">00145</a> <a class="code" href="structmatrix.html">Matrix</a> *<a class="code" href="struct__Param__Polyhedron.html#3daced8ddb352cfa5ed1eeb949f102c5">Rays</a>; <span class="comment">/* Lines/rays (non parametric) */</span>
<a name="l00146"></a>00146 } <a class="code" href="struct__Param__Polyhedron.html">Param_Polyhedron</a>;
<a name="l00147"></a>00147
<a name="l00148"></a><a class="code" href="types_8h.html#ea9236e3c02c25e1cb628684409630fc">00148</a> <span class="preprocessor">#define FORALL_PVertex_in_ParamPolyhedron(_V, _D, _P) \</span>
<a name="l00149"></a>00149 <span class="preprocessor">{ int _i, _ix; \</span>
<a name="l00150"></a>00150 <span class="preprocessor"> unsigned _bx; \</span>
<a name="l00151"></a>00151 <span class="preprocessor"> for( _i=0, _ix=0, _bx=MSB, _V=_P->V ; \</span>
<a name="l00152"></a>00152 <span class="preprocessor"> _V && (_i<_P->nbV) ; _i++, _V=_V->next ) \</span>
<a name="l00153"></a>00153 <span class="preprocessor"> { if (_D->F[_ix] & _bx) \</span>
<a name="l00154"></a>00154 <span class="preprocessor"> {</span>
<a name="l00155"></a>00155 <span class="preprocessor"></span>
<a name="l00156"></a><a class="code" href="types_8h.html#670b1ea03d880e2595bddca5745df8ec">00156</a> <span class="preprocessor">#define END_FORALL_PVertex_in_ParamPolyhedron \</span>
<a name="l00157"></a>00157 <span class="preprocessor"> } \</span>
<a name="l00158"></a>00158 <span class="preprocessor"> NEXT(_ix, _bx); \</span>
<a name="l00159"></a>00159 <span class="preprocessor"> } \</span>
<a name="l00160"></a>00160 <span class="preprocessor">}</span>
<a name="l00161"></a>00161 <span class="preprocessor"></span>
<a name="l00162"></a>00162 <span class="comment">/* Data structures for pseudo-polynomial */</span>
<a name="l00163"></a>00163
<a name="l00164"></a><a class="code" href="types_8h.html#01e5f42033d0f34c1a182a25a7409feda486649798da33c51389df14eaccd3ce">00164</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a class="code" href="types_8h.html#01e5f42033d0f34c1a182a25a7409feda486649798da33c51389df14eaccd3ce">polynomial</a>, <a class="code" href="types_8h.html#01e5f42033d0f34c1a182a25a7409fed3cb930eb7594d2236ab4fc6dd622c207">periodic</a>, <a class="code" href="types_8h.html#01e5f42033d0f34c1a182a25a7409fedcabe6900b0394de2166c488c664bdd6a">evector</a> } <a class="code" href="types_8h.html#01e5f42033d0f34c1a182a25a7409fed">enode_type</a>;
<a name="l00165"></a>00165
<a name="l00166"></a>00166 <span class="preprocessor">#ifdef CLN</span>
<a name="l00167"></a>00167 <span class="preprocessor"></span><span class="preprocessor">#define POLY_UNION_OR_STRUCT struct</span>
<a name="l00168"></a>00168 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00169"></a><a class="code" href="types_8h.html#a4be88adae6068f5be6a24cfc1bfc9ba">00169</a> <span class="preprocessor"></span><span class="preprocessor">#define POLY_UNION_OR_STRUCT union</span>
<a name="l00170"></a>00170 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00171"></a>00171 <span class="preprocessor"></span>
<a name="l00172"></a><a class="code" href="struct__evalue.html">00172</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__evalue.html">_evalue</a> {
<a name="l00173"></a><a class="code" href="struct__evalue.html#e4aada7b06d44dcbf9f4d2daf1834e29">00173</a> Value <a class="code" href="struct__evalue.html#e4aada7b06d44dcbf9f4d2daf1834e29">d</a>; <span class="comment">/* denominator */</span>
<a name="l00174"></a>00174 <a class="code" href="types_8h.html#a4be88adae6068f5be6a24cfc1bfc9ba">POLY_UNION_OR_STRUCT</a> {
<a name="l00175"></a>00175 Value <a class="code" href="polyparam_8c.html#76f11d9a0a47b94f72c2d0e77fb32240">n</a>; <span class="comment">/* numerator (if denominator != 0) */</span>
<a name="l00176"></a>00176 <span class="keyword">struct </span><a class="code" href="struct__enode.html">_enode</a> *<a class="code" href="vector_8c.html#a45b2e3dcf291527c5aedc420819adfc">p</a>; <span class="comment">/* pointer (if denominator == 0) */</span>
<a name="l00177"></a>00177 } x;
<a name="l00178"></a>00178 } <a class="code" href="struct__evalue.html">evalue</a>;
<a name="l00179"></a>00179
<a name="l00180"></a><a class="code" href="struct__enode.html">00180</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__enode.html">_enode</a> {
<a name="l00181"></a><a class="code" href="struct__enode.html#36787a943f0f24530a8934c48a69d282">00181</a> <a class="code" href="types_8h.html#01e5f42033d0f34c1a182a25a7409fed">enode_type</a> <a class="code" href="struct__enode.html#36787a943f0f24530a8934c48a69d282">type</a>; <span class="comment">/* polynomial or periodic or evector */</span>
<a name="l00182"></a><a class="code" href="struct__enode.html#ba9a89a7893638f2ad9d77c9d0247797">00182</a> <span class="keywordtype">int</span> <a class="code" href="struct__enode.html#ba9a89a7893638f2ad9d77c9d0247797">size</a>; <span class="comment">/* number of attached pointers */</span>
<a name="l00183"></a><a class="code" href="struct__enode.html#1230adfbd7f0ca1f8628a03be4e6ef35">00183</a> <span class="keywordtype">int</span> <a class="code" href="struct__enode.html#1230adfbd7f0ca1f8628a03be4e6ef35">pos</a>; <span class="comment">/* parameter position */</span>
<a name="l00184"></a><a class="code" href="struct__enode.html#215794f8b8ab87573bd46f14a8e916d4">00184</a> <a class="code" href="struct__evalue.html">evalue</a> <a class="code" href="struct__enode.html#215794f8b8ab87573bd46f14a8e916d4">arr</a>[1]; <span class="comment">/* array of rational/pointer */</span>
<a name="l00185"></a>00185 } <a class="code" href="struct__enode.html">enode</a>;
<a name="l00186"></a>00186
<a name="l00187"></a><a class="code" href="struct__enumeration.html">00187</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__enumeration.html">_enumeration</a> {
<a name="l00188"></a>00188
<a name="l00189"></a><a class="code" href="struct__enumeration.html#57e35419d63ab12898542ef58d8decac">00189</a> <a class="code" href="structpolyhedron.html">Polyhedron</a> *<a class="code" href="struct__enumeration.html#57e35419d63ab12898542ef58d8decac">ValidityDomain</a>; <span class="comment">/* contraints on the parameters */</span>
<a name="l00190"></a><a class="code" href="struct__enumeration.html#a499b062a10ce16356e9b52d25cae0d9">00190</a> <a class="code" href="struct__evalue.html">evalue</a> <a class="code" href="struct__enumeration.html#a499b062a10ce16356e9b52d25cae0d9">EP</a>; <span class="comment">/* dimension = combined space */</span>
<a name="l00191"></a><a class="code" href="struct__enumeration.html#d2fd42474e015c9abc6aea0e2bea08b8">00191</a> <span class="keyword">struct </span><a class="code" href="struct__enumeration.html">_enumeration</a> *<a class="code" href="struct__enumeration.html#d2fd42474e015c9abc6aea0e2bea08b8">next</a>; <span class="comment">/* Ehrhart Polynomial, corresponding</span>
<a name="l00192"></a>00192 <span class="comment"> to parameter values inside the</span>
<a name="l00193"></a>00193 <span class="comment"> domain ValidityDomain below */</span>
<a name="l00194"></a>00194 } <a class="code" href="struct__enumeration.html">Enumeration</a>;
<a name="l00195"></a>00195
<a name="l00196"></a>00196 <span class="comment">/*-----------------------------Example Usage------------------------------*/</span>
<a name="l00197"></a>00197 <span class="comment">/* enode *e */</span>
<a name="l00198"></a>00198 <span class="comment">/* e->type = polynomial e->type = periodic e->type = evector */</span>
<a name="l00199"></a>00199 <span class="comment">/* e->size = degree+1 e->size = period e->size = length */</span>
<a name="l00200"></a>00200 <span class="comment">/* e->pos = [1..nb_param] */</span>
<a name="l00201"></a>00201 <span class="comment">/* e->arr[i].d = denominator (Value) */</span>
<a name="l00202"></a>00202 <span class="comment">/* e->arr[i].x.p = pointer to another enode (if denominator is zero) */</span>
<a name="l00203"></a>00203 <span class="comment">/* e->arr[i].x.n = numerator (Value) (if denominator is non-zero) */</span>
<a name="l00204"></a>00204 <span class="comment">/*------------------------------------------------------------------------*/</span>
<a name="l00205"></a>00205
<a name="l00206"></a>00206 <span class="comment">/*------------------------------------------------------------------------*/</span>
<a name="l00207"></a>00207 <span class="comment">/* This representation has the following advantages: */</span>
<a name="l00208"></a>00208 <span class="comment">/* -- its dynamic, it can grow/shrink easily */</span>
<a name="l00209"></a>00209 <span class="comment">/* -- it is easy to evaluate for a given context (values of parameters) */</span>
<a name="l00210"></a>00210 <span class="comment">/* -- it allows pseudo-polynomial to be reduced with rules */</span>
<a name="l00211"></a>00211 <span class="comment">/* -- it can be constructed recursively */</span>
<a name="l00212"></a>00212 <span class="comment">/*------------------------------------------------------------------------*/</span>
<a name="l00213"></a>00213
<a name="l00214"></a>00214 <span class="comment">/* *********************** |Represnting Z-Polyhedron| ******************* */</span>
<a name="l00215"></a>00215
<a name="l00216"></a>00216
<a name="l00217"></a><a class="code" href="types_8h.html#39db6982619d623273fad8a3834893096d32c34708a0a3507c4bdb89219d650b">00217</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {<a class="code" href="types_8h.html#39db6982619d623273fad8a383489309f9d46b7804d93a4fcde88489a1b68c24">False</a> = 0, <a class="code" href="types_8h.html#39db6982619d623273fad8a3834893096d32c34708a0a3507c4bdb89219d650b">True</a> = 1} <a class="code" href="types_8h.html#39db6982619d623273fad8a383489309">Bool</a>;
<a name="l00218"></a><a class="code" href="types_8h.html#c8d4befd62b1ee6f70e665b1db3192cf">00218</a> <span class="keyword">typedef</span> <a class="code" href="structmatrix.html">Matrix</a> <a class="code" href="structmatrix.html">Lattice</a>;
<a name="l00219"></a><a class="code" href="structLatticeUnion.html">00219</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structLatticeUnion.html">LatticeUnion</a> {
<a name="l00220"></a><a class="code" href="structLatticeUnion.html#b9b004530ace366d12a2cf46e7a13175">00220</a> <a class="code" href="structmatrix.html">Lattice</a> *<a class="code" href="structLatticeUnion.html#b9b004530ace366d12a2cf46e7a13175">M</a>;
<a name="l00221"></a><a class="code" href="structLatticeUnion.html#b21274825bf2e44967e1fcf6f42bcd88">00221</a> <span class="keyword">struct </span><a class="code" href="structLatticeUnion.html">LatticeUnion</a> *<a class="code" href="structLatticeUnion.html#b21274825bf2e44967e1fcf6f42bcd88">next</a>;
<a name="l00222"></a>00222 } <a class="code" href="structLatticeUnion.html">LatticeUnion</a>;
<a name="l00223"></a>00223
<a name="l00224"></a><a class="code" href="structZPolyhedron.html">00224</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structZPolyhedron.html">ZPolyhedron</a> {
<a name="l00225"></a><a class="code" href="structZPolyhedron.html#99898c1e05ac9dd7043b4bb900740b02">00225</a> <a class="code" href="structmatrix.html">Lattice</a> *<a class="code" href="structZPolyhedron.html#99898c1e05ac9dd7043b4bb900740b02">Lat</a> ;
<a name="l00226"></a><a class="code" href="structZPolyhedron.html#a02d9c99e02cb5f77550a865943637af">00226</a> <a class="code" href="structpolyhedron.html">Polyhedron</a> *<a class="code" href="structZPolyhedron.html#a02d9c99e02cb5f77550a865943637af">P</a>;
<a name="l00227"></a><a class="code" href="structZPolyhedron.html#03a31e09bc3818f7b069323376699bb2">00227</a> <span class="keyword">struct </span><a class="code" href="structZPolyhedron.html">ZPolyhedron</a> *<a class="code" href="structZPolyhedron.html#03a31e09bc3818f7b069323376699bb2">next</a>;
<a name="l00228"></a>00228 } <a class="code" href="structZPolyhedron.html">ZPolyhedron</a>;
<a name="l00229"></a>00229
<a name="l00230"></a>00230 <span class="preprocessor">#ifndef FOREVER</span>
<a name="l00231"></a><a class="code" href="types_8h.html#75c828ed6c02fcd44084e67a032e422c">00231</a> <span class="preprocessor"></span><span class="preprocessor">#define FOREVER for(;;)</span>
<a name="l00232"></a>00232 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00233"></a>00233 <span class="preprocessor"></span>
<a name="l00234"></a>00234 <span class="preprocessor">#endif </span><span class="comment">/* _types_polylib_h_ */</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 15 18:34:00 2009 for polylib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>
|