1 /* 2 4ti2 -- A software package for algebraic, geometric and combinatorial 3 problems on linear spaces. 4 5 Copyright (C) 2006 4ti2 team. 6 Main author(s): Matthias Walter. 7 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. 12 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. 17 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. 21 */ 22 23 #ifndef _VARPROPERTIES_H 24 #define _VARPROPERTIES_H 25 26 #include "defs.h" 27 28 typedef struct variableproperty_t 29 { 30 int Column; 31 /* Ordering ID */ 32 33 int Upper; 34 /* Upper limit, MAXINT for infinity */ 35 36 int Lower; 37 /* Lower limit, -MAXINT for -infinity */ 38 39 bool Free; 40 /* Free flag */ 41 } variableproperty_t; 42 typedef variableproperty_t *VariableProperties; 43 44 VariableProperties createVariableProperties(int); 45 /* Allocate memory (size) */ 46 47 void deleteVariableProperties(VariableProperties); 48 /* Free memory (variable) */ 49 50 void swapVariableProperties(VariableProperties, int, int); 51 /* Swap a and b (variable, a, b) */ 52 53 bool checkVariableSymmetry(VariableProperties, int); 54 /* Is variable symmetric? (variable, id) */ 55 56 bool checkVariableFree(VariableProperties, int); 57 /* Is variable free? (variable, id) */ 58 59 bool checkVariableBounds(VariableProperties, int, int); 60 /* is given number in bounds? (variable, id, num) */ 61 62 void fprintVariableProperties(FILE *, VariableProperties, int); 63 /* print to stdout (variable, size) */ 64 65 void readVariableProperties(FILE *, VariableProperties, int); 66 67 #endif 68