rational.h

Go to the documentation of this file.
00001 /*
00002  * rational.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-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_RATIONAL_H
00022 # define FM_RATIONAL_H
00023 
00024 # include <assert.h>
00025 # include <fm/common.h>
00026 # include <fm/macros.h>
00027 
00028 BEGIN_C_DECLS
00029 
00030 struct s_fm_rational
00031 {
00032   z_type_t      num;
00033   z_type_t      denum;
00034 };
00035 
00036 typedef struct s_fm_rational s_fm_rational_t;
00037 
00038 extern
00039 inline
00040 z_type_t
00041 fm_z_gcd(z_type_t a, z_type_t b);
00042 
00043 extern
00044 inline
00045 z_type_t
00046 fm_z_lcm(z_type_t a, z_type_t b);
00047 
00048 
00049 extern
00050 inline
00051 s_fm_rational_t*
00052 fm_rational_alloc ();
00053 
00054 extern
00055 inline
00056 void
00057 fm_rational_init (s_fm_rational_t* r);
00058 
00059 extern
00060 inline
00061 void
00062 fm_rational_print (FILE* stream, s_fm_rational_t* r);
00063 
00064 extern
00065 inline
00066 void
00067 fm_rational_free (s_fm_rational_t* r);
00068 
00069 extern
00070 inline
00071 int
00072 fm_rational_assign (s_fm_rational_t* r, z_type_t num, z_type_t denum);
00073 
00074 extern
00075 inline
00076 int
00077 fm_rational_copy (s_fm_rational_t* r, s_fm_rational_t* s);
00078 
00079 extern
00080 inline
00081 int
00082 fm_rational_assign_int (s_fm_rational_t* r, z_type_t num);
00083 
00084 extern
00085 inline
00086 int
00087 fm_rational_cmp (s_fm_rational_t* r1, s_fm_rational_t* r2);
00088 
00089 extern
00090 inline
00091 void
00092 fm_rational_add (s_fm_rational_t*r,  s_fm_rational_t* r1, s_fm_rational_t* r2);
00093 
00094 extern
00095 inline
00096 void
00097 fm_rational_sub (s_fm_rational_t*r,  s_fm_rational_t* r1, s_fm_rational_t* r2);
00098 
00099 extern
00100 inline
00101 void
00102 fm_rational_mul (s_fm_rational_t*r,  s_fm_rational_t* r1, s_fm_rational_t* r2);
00103 
00104 extern
00105 inline
00106 void
00107 fm_rational_div (s_fm_rational_t*r,  s_fm_rational_t* r1, s_fm_rational_t* r2);
00108 
00109 extern
00110 inline
00111 void
00112 fm_rational_opp (s_fm_rational_t*r,  s_fm_rational_t* r1);
00113 
00114 extern
00115 inline
00116 int
00117 fm_rational_equal (s_fm_rational_t* r1, s_fm_rational_t* r2);
00118 
00119 
00120 END_C_DECLS
00121 
00122 
00123 #endif // FM_RATIONAL_H

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