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">
6 <!-- Generated by Doxygen 1.2.15 -->
8 <a class=
"qindex" href=
"main.html">Main Page
</a> <a class=
"qindex" href=
"annotated.html">Compound List
</a> <a class=
"qindex" href=
"files.html">File List
</a> <a class=
"qindex" href=
"functions.html">Compound Members
</a> <a class=
"qindex" href=
"globals.html">File Members
</a> </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
<stdio.h
></font>
10 00002 <font class=
"preprocessor">#include
<stdlib.h
></font>
12 00004 <font class=
"preprocessor">#include
<polylib/polylib.h
></font>
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>() {
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;
24 00016 a =
<a class=
"code" href=
"matrix_8c.html#a4">Matrix_Read
</a>();
25 00017 <font class=
"keywordflow">if
</font>(!a || a-
>NbColumns ==
0) {
26 00018 fprintf(stderr,
<font class=
"stringliteral">"Input error: empty matrix\n"</font>);
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>();
33 00025 <font class=
"keywordflow">if
</font>(!b || b-
>NbColumns ==
0) {
34 00026 fprintf(stderr,
<font class=
"stringliteral">"Input error: empty matrix\n"</font>);
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);
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-
>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-
>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;
48 00040 nbPV = PA-
>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);
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-
>D;P;P=P-
>next) {
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-
>Domain, param_name );
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) {
65 00057 <font class=
"comment">/* prints each vertex */
</font>
66 00058 <a class=
"code" href=
"polyparam_8c.html#a37">Print_Vertex
</a>( stdout, V-
>Vertex, param_name );
67 00059 printf(
<font class=
"stringliteral">"\n"</font> );
69 00061 END_FORALL_PVertex_in_ParamPolyhedron;
71 00063 <font class=
"comment">/*****************************/
</font>
73 00065 <a class=
"code" href=
"polyparam_8c.html#a44">Param_Polyhedron_Free
</a>( PA );
74 00066 free(param_name);
76 00068 <font class=
"keywordflow">return
</font> 0;
77 00069 }
<font class=
"comment">/* main */
</font>
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>