File: homogenization_8c.html

package info (click to toggle)
polylib 5.22.5-3%2Bdfsg
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 14,444 kB
  • ctags: 52,958
  • sloc: ansic: 16,342; sh: 10,134; makefile: 560
file content (305 lines) | stat: -rw-r--r-- 19,833 bytes parent folder | download | duplicates (4)
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>polylib: homogenization.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;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>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>homogenization.c File Reference</h1><code>#include &lt;<a class="el" href="assert_8h_source.html">assert.h</a>&gt;</code><br/>
<code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &lt;string.h&gt;</code><br/>
<code>#include &lt;<a class="el" href="polylib_8h_source.html">polylib/polylib.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="homogenization_8h_source.html">polylib/homogenization.h</a>&gt;</code><br/>

<p><a href="homogenization_8c_source.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct__evalue.html">evalue</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="homogenization_8c.html#af7a29828963075a67e9d7e95325ee972">dehomogenize_periodic</a> (<a class="el" href="struct__enode.html">enode</a> *en)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="homogenization_8c.html">homogenization.c</a> copyright 2004-2005 Bavo Nootaert  <a href="#af7a29828963075a67e9d7e95325ee972"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct__evalue.html">evalue</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="homogenization_8c.html#aca605e4d7473dda2b7499e9f7fb44f53">dehomogenize_polynomial</a> (<a class="el" href="struct__enode.html">enode</a> *en)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">dehomogenize a polynomial.  <a href="#aca605e4d7473dda2b7499e9f7fb44f53"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structpolyhedron.html">Polyhedron</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="homogenization_8c.html#afc536ef283eb21ce3e2cbcd450d72969">homogenize</a> (<a class="el" href="structpolyhedron.html">Polyhedron</a> *P, unsigned MAXRAYS)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="homogenization_8c.html#aad8cd6181d26eb3f13171462ee30b932">dehomogenize_evalue</a> (<a class="el" href="struct__evalue.html">evalue</a> *ep, int nb_param)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">dehomogenize an evalue.  <a href="#aad8cd6181d26eb3f13171462ee30b932"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="homogenization_8c.html#af91fee5e1af870b385e88405cf116652">dehomogenize_enode</a> (<a class="el" href="struct__enode.html">enode</a> *<a class="el" href="vector_8c.html#aa45b2e3dcf291527c5aedc420819adfc">p</a>, int nb_param)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">dehomogenize all evalues in an enode.  <a href="#af91fee5e1af870b385e88405cf116652"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structpolyhedron.html">Polyhedron</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="homogenization_8c.html#abab952bcd8adf0cc6af6a70823648266">dehomogenize_polyhedron</a> (<a class="el" href="structpolyhedron.html">Polyhedron</a> *<a class="el" href="vector_8c.html#aa45b2e3dcf291527c5aedc420819adfc">p</a>, int maxRays)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">dehomogenize a <a class="el" href="structpolyhedron.html">polyhedron</a>.  <a href="#abab952bcd8adf0cc6af6a70823648266"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="homogenization_8c.html#a06456b946001b8ddaf7203de4856abd7">dehomogenize_enumeration</a> (<a class="el" href="struct__enumeration.html">Enumeration</a> *en, int nb_params, int maxRays)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">dehomogenize an enumeration.  <a href="#a06456b946001b8ddaf7203de4856abd7"></a><br/></td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="af91fee5e1af870b385e88405cf116652"></a><!-- doxytag: member="homogenization.c::dehomogenize_enode" ref="af91fee5e1af870b385e88405cf116652" args="(enode *p, int nb_param)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dehomogenize_enode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__enode.html">enode</a> *&nbsp;</td>
          <td class="paramname"> <em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>nb_param</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>dehomogenize all evalues in an enode. </p>
<p>This function is mutually recursive with dehomogenize_evalue. </p>

<p>Definition at line <a class="el" href="homogenization_8c_source.html#l00077">77</a> of file <a class="el" href="homogenization_8c_source.html">homogenization.c</a>.</p>

<p>References <a class="el" href="types_8h_source.html#l00201">_enode::arr</a>, <a class="el" href="homogenization_8c_source.html#l00048">dehomogenize_evalue()</a>, and <a class="el" href="types_8h_source.html#l00199">_enode::size</a>.</p>

<p>Referenced by <a class="el" href="homogenization_8c_source.html#l00048">dehomogenize_evalue()</a>.</p>

</div>
</div>
<a class="anchor" id="a06456b946001b8ddaf7203de4856abd7"></a><!-- doxytag: member="homogenization.c::dehomogenize_enumeration" ref="a06456b946001b8ddaf7203de4856abd7" args="(Enumeration *en, int nb_params, int maxRays)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dehomogenize_enumeration </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__enumeration.html">Enumeration</a> *&nbsp;</td>
          <td class="paramname"> <em>en</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>nb_params</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>maxRays</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>dehomogenize an enumeration. </p>
<p>Replaces each validity domain and <a class="el" href="classEhrhart.html">Ehrhart</a> polynomial in the Enumeration en with the dehomogenized form. </p>

<p>Definition at line <a class="el" href="homogenization_8c_source.html#l00172">172</a> of file <a class="el" href="homogenization_8c_source.html">homogenization.c</a>.</p>

<p>References <a class="el" href="homogenization_8c_source.html#l00048">dehomogenize_evalue()</a>, <a class="el" href="homogenization_8c_source.html#l00155">dehomogenize_polyhedron()</a>, <a class="el" href="types_8h_source.html#l00207">_enumeration::EP</a>, <a class="el" href="types_8h_source.html#l00208">_enumeration::next</a>, <a class="el" href="polyhedron_8c_source.html#l01603">Polyhedron_Free()</a>, and <a class="el" href="types_8h_source.html#l00206">_enumeration::ValidityDomain</a>.</p>

<p>Referenced by <a class="el" href="testehrhart_8c_source.html#l00130">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aad8cd6181d26eb3f13171462ee30b932"></a><!-- doxytag: member="homogenization.c::dehomogenize_evalue" ref="aad8cd6181d26eb3f13171462ee30b932" args="(evalue *ep, int nb_param)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dehomogenize_evalue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__evalue.html">evalue</a> *&nbsp;</td>
          <td class="paramname"> <em>ep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>nb_param</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>dehomogenize an evalue. </p>
<p>The last parameter (nb_param) is replaced by 1. This function is mutually recursive with dehomogenize_enode. </p>

<p><p>cannot dehomogenize rationals</p>
<p>we need to replace the last parameter</p>
<p>Not the last parameter. Recurse </p>
</p>

<p>Definition at line <a class="el" href="homogenization_8c_source.html#l00048">48</a> of file <a class="el" href="homogenization_8c_source.html">homogenization.c</a>.</p>

<p>References <a class="el" href="types_8h_source.html#l00190">_evalue::d</a>, <a class="el" href="homogenization_8c_source.html#l00077">dehomogenize_enode()</a>, <a class="el" href="homogenization_8c_source.html#l00087">dehomogenize_periodic()</a>, <a class="el" href="homogenization_8c_source.html#l00102">dehomogenize_polynomial()</a>, <a class="el" href="ehrhart_8c_source.html#l00139">free_evalue_refs()</a>, <a class="el" href="types_8h_source.html#l00181">periodic</a>, and <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00553">value_zero_p</a>.</p>

<p>Referenced by <a class="el" href="homogenization_8c_source.html#l00077">dehomogenize_enode()</a>, <a class="el" href="homogenization_8c_source.html#l00172">dehomogenize_enumeration()</a>, and <a class="el" href="ehrhart_8c_source.html#l01860">Polyhedron_Enumerate()</a>.</p>

</div>
</div>
<a class="anchor" id="af7a29828963075a67e9d7e95325ee972"></a><!-- doxytag: member="homogenization.c::dehomogenize_periodic" ref="af7a29828963075a67e9d7e95325ee972" args="(enode *en)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct__evalue.html">evalue</a> * dehomogenize_periodic </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__enode.html">enode</a> *&nbsp;</td>
          <td class="paramname"> <em>en</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p><a class="el" href="homogenization_8c.html">homogenization.c</a> copyright 2004-2005 Bavo Nootaert </p>
<p>return the 1st element of an enode representing a periodic </p>

<p>Definition at line <a class="el" href="homogenization_8c_source.html#l00087">87</a> of file <a class="el" href="homogenization_8c_source.html">homogenization.c</a>.</p>

<p>References <a class="el" href="types_8h_source.html#l00201">_enode::arr</a>, <a class="el" href="assert_8h_source.html#l00026">assert</a>, <a class="el" href="types_8h_source.html#l00190">_evalue::d</a>, <a class="el" href="types_8h_source.html#l00181">periodic</a>, <a class="el" href="types_8h_source.html#l00199">_enode::size</a>, <a class="el" href="types_8h_source.html#l00198">_enode::type</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00459">value_assign</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00458">value_init</a>, and <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00554">value_notzero_p</a>.</p>

<p>Referenced by <a class="el" href="homogenization_8c_source.html#l00048">dehomogenize_evalue()</a>.</p>

</div>
</div>
<a class="anchor" id="abab952bcd8adf0cc6af6a70823648266"></a><!-- doxytag: member="homogenization.c::dehomogenize_polyhedron" ref="abab952bcd8adf0cc6af6a70823648266" args="(Polyhedron *p, int maxRays)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structpolyhedron.html">Polyhedron</a>* dehomogenize_polyhedron </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpolyhedron.html">Polyhedron</a> *&nbsp;</td>
          <td class="paramname"> <em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>maxRays</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>dehomogenize a <a class="el" href="structpolyhedron.html">polyhedron</a>. </p>
<p>Assume the <a class="el" href="structpolyhedron.html">polyhedron</a> p is homogenous. Returns a new <a class="el" href="structpolyhedron.html">polyhedron</a>. </p>

<p>Definition at line <a class="el" href="homogenization_8c_source.html#l00155">155</a> of file <a class="el" href="homogenization_8c_source.html">homogenization.c</a>.</p>

<p>References <a class="el" href="polyhedron_8c_source.html#l01906">Constraints2Polyhedron()</a>, <a class="el" href="matrix_8c_source.html#l00045">Matrix_Alloc()</a>, <a class="el" href="matrix_8c_source.html#l00092">Matrix_Free()</a>, <a class="el" href="types_8h_source.html#l00092">matrix::NbColumns</a>, <a class="el" href="types_8h_source.html#l00092">matrix::NbRows</a>, <a class="el" href="types_8h_source.html#l00093">matrix::p</a>, <a class="el" href="polyhedron_8c_source.html#l02056">Polyhedron2Constraints()</a>, and <a class="el" href="vector_8c_source.html#l00269">Vector_Copy()</a>.</p>

<p>Referenced by <a class="el" href="homogenization_8c_source.html#l00172">dehomogenize_enumeration()</a>.</p>

</div>
</div>
<a class="anchor" id="aca605e4d7473dda2b7499e9f7fb44f53"></a><!-- doxytag: member="homogenization.c::dehomogenize_polynomial" ref="aca605e4d7473dda2b7499e9f7fb44f53" args="(enode *en)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct__evalue.html">evalue</a> * dehomogenize_polynomial </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__enode.html">enode</a> *&nbsp;</td>
          <td class="paramname"> <em>en</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>dehomogenize a polynomial. </p>
<p>Assume the enode contains a polynomial in one variable, the homogenous parameter. Returns an new evalue, representing a rational. </p>

<p><p>enumerate over all coefficients (which are either periodic or rational, but not polynomial)</p>
<p>add ev (fraction) to num/den</p>
<p>simplify num/den</p>
<p>create new evalue representing num/den</p>
<p>cleanup </p>
</p>

<p>Definition at line <a class="el" href="homogenization_8c_source.html#l00102">102</a> of file <a class="el" href="homogenization_8c_source.html">homogenization.c</a>.</p>

<p>References <a class="el" href="types_8h_source.html#l00201">_enode::arr</a>, <a class="el" href="assert_8h_source.html#l00026">assert</a>, <a class="el" href="types_8h_source.html#l00190">_evalue::d</a>, <a class="el" href="types_8h_source.html#l00181">polynomial</a>, <a class="el" href="types_8h_source.html#l00199">_enode::size</a>, <a class="el" href="types_8h_source.html#l00198">_enode::type</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00514">value_addto</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00459">value_assign</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00462">value_clear</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00524">value_divexact</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00532">value_gcd</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00458">value_init</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00519">value_multiply</a>, <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00460">value_set_si</a>, and <a class="el" href="source_2arith_2arithmetique_8h_source.html#l00553">value_zero_p</a>.</p>

<p>Referenced by <a class="el" href="homogenization_8c_source.html#l00048">dehomogenize_evalue()</a>.</p>

</div>
</div>
<a class="anchor" id="afc536ef283eb21ce3e2cbcd450d72969"></a><!-- doxytag: member="homogenization.c::homogenize" ref="afc536ef283eb21ce3e2cbcd450d72969" args="(Polyhedron *P, unsigned MAXRAYS)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structpolyhedron.html">Polyhedron</a>* homogenize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpolyhedron.html">Polyhedron</a> *&nbsp;</td>
          <td class="paramname"> <em>P</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>MAXRAYS</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="homogenization_8c_source.html#l00031">31</a> of file <a class="el" href="homogenization_8c_source.html">homogenization.c</a>.</p>

<p>References <a class="el" href="Matop_8c_source.html#l00286">AddANullColumn()</a>, <a class="el" href="types_8h_source.html#l00111">polyhedron::Constraint</a>, <a class="el" href="polyhedron_8c_source.html#l01906">Constraints2Polyhedron()</a>, <a class="el" href="types_8h_source.html#l00110">polyhedron::Dimension</a>, <a class="el" href="matrix_8c_source.html#l00092">Matrix_Free()</a>, <a class="el" href="types_8h_source.html#l00092">matrix::NbColumns</a>, <a class="el" href="types_8h_source.html#l00110">polyhedron::NbConstraints</a>, <a class="el" href="types_8h_source.html#l00092">matrix::NbRows</a>, <a class="el" href="types_8h_source.html#l00093">matrix::p</a>, <a class="el" href="types_8h_source.html#l00113">polyhedron::p_Init</a>, and <a class="el" href="types_8h_source.html#l00094">matrix::p_Init</a>.</p>

<p>Referenced by <a class="el" href="ehrhart_8c_source.html#l01860">Polyhedron_Enumerate()</a>.</p>

</div>
</div>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Wed Nov 25 17:45:27 2009 for polylib by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>