Scippy

SCIP

Solving Constraint Integer Programs

scip_dialog.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_dialog.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for dialog handler plugins
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_DIALOG_H__
32 #define __SCIP_SCIP_DIALOG_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_dialog.h"
37 #include "scip/type_retcode.h"
38 #include "scip/type_scip.h"
39 
40 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
41  * this structure except the interface methods in scip.c.
42  * In optimized mode, the structure is included in scip.h, because some of the methods
43  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
44  * Additionally, the internal "set.h" is included, such that the defines in set.h are
45  * available in optimized mode.
46  */
47 #ifdef NDEBUG
48 #include "scip/struct_scip.h"
49 #include "scip/struct_stat.h"
50 #include "scip/set.h"
51 #include "scip/tree.h"
52 #include "scip/misc.h"
53 #include "scip/var.h"
54 #include "scip/cons.h"
55 #include "scip/solve.h"
56 #include "scip/debug.h"
57 #endif
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 /**@addtogroup PublicDialogMethods
64  *
65  * @{
66  */
67 
68 /** creates and includes dialog
69  *
70  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
71  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
72  */
73 extern
75  SCIP* scip, /**< SCIP data structure */
76  SCIP_DIALOG** dialog, /**< pointer to store the dialog */
77  SCIP_DECL_DIALOGCOPY ((*dialogcopy)), /**< copy method of dialog or NULL if you don't want to copy your plugin into sub-SCIPs */
78  SCIP_DECL_DIALOGEXEC ((*dialogexec)), /**< execution method of dialog */
79  SCIP_DECL_DIALOGDESC ((*dialogdesc)), /**< description output method of dialog, or NULL */
80  SCIP_DECL_DIALOGFREE ((*dialogfree)), /**< destructor of dialog to free user data, or NULL */
81  const char* name, /**< name of dialog: command name appearing in parent's dialog menu */
82  const char* desc, /**< description of dialog used if description output method is NULL */
83  SCIP_Bool issubmenu, /**< is the dialog a submenu? */
84  SCIP_DIALOGDATA* dialogdata /**< user defined dialog data */
85  );
86 
87 /** returns if the dialog already exists
88  *
89  * @return TRUE is returned if the dialog exists, otherwise FALSE.
90  */
91 extern
93  SCIP* scip, /**< SCIP data structure */
94  SCIP_DIALOG* dialog /**< dialog */
95  );
96 
97 /** captures a dialog
98  *
99  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
100  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
101  */
102 extern
104  SCIP* scip, /**< SCIP data structure */
105  SCIP_DIALOG* dialog /**< dialog */
106  );
107 
108 /** releases a dialog
109  *
110  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
112  */
113 extern
115  SCIP* scip, /**< SCIP data structure */
116  SCIP_DIALOG** dialog /**< pointer to the dialog */
117  );
118 
119 /** makes given dialog the root dialog of SCIP's interactive user shell; captures dialog and releases former root dialog
120  *
121  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
122  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
123  */
124 extern
126  SCIP* scip, /**< SCIP data structure */
127  SCIP_DIALOG* dialog /**< dialog to be the root */
128  );
129 
130 /** returns the root dialog of SCIP's interactive user shell
131  *
132  * @return the root dialog of SCIP's interactive user shell is returned.
133  */
134 extern
136  SCIP* scip /**< SCIP data structure */
137  );
138 
139 /** adds a sub dialog to the given dialog as menu entry and captures it
140  *
141  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
142  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
143  */
144 extern
146  SCIP* scip, /**< SCIP data structure */
147  SCIP_DIALOG* dialog, /**< dialog to extend, or NULL for root dialog */
148  SCIP_DIALOG* subdialog /**< subdialog to add as menu entry in dialog */
149  );
150 
151 /** adds a single line of input which is treated as if the user entered the command line
152  *
153  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
154  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
155  */
156 extern
158  SCIP* scip, /**< SCIP data structure */
159  const char* inputline /**< input line to add */
160  );
161 
162 /** adds a single line of input to the command history which can be accessed with the cursor keys
163  *
164  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
165  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
166  */
167 extern
169  SCIP* scip, /**< SCIP data structure */
170  const char* inputline /**< input line to add */
171  );
172 
173 /** starts interactive mode of SCIP by executing the root dialog
174  *
175  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
176  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
177  *
178  * @pre This method can be called if @p scip is in one of the following stages:
179  * - \ref SCIP_STAGE_INIT
180  * - \ref SCIP_STAGE_FREE
181  *
182  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the
183  * interactive shell was closed:
184  * - \ref SCIP_STAGE_PROBLEM if the interactive shell was closed after the problem was created
185  * - \ref SCIP_STAGE_TRANSFORMED if the interactive shell was closed after the problem was transformed
186  * - \ref SCIP_STAGE_PRESOLVING if the interactive shell was closed during presolving
187  * - \ref SCIP_STAGE_PRESOLVED if the interactive shell was closed after presolve
188  * - \ref SCIP_STAGE_SOLVING if the interactive shell was closed during the tree search
189  * - \ref SCIP_STAGE_SOLVED if the interactive shell was closed after the problem was solved
190  * - \ref SCIP_STAGE_FREE if the interactive shell was closed after the problem was freed
191  *
192  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
193  */
194 extern
196  SCIP* scip /**< SCIP data structure */
197  );
198 
199 /**@} */
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif
internal methods for branch and bound tree
#define SCIP_DECL_DIALOGCOPY(x)
Definition: type_dialog.h:53
SCIP_RETCODE SCIPaddDialogEntry(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOG *subdialog)
Definition: scip_dialog.c:242
SCIP_Bool SCIPexistsDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip_dialog.c:163
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
struct SCIP_DialogData SCIP_DIALOGDATA
Definition: type_dialog.h:42
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPcaptureDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip_dialog.c:178
#define SCIP_DECL_DIALOGDESC(x)
Definition: type_dialog.h:73
SCIP_DIALOG * SCIPgetRootDialog(SCIP *scip)
Definition: scip_dialog.c:228
SCIP_RETCODE SCIPincludeDialog(SCIP *scip, SCIP_DIALOG **dialog, SCIP_DECL_DIALOGCOPY((*dialogcopy)), SCIP_DECL_DIALOGEXEC((*dialogexec)), SCIP_DECL_DIALOGDESC((*dialogdesc)), SCIP_DECL_DIALOGFREE((*dialogfree)), const char *name, const char *desc, SCIP_Bool issubmenu, SCIP_DIALOGDATA *dialogdata)
Definition: scip_dialog.c:130
SCIP_RETCODE SCIPaddDialogHistoryLine(SCIP *scip, const char *inputline)
Definition: scip_dialog.c:280
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
internal methods for global SCIP settings
SCIP main data structure.
internal methods for problem variables
#define SCIP_Bool
Definition: def.h:69
methods for debugging
#define SCIP_DECL_DIALOGFREE(x)
Definition: type_dialog.h:61
SCIP_RETCODE SCIPstartInteraction(SCIP *scip)
Definition: scip_dialog.c:313
datastructures for problem statistics
#define SCIP_DECL_DIALOGEXEC(x)
Definition: type_dialog.h:87
internal methods for main solving loop and node processing
type definitions for user interface dialog
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIPreleaseDialog(SCIP *scip, SCIP_DIALOG **dialog)
Definition: scip_dialog.c:195
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPsetRootDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip_dialog.c:212
SCIP_RETCODE SCIPaddDialogInputLine(SCIP *scip, const char *inputline)
Definition: scip_dialog.c:263