Scippy

SCIP

Solving Constraint Integer Programs

dialog_stp.c
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-2015 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file dialog_stp.c
17  * @brief stp user interface dialog
18  * @author Gerald Gamrath
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #include <assert.h>
24 #include <string.h>
25 
26 #include "dialog_stp.h"
27 #include "probdata_stp.h"
28 
29 
30 /** dialog execution method for the write LP command */
31 static
32 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteStpsol)
33 { /*lint --e{715}*/
34  SCIPdialogMessage(scip, NULL, "\n");
35 
36  SCIP_CALL( SCIPprobdataWriteLogfileEnd(scip) );
37 
38  SCIPdialogMessage(scip, NULL, "written STP solution\n");
39 
40  *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr);
41 
42  return SCIP_OKAY;
43 }
44 
45 
46 
47 /** includes or updates the stp dialog menus in SCIP */
48 SCIP_RETCODE SCIPincludeDialogStp(
49  SCIP* scip /**< SCIP data structure */
50  )
51 {
52  SCIP_DIALOG* root;
53  SCIP_DIALOG* submenu;
54  SCIP_DIALOG* dialog;
55 
56  /* root menu */
57  root = SCIPgetRootDialog(scip);
58  assert(root != NULL);
59 
60  /* write */
61  assert(SCIPdialogHasEntry(root, "write"));
62  if( SCIPdialogFindEntry(root, "write", &submenu) != 1 )
63  {
64  SCIPerrorMessage("write sub menu not found\n");
65  return SCIP_PLUGINNOTFOUND;
66  }
67 
68  /* write STP solution */
69  if( !SCIPdialogHasEntry(submenu, "stpsolution") )
70  {
71  SCIP_CALL( SCIPincludeDialog(scip, &dialog,
72  NULL,
73  SCIPdialogExecWriteStpsol, NULL, NULL,
74  "stpsolution", "write solution to STP logfile", FALSE, NULL) );
75  SCIP_CALL( SCIPaddDialogEntry(scip, submenu, dialog) );
76  SCIP_CALL( SCIPreleaseDialog(scip, &dialog) );
77  }
78 
79  return SCIP_OKAY;
80 }
Problem data for stp problem.
SCIP_RETCODE SCIPprobdataWriteLogfileEnd(SCIP *scip)
#define FALSE
Definition: portab.h:37
stp user interface dialog
SCIP_RETCODE SCIPincludeDialogStp(SCIP *scip)
Definition: dialog_stp.c:48
static SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteStpsol)
Definition: dialog_stp.c:32