solution.h

Go to the documentation of this file.
00001 /*
00002  * solution.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_SOLUTION_H
00022 # define FM_SOLUTION_H
00023 
00024 # include <fm/list.h>
00025 # include <fm/vector.h>
00026 # include <fm/system.h>
00027 # include <fm/options.h>
00028 
00029 # define FM_SOLUTION_PRINT_POINT 1
00030 
00031 BEGIN_C_DECLS
00032 
00033 struct s_fm_ball
00034 {
00035   s_fm_list_t* positive;
00036   s_fm_list_t* negative;
00037 };
00038 
00039 typedef struct s_fm_ball s_fm_ball_t;
00040 
00041 
00042 struct s_fm_solution
00043 {
00044   s_fm_ball_t* solution;
00045   unsigned size;
00046 };
00047 
00048 typedef struct s_fm_solution s_fm_solution_t;
00049 
00050 typedef void (*point_fun_t)(s_fm_solution_t*, s_fm_vector_t*, int, void*);
00051 
00052 extern
00053 s_fm_solution_t*
00054 fm_solution_alloc (size_t size);
00055 
00056 extern
00057 void
00058 fm_solution_free (s_fm_solution_t* s);
00059 
00060 extern
00061 s_fm_solution_t*
00062 fm_solution_dup (s_fm_solution_t* s);
00063 
00064 extern
00065 void
00066 fm_solution_print (FILE* stream, s_fm_solution_t* s);
00067 
00068 
00069 extern
00070 s_fm_system_t*
00071 fm_solution_to_system (s_fm_solution_t* s);
00072 
00073 
00074 extern
00075 s_fm_system_t*
00076 fm_solution_to_system_at (s_fm_solution_t* s, int idx);
00077 
00078 
00079 extern
00080 int
00081 fm_solution_add_line_at (s_fm_solution_t* s, s_fm_vector_t* v, unsigned idx);
00082 
00083 extern
00084 int
00085 fm_solution_add_unique_line_at (s_fm_solution_t* s,
00086                                 s_fm_vector_t* v,
00087                                 unsigned idx);
00088 
00089 extern
00090 s_fm_solution_t*
00091 fm_system_to_solution (s_fm_system_t* s);
00092 
00093 
00094 extern
00095 s_fm_system_t*
00096 fm_system_reduce (s_fm_system_t* in, s_fm_solution_t* redeq);
00097 
00098 
00099 extern
00100 void
00101 fm_system_subst_in_vector (s_fm_vector_t* v,
00102                            s_fm_vector_t* v1,
00103                            s_fm_vector_t* pattern,
00104                            s_fm_solution_t* redeq,
00105                            int iv1);
00106 
00107 extern
00108 int
00109 fm_solution_equalities_find (s_fm_solution_t* s);
00110 
00111 extern
00112 void
00113 fm_solution_cut (s_fm_solution_t* s, int dim);
00114 
00115 extern
00116 int
00117 fm_solution_point_included (s_fm_solution_t* s, s_fm_vector_t* v);
00118 
00119 extern
00120 unsigned long long int
00121 fm_solution_count (s_fm_solution_t* sol, int bound_limit, int mask);
00122 
00123 extern
00124 void
00125 fm_solution_traverse (s_fm_solution_t* sol, int bound_limit, int mask,
00126                       point_fun_t f, void* data);
00127 
00128 /* Must have piplib on the system. */
00129 # ifdef HAVE_LIBPIPLIB
00130 
00131 extern
00132 s_fm_solution_t*
00133 fm_solution_simplify (s_fm_solution_t* s,
00134                       int simplify_mode);
00135 
00136 # endif
00137 
00138 END_C_DECLS
00139 
00140 
00141 #endif // FM_SOLUTION_H

Generated on Thu Oct 30 13:38:21 2008 for FM by  doxygen 1.5.3