Scippy

SCIP

Solving Constraint Integer Programs

scip_disp.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-2018 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_disp.c
17  * @brief public methods for display handler plugins
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <ctype.h>
36 #include <stdarg.h>
37 #include <assert.h>
38 #include <string.h>
39 #if defined(_WIN32) || defined(_WIN64)
40 #else
41 #include <strings.h> /*lint --e{766}*/
42 #endif
43 
44 
45 #include "lpi/lpi.h"
46 #include "nlpi/exprinterpret.h"
47 #include "nlpi/nlpi.h"
48 #include "scip/benders.h"
49 #include "scip/benderscut.h"
50 #include "scip/branch.h"
51 #include "scip/branch_nodereopt.h"
52 #include "scip/clock.h"
53 #include "scip/compr.h"
54 #include "scip/concsolver.h"
55 #include "scip/concurrent.h"
56 #include "scip/conflict.h"
57 #include "scip/conflictstore.h"
58 #include "scip/cons.h"
59 #include "scip/cons_linear.h"
60 #include "scip/cutpool.h"
61 #include "scip/cuts.h"
62 #include "scip/debug.h"
63 #include "scip/def.h"
64 #include "scip/dialog.h"
65 #include "scip/dialog_default.h"
66 #include "scip/disp.h"
67 #include "scip/event.h"
68 #include "scip/heur.h"
69 #include "scip/heur_ofins.h"
70 #include "scip/heur_reoptsols.h"
72 #include "scip/heuristics.h"
73 #include "scip/history.h"
74 #include "scip/implics.h"
75 #include "scip/interrupt.h"
76 #include "scip/lp.h"
77 #include "scip/mem.h"
78 #include "scip/message_default.h"
79 #include "scip/misc.h"
80 #include "scip/nlp.h"
81 #include "scip/nodesel.h"
82 #include "scip/paramset.h"
83 #include "scip/presol.h"
84 #include "scip/presolve.h"
85 #include "scip/pricer.h"
86 #include "scip/pricestore.h"
87 #include "scip/primal.h"
88 #include "scip/prob.h"
89 #include "scip/prop.h"
90 #include "scip/reader.h"
91 #include "scip/relax.h"
92 #include "scip/reopt.h"
93 #include "scip/retcode.h"
94 #include "scip/scipbuildflags.h"
95 #include "scip/scipcoreplugins.h"
96 #include "scip/scipgithash.h"
97 #include "scip/sepa.h"
98 #include "scip/sepastore.h"
99 #include "scip/set.h"
100 #include "scip/sol.h"
101 #include "scip/solve.h"
102 #include "scip/stat.h"
103 #include "scip/syncstore.h"
104 #include "scip/table.h"
105 #include "scip/tree.h"
106 #include "scip/var.h"
107 #include "scip/visual.h"
108 #include "xml/xml.h"
109 
110 #include "scip/scip_disp.h"
111 
112 #include "scip/pub_message.h"
113 
114 
115 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
116  * this structure except the interface methods in scip.c.
117  * In optimized mode, the structure is included in scip.h, because some of the methods
118  * are implemented as defines for performance reasons (e.g. the numerical comparisons)
119  */
120 #ifndef NDEBUG
121 #include "scip/struct_scip.h"
122 #endif
123 
124 /** creates a display column and includes it in SCIP */
126  SCIP* scip, /**< SCIP data structure */
127  const char* name, /**< name of display column */
128  const char* desc, /**< description of display column */
129  const char* header, /**< head line of display column */
130  SCIP_DISPSTATUS dispstatus, /**< display activation status of display column */
131  SCIP_DECL_DISPCOPY ((*dispcopy)), /**< copy method of display column or NULL if you don't want to copy your plugin into sub-SCIPs */
132  SCIP_DECL_DISPFREE ((*dispfree)), /**< destructor of display column */
133  SCIP_DECL_DISPINIT ((*dispinit)), /**< initialize display column */
134  SCIP_DECL_DISPEXIT ((*dispexit)), /**< deinitialize display column */
135  SCIP_DECL_DISPINITSOL ((*dispinitsol)), /**< solving process initialization method of display column */
136  SCIP_DECL_DISPEXITSOL ((*dispexitsol)), /**< solving process deinitialization method of display column */
137  SCIP_DECL_DISPOUTPUT ((*dispoutput)), /**< output method */
138  SCIP_DISPDATA* dispdata, /**< display column data */
139  int width, /**< width of display column (no. of chars used) */
140  int priority, /**< priority of display column */
141  int position, /**< relative position of display column */
142  SCIP_Bool stripline /**< should the column be separated with a line from its right neighbor? */
143  )
144 {
145  SCIP_DISP* disp;
146 
147  SCIP_CALL( SCIPcheckStage(scip, "SCIPincludeDisp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
148 
149  /* check whether display column is already present */
150  if( SCIPfindDisp(scip, name) != NULL )
151  {
152  SCIPerrorMessage("display column <%s> already included.\n", name);
153  return SCIP_INVALIDDATA;
154  }
155 
156  SCIP_CALL( SCIPdispCreate(&disp, scip->set, scip->messagehdlr, scip->mem->setmem,
157  name, desc, header, dispstatus,
158  dispcopy,
159  dispfree, dispinit, dispexit, dispinitsol, dispexitsol, dispoutput, dispdata,
160  width, priority, position, stripline) );
161  SCIP_CALL( SCIPsetIncludeDisp(scip->set, disp) );
162 
163  return SCIP_OKAY;
164 }
165 
166 /** returns the display column of the given name, or NULL if not existing */
168  SCIP* scip, /**< SCIP data structure */
169  const char* name /**< name of display column */
170  )
171 {
172  assert(scip != NULL);
173  assert(scip->set != NULL);
174  assert(name != NULL);
175 
176  return SCIPsetFindDisp(scip->set, name);
177 }
178 
179 /** returns the array of currently available display columns */
181  SCIP* scip /**< SCIP data structure */
182  )
183 {
184  assert(scip != NULL);
185  assert(scip->set != NULL);
186 
187  return scip->set->disps;
188 }
189 
190 /** returns the number of currently available display columns */
192  SCIP* scip /**< SCIP data structure */
193  )
194 {
195  assert(scip != NULL);
196  assert(scip->set != NULL);
197 
198  return scip->set->ndisps;
199 }
200 
201 /** automatically selects display columns for being shown w.r.t. the display width parameter */
203  SCIP* scip /**< SCIP data structure */
204  )
205 {
206  assert(scip != NULL);
207  assert(scip->set != NULL);
208 
210 
211  return SCIP_OKAY;
212 }
213 
214 /** changes the display column mode */
216  SCIP_DISP* disp, /**< display column */
217  SCIP_DISPMODE mode /**< the display column mode */
218  )
219 {
220  assert(disp != NULL);
221 
222  SCIPdispChgMode(disp, mode);
223 }
internal methods for separators
void SCIPdispChgMode(SCIP_DISP *disp, SCIP_DISPMODE mode)
Definition: disp.c:558
int ndisps
Definition: struct_set.h:124
#define NULL
Definition: def.h:239
#define SCIP_DECL_DISPINITSOL(x)
Definition: type_disp.h:106
internal methods for managing events
default message handler
trivialnegation primal heuristic
internal methods for storing primal CIP solutions
methods to interpret (evaluate) an expression tree "fast"
struct SCIP_DispData SCIP_DISPDATA
Definition: type_disp.h:62
internal methods for branch and bound tree
SCIP_RETCODE SCIPdispAutoActivate(SCIP_SET *set)
Definition: disp.c:491
methods for implications, variable bounds, and cliques
internal methods for clocks and timing issues
internal methods for NLPI solver interfaces
enum SCIP_DispMode SCIP_DISPMODE
Definition: type_disp.h:59
interface methods for specific LP solvers
internal methods for displaying statistics tables
#define FALSE
Definition: def.h:65
methods for the aggregation rows
internal methods for Benders&#39; decomposition
#define TRUE
Definition: def.h:64
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
methods commonly used by primal heuristics
internal methods for branching rules and branching candidate storage
datastructures for concurrent solvers
SCIP_RETCODE SCIPdispCreate(SCIP_DISP **disp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, const char *header, SCIP_DISPSTATUS dispstatus, SCIP_DECL_DISPCOPY((*dispcopy)), SCIP_DECL_DISPFREE((*dispfree)), SCIP_DECL_DISPINIT((*dispinit)), SCIP_DECL_DISPEXIT((*dispexit)), SCIP_DECL_DISPINITSOL((*dispinitsol)), SCIP_DECL_DISPEXITSOL((*dispexitsol)), SCIP_DECL_DISPOUTPUT((*dispoutput)), SCIP_DISPDATA *dispdata, int width, int priority, int position, SCIP_Bool stripline)
Definition: disp.c:140
internal methods for handling parameter settings
methods for creating output for visualization tools (VBC, BAK)
nodereopt branching rule
internal methods for LP management
#define SCIP_DECL_DISPCOPY(x)
Definition: type_disp.h:71
SCIP_DISP * SCIPfindDisp(SCIP *scip, const char *name)
Definition: scip_disp.c:167
internal methods for branching and inference history
internal methods for collecting primal CIP solutions and primal informations
internal methods for propagators
#define SCIP_DECL_DISPINIT(x)
Definition: type_disp.h:87
SCIP_MEM * mem
Definition: struct_scip.h:61
git hash methods
internal methods for storing and manipulating the main problem
#define SCIPerrorMessage
Definition: pub_message.h:45
methods for block memory pools and memory buffers
register additional core functionality that is designed as plugins
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:1933
int SCIPgetNDisps(SCIP *scip)
Definition: scip_disp.c:191
internal methods for presolvers
internal methods for NLP management
internal miscellaneous methods
internal methods for node selectors and node priority queues
internal methods for variable pricers
internal methods for global SCIP settings
internal methods for storing conflicts
#define SCIP_CALL(x)
Definition: def.h:351
SCIP main data structure.
BMS_BLKMEM * setmem
Definition: struct_mem.h:39
internal methods for storing priced variables
internal methods for relaxators
internal methods for storing separated cuts
methods commonly used for presolving
methods for catching the user CTRL-C interrupt
internal methods for problem variables
data structures and methods for collecting reoptimization information
the function declarations for the synchronization store
internal methods for user interface dialog
#define SCIP_Bool
Definition: def.h:62
SCIP_RETCODE SCIPincludeDisp(SCIP *scip, const char *name, const char *desc, const char *header, SCIP_DISPSTATUS dispstatus, SCIP_DECL_DISPCOPY((*dispcopy)), SCIP_DECL_DISPFREE((*dispfree)), SCIP_DECL_DISPINIT((*dispinit)), SCIP_DECL_DISPEXIT((*dispexit)), SCIP_DECL_DISPINITSOL((*dispinitsol)), SCIP_DECL_DISPEXITSOL((*dispexitsol)), SCIP_DECL_DISPOUTPUT((*dispoutput)), SCIP_DISPDATA *dispdata, int width, int priority, int position, SCIP_Bool stripline)
Definition: scip_disp.c:125
#define SCIP_DECL_DISPFREE(x)
Definition: type_disp.h:79
SCIP_RETCODE SCIPautoselectDisps(SCIP *scip)
Definition: scip_disp.c:202
internal methods for input file readers
methods for debugging
reoptsols primal heuristic
internal methods for storing cuts in a cut pool
SCIP_DISP * SCIPsetFindDisp(SCIP_SET *set, const char *name)
Definition: set.c:4804
Constraint handler for linear constraints in their most general form, .
void SCIPchgDispMode(SCIP_DISP *disp, SCIP_DISPMODE mode)
Definition: scip_disp.c:215
helper functions for concurrent scip solvers
internal methods for return codes for SCIP methods
#define SCIP_DECL_DISPEXITSOL(x)
Definition: type_disp.h:117
internal methods for conflict analysis
internal methods for tree compressions
internal methods for main solving loop and node processing
#define SCIP_DECL_DISPEXIT(x)
Definition: type_disp.h:95
SCIP_SET * set
Definition: struct_scip.h:62
public methods for message output
enum SCIP_DispStatus SCIP_DISPSTATUS
Definition: type_disp.h:50
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:65
default user interface dialog
internal methods for problem statistics
internal methods for constraints and constraint handlers
declarations for XML parsing
build flags methods
SCIP_DISP ** SCIPgetDisps(SCIP *scip)
Definition: scip_disp.c:180
common defines and data types used in all packages of SCIP
#define SCIP_DECL_DISPOUTPUT(x)
Definition: type_disp.h:126
internal methods for primal heuristics
SCIP_DISP ** disps
Definition: struct_set.h:86
SCIP_RETCODE SCIPsetIncludeDisp(SCIP_SET *set, SCIP_DISP *disp)
Definition: set.c:4772
internal methods for Benders&#39; decomposition cuts
public methods for display handler plugins
internal methods for displaying runtime statistics
OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.