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-2022 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 scipopt.org. */
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 Leona 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 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /**@addtogroup PublicDialogMethods
45  *
46  * @{
47  */
48 
49 /** creates and includes dialog
50  *
51  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
52  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
53  */
54 SCIP_EXPORT
56  SCIP* scip, /**< SCIP data structure */
57  SCIP_DIALOG** dialog, /**< pointer to store the dialog */
58  SCIP_DECL_DIALOGCOPY ((*dialogcopy)), /**< copy method of dialog or NULL if you don't want to copy your plugin into sub-SCIPs */
59  SCIP_DECL_DIALOGEXEC ((*dialogexec)), /**< execution method of dialog */
60  SCIP_DECL_DIALOGDESC ((*dialogdesc)), /**< description output method of dialog, or NULL */
61  SCIP_DECL_DIALOGFREE ((*dialogfree)), /**< destructor of dialog to free user data, or NULL */
62  const char* name, /**< name of dialog: command name appearing in parent's dialog menu */
63  const char* desc, /**< description of dialog used if description output method is NULL */
64  SCIP_Bool issubmenu, /**< is the dialog a submenu? */
65  SCIP_DIALOGDATA* dialogdata /**< user defined dialog data */
66  );
67 
68 /** returns if the dialog already exists
69  *
70  * @return TRUE is returned if the dialog exists, otherwise FALSE.
71  */
72 SCIP_EXPORT
74  SCIP* scip, /**< SCIP data structure */
75  SCIP_DIALOG* dialog /**< dialog */
76  );
77 
78 /** captures a dialog
79  *
80  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
81  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
82  */
83 SCIP_EXPORT
85  SCIP* scip, /**< SCIP data structure */
86  SCIP_DIALOG* dialog /**< dialog */
87  );
88 
89 /** releases a dialog
90  *
91  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
92  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
93  */
94 SCIP_EXPORT
96  SCIP* scip, /**< SCIP data structure */
97  SCIP_DIALOG** dialog /**< pointer to the dialog */
98  );
99 
100 /** makes given dialog the root dialog of SCIP's interactive user shell; captures dialog and releases former root dialog
101  *
102  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
103  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
104  */
105 SCIP_EXPORT
107  SCIP* scip, /**< SCIP data structure */
108  SCIP_DIALOG* dialog /**< dialog to be the root */
109  );
110 
111 /** returns the root dialog of SCIP's interactive user shell
112  *
113  * @return the root dialog of SCIP's interactive user shell is returned.
114  */
115 SCIP_EXPORT
117  SCIP* scip /**< SCIP data structure */
118  );
119 
120 /** adds a sub dialog to the given dialog as menu entry and captures it
121  *
122  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
123  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
124  */
125 SCIP_EXPORT
127  SCIP* scip, /**< SCIP data structure */
128  SCIP_DIALOG* dialog, /**< dialog to extend, or NULL for root dialog */
129  SCIP_DIALOG* subdialog /**< subdialog to add as menu entry in dialog */
130  );
131 
132 /** adds a single line of input which is treated as if the user entered the command line
133  *
134  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
135  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
136  */
137 SCIP_EXPORT
139  SCIP* scip, /**< SCIP data structure */
140  const char* inputline /**< input line to add */
141  );
142 
143 /** adds a single line of input to the command history which can be accessed with the cursor keys
144  *
145  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
146  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
147  */
148 SCIP_EXPORT
150  SCIP* scip, /**< SCIP data structure */
151  const char* inputline /**< input line to add */
152  );
153 
154 /** starts interactive mode of SCIP by executing the root dialog
155  *
156  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
157  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
158  *
159  * @pre This method can be called if @p scip is in one of the following stages:
160  * - \ref SCIP_STAGE_INIT
161  * - \ref SCIP_STAGE_FREE
162  *
163  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the
164  * interactive shell was closed:
165  * - \ref SCIP_STAGE_PROBLEM if the interactive shell was closed after the problem was created
166  * - \ref SCIP_STAGE_TRANSFORMED if the interactive shell was closed after the problem was transformed
167  * - \ref SCIP_STAGE_PRESOLVING if the interactive shell was closed during presolving
168  * - \ref SCIP_STAGE_PRESOLVED if the interactive shell was closed after presolve
169  * - \ref SCIP_STAGE_SOLVING if the interactive shell was closed during the tree search
170  * - \ref SCIP_STAGE_SOLVED if the interactive shell was closed after the problem was solved
171  * - \ref SCIP_STAGE_FREE if the interactive shell was closed after the problem was freed
172  *
173  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
174  */
175 SCIP_EXPORT
177  SCIP* scip /**< SCIP data structure */
178  );
179 
180 /**@} */
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #endif
#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:162
SCIP_Bool SCIPexistsDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip_dialog.c:83
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
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:98
#define SCIP_DECL_DIALOGDESC(x)
Definition: type_dialog.h:73
SCIP_DIALOG * SCIPgetRootDialog(SCIP *scip)
Definition: scip_dialog.c:148
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:50
SCIP_RETCODE SCIPaddDialogHistoryLine(SCIP *scip, const char *inputline)
Definition: scip_dialog.c:200
type definitions for SCIP&#39;s main datastructure
#define SCIP_Bool
Definition: def.h:84
#define SCIP_DECL_DIALOGFREE(x)
Definition: type_dialog.h:61
SCIP_RETCODE SCIPstartInteraction(SCIP *scip)
Definition: scip_dialog.c:233
#define SCIP_DECL_DIALOGEXEC(x)
Definition: type_dialog.h:87
type definitions for user interface dialog
SCIP_RETCODE SCIPreleaseDialog(SCIP *scip, SCIP_DIALOG **dialog)
Definition: scip_dialog.c:115
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPsetRootDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip_dialog.c:132
SCIP_RETCODE SCIPaddDialogInputLine(SCIP *scip, const char *inputline)
Definition: scip_dialog.c:183