system.h

Go to the documentation of this file.
00001 /*
00002  * system.h: this file is part of the FM project.
00003  *
00004  * FM, a fast and optimized C implementation of Fourier-Motzkin
00005  * projection algorithm.
00006  *
00007  * Copyright (C) 2006,2007,2008 Louis-Noel Pouchet
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public License
00011  * as published by the Free Software Foundation; either version 3
00012  * of the License, or (at your option) any later version.
00013  *
00014  * The complete GNU Lesser General Public Licence Notice can be found
00015  *  as the `COPYING.LESSER' file in the root directory.
00016  *
00017  * Author:
00018  * Louis-Noel Pouchet <Louis-Noel.Pouchet@inria.fr>
00019  *
00020  */
00021 #ifndef FM_SYSTEM_H
00022 # define FM_SYSTEM_H
00023 
00024 # include <stdio.h>
00025 # include <fm/vector.h>
00026 
00027 // #define FM_SOLVER_REDREC_DESCENDANT  32
00028 // #define FM_SOLVER_REDREC_IRIGOIN     64
00029 #define FM_SYSTEM_REDREC_DESCENDANT     32 // Beware to match the values in
00030 #define FM_SYSTEM_REDREC_IRIGOIN        64 // solver.h (convenience).
00031 
00032 #define FM_SYSTEM_ALLOC_BUFFER_SIZE     64
00033 
00034 BEGIN_C_DECLS
00035 
00036 struct s_fm_system
00037 {
00038   s_fm_vector_t** lines;
00039   unsigned nb_lines;
00040   unsigned nb_cols;
00041   // Internal service field.
00042   unsigned allocated;
00043 };
00044 
00045 typedef struct s_fm_system s_fm_system_t;
00046 
00047 
00048 extern
00049 s_fm_system_t*
00050 fm_system_alloc (size_t nb_lines, size_t nb_cols);
00051 
00052 extern
00053 s_fm_system_t*
00054 fm_system_dup (s_fm_system_t* s);
00055 
00056 extern
00057 void
00058 fm_system_free (s_fm_system_t* s);
00059 
00060 extern
00061 void
00062 fm_system_normalize_ineq (s_fm_system_t* s);
00063 
00064 extern
00065 s_fm_system_t*
00066 fm_system_read (FILE* stream);
00067 
00068 extern
00069 int
00070 fm_system_print (FILE* stream, s_fm_system_t* s);
00071 
00072 extern
00073 int
00074 fm_system_sort (s_fm_system_t* s, unsigned idx, unsigned* n1, unsigned* n2);
00075 
00076 extern
00077 int
00078 fm_system_remove_line (s_fm_system_t* s, unsigned idx);
00079 
00080 extern
00081 int
00082 fm_system_add_line_at (s_fm_system_t* s, s_fm_vector_t* v, unsigned idx);
00083 
00084 extern
00085 int
00086 fm_system_add_line (s_fm_system_t* s, s_fm_vector_t* v);
00087 
00088 extern
00089 int
00090 fm_system_add_column (s_fm_system_t* s, int pos);
00091 
00092 extern
00093 s_fm_system_t*
00094 fm_system_to_z (s_fm_system_t* s);
00095 
00096 extern
00097 s_fm_system_t*
00098 fm_system_swap_column (s_fm_system_t* s, unsigned col_src, unsigned col_dst);
00099 
00100 extern
00101 s_fm_system_t*
00102 fm_system_split (s_fm_system_t* s, unsigned col);
00103 
00104 extern
00105 int
00106 fm_system_remove_duplicate (s_fm_system_t* s);
00107 
00108 extern
00109 void
00110 fm_system_equalities_sort (s_fm_system_t* s);
00111 
00112 extern
00113 int
00114 fm_system_equalities_find (s_fm_system_t* s);
00115 
00116 extern
00117 int
00118 fm_system_point_included (s_fm_system_t* s, s_fm_vector_t* v);
00119 
00120 extern
00121 int**
00122 fm_system_getconnected (s_fm_system_t* system);
00123 
00124 
00125 /* Must have piplib on the system. */
00126 # ifdef HAVE_LIBPIPLIB
00127 
00128 // Forward declaration.
00129 extern
00130 int
00131 fm_piptools_check_int (s_fm_system_t* sys);
00132 
00133 
00134 extern
00135 s_fm_system_t*
00136 fm_system_simplify (s_fm_system_t* system,
00137                     int simplify_mode);
00138 # endif
00139 
00140 
00141 END_C_DECLS
00142 
00143 
00144 #endif // FM_SYSTEM_H

Generated on Fri Oct 31 00:49:13 2008 for FM by  doxygen 1.5.3