Scippy

SCIP

Solving Constraint Integer Programs

scip_expr.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_expr.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for expression handlers
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Robert Lion Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_EXPR_H__
32 #define __SCIP_SCIP_EXPR_H__
33 
34 
35 #include "nlpi/type_expr.h"
36 #include "scip/def.h"
37 #include "scip/type_retcode.h"
38 #include "scip/type_scip.h"
39 #include "scip/type_sol.h"
40 
41 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
42  * this structure except the interface methods in scip.c.
43  * In optimized mode, the structure is included in scip.h, because some of the methods
44  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
45  * Additionally, the internal "set.h" is included, such that the defines in set.h are
46  * available in optimized mode.
47  */
48 #ifdef NDEBUG
49 #include "scip/struct_scip.h"
50 #include "scip/struct_stat.h"
51 #include "scip/set.h"
52 #include "scip/tree.h"
53 #include "scip/misc.h"
54 #include "scip/var.h"
55 #include "scip/cons.h"
56 #include "scip/solve.h"
57 #include "scip/debug.h"
58 #endif
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 /**@addtogroup PublicExpressionTreeMethods
65  *
66  * @{
67  */
68 
69 /** replaces array of variables in expression tree by corresponding transformed variables
70  *
71  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
72  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
73  *
74  * @pre This method can be called if @p scip is in one of the following stages:
75  * - \ref SCIP_STAGE_TRANSFORMING
76  * - \ref SCIP_STAGE_TRANSFORMED
77  * - \ref SCIP_STAGE_INITPRESOLVE
78  * - \ref SCIP_STAGE_PRESOLVING
79  * - \ref SCIP_STAGE_EXITPRESOLVE
80  * - \ref SCIP_STAGE_PRESOLVED
81  * - \ref SCIP_STAGE_INITSOLVE
82  * - \ref SCIP_STAGE_SOLVING
83  * - \ref SCIP_STAGE_SOLVED
84  * - \ref SCIP_STAGE_EXITSOLVE
85  * - \ref SCIP_STAGE_FREETRANS
86  *
87  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
88  */
89 extern
91  SCIP* scip, /**< SCIP data structure */
92  SCIP_EXPRTREE* tree /**< expression tree */
93  );
94 
95 /** evaluates an expression tree for a primal solution or LP solution
96  *
97  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
98  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
99  *
100  * @pre This method can be called if @p scip is in one of the following stages:
101  * - \ref SCIP_STAGE_PROBLEM
102  * - \ref SCIP_STAGE_TRANSFORMING
103  * - \ref SCIP_STAGE_TRANSFORMED
104  * - \ref SCIP_STAGE_INITPRESOLVE
105  * - \ref SCIP_STAGE_PRESOLVING
106  * - \ref SCIP_STAGE_EXITPRESOLVE
107  * - \ref SCIP_STAGE_PRESOLVED
108  * - \ref SCIP_STAGE_INITSOLVE
109  * - \ref SCIP_STAGE_SOLVING
110  * - \ref SCIP_STAGE_SOLVED
111  * - \ref SCIP_STAGE_EXITSOLVE
112  * - \ref SCIP_STAGE_FREETRANS
113  *
114  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
115  */
116 extern
118  SCIP* scip, /**< SCIP data structure */
119  SCIP_EXPRTREE* tree, /**< expression tree */
120  SCIP_SOL* sol, /**< a solution, or NULL for current LP solution */
121  SCIP_Real* val /**< buffer to store value */
122  );
123 
124 /** evaluates an expression tree w.r.t. current global bounds
125  *
126  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
127  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
128  *
129  * @pre This method can be called if @p scip is in one of the following stages:
130  * - \ref SCIP_STAGE_PROBLEM
131  * - \ref SCIP_STAGE_TRANSFORMING
132  * - \ref SCIP_STAGE_TRANSFORMED
133  * - \ref SCIP_STAGE_INITPRESOLVE
134  * - \ref SCIP_STAGE_PRESOLVING
135  * - \ref SCIP_STAGE_EXITPRESOLVE
136  * - \ref SCIP_STAGE_PRESOLVED
137  * - \ref SCIP_STAGE_INITSOLVE
138  * - \ref SCIP_STAGE_SOLVING
139  * - \ref SCIP_STAGE_SOLVED
140  * - \ref SCIP_STAGE_EXITSOLVE
141  * - \ref SCIP_STAGE_FREETRANS
142  *
143  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
144  */
145 extern
147  SCIP* scip, /**< SCIP data structure */
148  SCIP_EXPRTREE* tree, /**< expression tree */
149  SCIP_Real infinity, /**< value to use for infinity */
150  SCIP_INTERVAL* val /**< buffer to store result */
151  );
152 
153 /** evaluates an expression tree w.r.t. current local bounds
154  *
155  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
156  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
157  *
158  * @pre This method can be called if @p scip is in one of the following stages:
159  * - \ref SCIP_STAGE_PROBLEM
160  * - \ref SCIP_STAGE_TRANSFORMING
161  * - \ref SCIP_STAGE_TRANSFORMED
162  * - \ref SCIP_STAGE_INITPRESOLVE
163  * - \ref SCIP_STAGE_PRESOLVING
164  * - \ref SCIP_STAGE_EXITPRESOLVE
165  * - \ref SCIP_STAGE_PRESOLVED
166  * - \ref SCIP_STAGE_INITSOLVE
167  * - \ref SCIP_STAGE_SOLVING
168  * - \ref SCIP_STAGE_SOLVED
169  * - \ref SCIP_STAGE_EXITSOLVE
170  * - \ref SCIP_STAGE_FREETRANS
171  *
172  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
173  */
174 extern
176  SCIP* scip, /**< SCIP data structure */
177  SCIP_EXPRTREE* tree, /**< expression tree */
178  SCIP_Real infinity, /**< value to use for infinity */
179  SCIP_INTERVAL* val /**< buffer to store result */
180  );
181 
182 /**@} */
183 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #endif
internal methods for branch and bound tree
#define infinity
Definition: gastrans.c:71
SCIP_RETCODE SCIPevalExprtreeGlobalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip_expr.c:250
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPevalExprtreeSol(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_SOL *sol, SCIP_Real *val)
Definition: scip_expr.c:195
type definitions for return codes for SCIP methods
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
SCIP_RETCODE SCIPgetExprtreeTransformedVars(SCIP *scip, SCIP_EXPRTREE *tree)
Definition: scip_expr.c:156
internal methods for global SCIP settings
SCIP main data structure.
internal methods for problem variables
methods for debugging
datastructures for problem statistics
type definitions for storing primal CIP solutions
internal methods for main solving loop and node processing
type definitions for expressions and expression trees
#define SCIP_Real
Definition: def.h:157
internal methods for constraints and constraint handlers
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPevalExprtreeLocalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip_expr.c:315