Get rid of the warning about ignoring the return value of fgets
[cloog/uuh.git] / include / cloog / matrix.h
blob2b73039e126083090be4e79d8935b2d19d9938f3
1 #ifndef CLOOG_MATRIX_H
2 #define CLOOG_MATRIX_H
3 #if defined(__cplusplus)
4 extern "C"
6 #endif
8 /* The CloogMatrix structure is equivalent to the PolyLib Matrix data structure
9 * (see Wil93). This structure is devoted to represent a set of constraints.
11 * The whole matrix is stored in memory row after row at the p_Init address. p
12 * is an array of pointers where p[i] points to the first element of the i^{th
13 * row. NbRows and NbColumns are respectively the number of rows and columns of
14 * the matrix. Each row corresponds to a constraint. The first element of each
15 * row is an equality/inequality tag. The constraint is an equality p(x) = 0 if
16 * the first element is 0, but it is an inequality p(x) \geq 0 if the first
17 * element is 1. The next elements are the unknown coefficients, followed by
18 * the parameter coefficients, then the constant term. For instance, the
19 * following three constraints:
21 * -i + m = 0
22 * -j + n >= 0
23 * i + j - k >= 0
25 * would be represented by the following rows:
27 * # eq/in i j k m n cst
28 * 0 0 -1 0 1 0 0
29 * 1 -1 0 0 0 1 0
30 * 1 1 1 -1 0 0 0
32 * To be able to provide different precision version (CLooG supports 32 bits,
33 * 64 bits and arbitrary precision through the GMP library), the cloog_int_t
34 * type depends on the configuration options (it may be long int for 32 bits
35 * version, long long int for 64 bits version, and mpz_t for multiple precision
36 * version). */
38 struct cloogmatrix
39 { unsigned NbRows; /* Number of rows. */
40 unsigned NbColumns; /* Number of columns. */
41 cloog_int_t ** p; /* Array of pointers to the matrix rows. */
42 cloog_int_t * p_Init; /* Matrix rows contiguously in memory. */
45 typedef struct cloogmatrix CloogMatrix;
47 CloogMatrix *cloog_matrix_alloc (unsigned, unsigned);
48 void cloog_matrix_free (CloogMatrix *);
49 void cloog_matrix_print_structure(FILE *file, CloogMatrix *M,
50 const char *prefix, const char *suffix);
51 CloogMatrix *cloog_matrix_read(FILE *input);
52 CloogMatrix *cloog_matrix_read_of_size(FILE *input,
53 unsigned n_row, unsigned n_col);
54 void cloog_matrix_print(FILE*, CloogMatrix*);
56 #if defined(__cplusplus)
58 #endif
59 #endif /* define _H */