test_bound: rewrite in C
[barvinok/uuh.git] / zsolve / varproperties.h
blob762f3ed7c4a0558a9d96e3ca7488434cae9fbd10
1 /*
2 4ti2 -- A software package for algebraic, geometric and combinatorial
3 problems on linear spaces.
5 Copyright (C) 2006 4ti2 team.
6 Main author(s): Matthias Walter.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef _VARPROPERTIES_H
24 #define _VARPROPERTIES_H
26 #include "defs.h"
28 typedef struct variableproperty_t
30 int Column;
31 /* Ordering ID */
33 int Upper;
34 /* Upper limit, MAXINT for infinity */
36 int Lower;
37 /* Lower limit, -MAXINT for -infinity */
39 bool Free;
40 /* Free flag */
41 } variableproperty_t;
42 typedef variableproperty_t *VariableProperties;
44 VariableProperties createVariableProperties(int);
45 /* Allocate memory (size) */
47 void deleteVariableProperties(VariableProperties);
48 /* Free memory (variable) */
50 void swapVariableProperties(VariableProperties, int, int);
51 /* Swap a and b (variable, a, b) */
53 bool checkVariableSymmetry(VariableProperties, int);
54 /* Is variable symmetric? (variable, id) */
56 bool checkVariableFree(VariableProperties, int);
57 /* Is variable free? (variable, id) */
59 bool checkVariableBounds(VariableProperties, int, int);
60 /* is given number in bounds? (variable, id, num) */
62 void fprintVariableProperties(FILE *, VariableProperties, int);
63 /* print to stdout (variable, size) */
65 void readVariableProperties(FILE *, VariableProperties, int);
67 #endif