1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /*                                                                           */
3 /*   File....: ratlptypes.h                                                  */
4 /*   Name....: Rational Number LP Storage Library                            */
5 /*   Author..: Thorsten Koch                                                 */
6 /*   Copyright by Author, All rights reserved                                */
7 /*                                                                           */
8 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
9 /*
10  * Copyright (C) 2003-2018 by Thorsten Koch <koch@zib.de>
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 3
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
25  */
26 #ifndef _RATLPTYPES_H_
27 #define _RATLPTYPES_H_
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 enum con_type        { CON_FREE    = 0, CON_LHS,   CON_RHS,   CON_RANGE, CON_EQUAL };
34 enum var_type        { VAR_FREE    = 0, VAR_LOWER, VAR_UPPER, VAR_BOXED, VAR_FIXED };
35 enum sos_type        { SOS_ERR     = 0, SOS_TYPE1, SOS_TYPE2 };
36 enum var_class       { VAR_CON     = 0, VAR_IMP,   VAR_INT };
37 enum lp_direct       { LP_MIN      = 0, LP_MAX };
38 enum lp_type         { LP_ERR      = 0, LP_LP, LP_IP };
39 enum lp_format       { LP_FORM_ERR = 0, LP_FORM_LPF, LP_FORM_HUM, LP_FORM_MPS, LP_FORM_RLP, LP_FORM_PIP };
40 
41 #if 0 /* not used anymore ??? */
42 enum presolve_result
43 {
44    PRESOLVE_ERROR = 0, PRESOLVE_OKAY, PRESOLVE_INFEASIBLE,
45    PRESOLVE_UNBOUNDED, PRESOLVE_VANISHED
46 };
47 typedef enum presolve_result PSResult;
48 
49 #endif
50 
51 typedef struct nonzero       Nzo;
52 typedef struct variable      Var;
53 typedef struct constraint    Con;
54 typedef struct soset         Sos;
55 typedef struct soselement    Sse;
56 typedef struct qmatentry     Qme;
57 typedef struct lpstorage     Lps;
58 
59 typedef enum   con_type      ConType;
60 typedef enum   sos_type      SosType;
61 typedef enum   var_class     VarClass;
62 typedef enum   lp_direct     LpDirect;
63 typedef enum   lp_type       LpType;
64 typedef enum   lp_format     LpFormat;
65 
66 #define LP_FLAG_CON_SCALE    0x01
67 #define LP_FLAG_CON_SEPAR    0x02
68 #define LP_FLAG_CON_CHECK    0x04
69 #define LP_FLAG_CON_INDIC    0x08
70 
71 #define HAS_LOWER(var)  ((var)->type != VAR_FREE && (var)->type != VAR_UPPER)
72 #define HAS_UPPER(var)  ((var)->type != VAR_FREE && (var)->type != VAR_LOWER)
73 #define HAS_LHS(con)    ((con)->type != CON_FREE && (con)->type != CON_RHS)
74 #define HAS_RHS(con)    ((con)->type != CON_FREE && (con)->type != CON_LHS)
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 #endif /* _RATLPTYPES_H_ */
80