fixed a small bug in eval ehrhart
[polylib.git] / doc / codeDoc / html / pp_8c-source.html
blob647fb4eb46312a1c3c6b5460ff99b50bce5c85df
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>pp.c Source File</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.2.15 -->
7 <center>
8 <a class="qindex" href="main.html">Main Page</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
9 <hr><h1>pp.c</h1><a href="pp_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="preprocessor">#include &lt;stdio.h&gt;</font>
10 00002 <font class="preprocessor">#include &lt;stdlib.h&gt;</font>
11 00003
12 00004 <font class="preprocessor">#include &lt;polylib/polylib.h&gt;</font>
13 00005
14 <a name="l00006"></a><a class="code" href="pp_8c.html#a0">00006</a> <font class="keywordtype">int</font> <a class="code" href="c2p_8c.html#a1">main</a>() {
15 00007
16 00008 Matrix *a, *b;
17 00009 Polyhedron *A, *B;
18 00010 Param_Polyhedron *PA;
19 00011 Param_Domain *P;
20 00012 Param_Vertices *V;
21 00013 <font class="keywordtype">int</font> nbPV;
22 00014 <font class="keywordtype">char</font> **param_name;
23 00015
24 00016 a = <a class="code" href="matrix_8c.html#a4">Matrix_Read</a>();
25 00017 <font class="keywordflow">if</font>(!a || a-&gt;NbColumns == 0) {
26 00018 fprintf(stderr,<font class="stringliteral">"Input error: empty matrix\n"</font>);
27 00019 exit(0);
28 00020 }
29 00021 A = <a class="code" href="polyhedron_8c.html#a24">Constraints2Polyhedron</a>(a, 200);
30 00022 <a class="code" href="matrix_8c.html#a1">Matrix_Free</a>(a);
31 00023 b = <a class="code" href="matrix_8c.html#a4">Matrix_Read</a>();
32 00024
33 00025 <font class="keywordflow">if</font>(!b || b-&gt;NbColumns == 0) {
34 00026 fprintf(stderr, <font class="stringliteral">"Input error: empty matrix\n"</font>);
35 00027 exit(0);
36 00028 }
37 00029 B = <a class="code" href="polyhedron_8c.html#a24">Constraints2Polyhedron</a>(b, 200);
38 00030 <a class="code" href="matrix_8c.html#a1">Matrix_Free</a>(b);
39 00031
40 00032 <font class="comment">/* Read the name of the parameters */</font>
41 00033 param_name = <a class="code" href="param_8c.html#a0">Read_ParamNames</a>(stdin, B-&gt;Dimension);
42 00034 PA = <a class="code" href="polyparam_8c.html#a41">Polyhedron2Param_Domain</a>(A,B,200);
43 00035 <font class="keywordflow">if</font>(!PA || PA-&gt;D==NULL) {
44 00036 printf(<font class="stringliteral">"---------------------------------------\n"</font>);
45 00037 printf(<font class="stringliteral">"Empty polyhedron\n"</font>);
46 00038 <font class="keywordflow">return</font> 0;
47 00039 }
48 00040 nbPV = PA-&gt;nbV;
49 00041 <a class="code" href="polyhedron_8c.html#a19">Domain_Free</a>(A);
50 00042 <a class="code" href="polyhedron_8c.html#a19">Domain_Free</a>(B);
51 00043
52 00044 <font class="comment">/*****************************/</font>
53 00045 <font class="comment">/* Scan the validity domains */</font>
54 00046 <font class="keywordflow">for</font>(P=PA-&gt;D;P;P=P-&gt;next) {
55 00047
56 00048 <font class="comment">/* prints current val. dom. */</font>
57 00049 printf( <font class="stringliteral">"---------------------------------------\n"</font> );
58 00050 printf( <font class="stringliteral">"Domain :\n"</font>);
59 00051 <a class="code" href="polyparam_8c.html#a39">Print_Domain</a>( stdout, P-&gt;Domain, param_name );
60 00052
61 00053 <font class="comment">/* scan the vertices */</font>
62 00054 printf( <font class="stringliteral">"Vertices :\n"</font>);
63 00055 FORALL_PVertex_in_ParamPolyhedron(V,P,PA) {
64 00056
65 00057 <font class="comment">/* prints each vertex */</font>
66 00058 <a class="code" href="polyparam_8c.html#a37">Print_Vertex</a>( stdout, V-&gt;Vertex, param_name );
67 00059 printf( <font class="stringliteral">"\n"</font> );
68 00060 }
69 00061 END_FORALL_PVertex_in_ParamPolyhedron;
70 00062 }
71 00063 <font class="comment">/*****************************/</font>
72 00064
73 00065 <a class="code" href="polyparam_8c.html#a44">Param_Polyhedron_Free</a>( PA );
74 00066 free(param_name);
75 00067
76 00068 <font class="keywordflow">return</font> 0;
77 00069 } <font class="comment">/* main */</font>
78 00070
79 </pre></div><hr><address align="right"><small>Generated on Fri Nov 8 12:10:07 2002 for Polylib by
80 <a href="http://www.doxygen.org/index.html">
81 <img src="doxygen.png" alt="doxygen" align="middle" border=0
82 width=110 height=53></a>1.2.15 </small></address>
83 </body>
84 </html>