Scippy

SCIP

Solving Constraint Integer Programs

concsolver.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 concsolver.h
17  * @brief datastructures for concurrent solvers
18  * @author Robert Lion Gottwald
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_CONCSOLVER_H__
24 #define __SCIP_CONCSOLVER_H__
25 
26 #include "scip/def.h"
27 #include "blockmemshell/memory.h"
28 #include "scip/type_retcode.h"
29 #include "scip/type_set.h"
30 #include "scip/type_concsolver.h"
31 #include "scip/type_syncstore.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /** creates a concurrent solver type */
38 extern
40  SCIP_CONCSOLVERTYPE** concsolvertype, /**< pointer to concurrent solver data structure */
41  SCIP_SET* set, /**< global SCIP settings */
42  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
43  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
44  const char* name, /**< name of concurrent solver */
45  SCIP_Real prefpriodefault, /**< the default preferred priority of this concurrent solver type */
46  SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)),/**< data copy method of concurrent solver */
47  SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)),/**< data copy method of concurrent solver */
48  SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)),/**< initialize random seeds of concurrent solver */
49  SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)),/**< execution method of concurrent solver */
50  SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
51  SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)),/**< terminate solving in concurrent solver */
52  SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)),/**< synchronization method of concurrent solver */
53  SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)),/**< synchronization method of concurrent solver */
54  SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
55  SCIP_CONCSOLVERTYPEDATA* data /**< the concurent solver type's data */
56  );
57 
58 /** frees all memory of a concurrent solver type */
59 extern
61  SCIP_CONCSOLVERTYPE** concsolvertype /**< pointer to concurrent solver data structure */
62  );
63 
64 /** gets the data of a concurrent solver type */
65 extern
67  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
68  );
69 
70 /** sets the data of a concurrent solver type */
71 extern
73  SCIP_CONCSOLVERTYPE* concsolvertype, /**< concurrent solver type */
74  SCIP_CONCSOLVERTYPEDATA* data /**< the concurrent solver's data */
75  );
76 
77 /** gets the name of a concurrent solver type */
78 extern
80  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
81  );
82 
83 /** gets the preferred priority from a concurrent solver type */
84 extern
86  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
87  );
88 
89 /** creates an instance of the given concurrent solver type */
90 extern
92  SCIP_SET* set, /**< global SCIP settings */
93  SCIP_CONCSOLVERTYPE* concsolvertype, /**< concurrent solver type to create */
94  SCIP_CONCSOLVER** concsolver /**< pointer to return concurrent solver instance */
95  );
96 
97 /** destroys an instance of the given concurrent solver */
98 extern
100  SCIP_SET* set, /**< global SCIP settings */
101  SCIP_CONCSOLVER** concsolver /**< concurrent solver */
102  );
103 
104 /** gets the data of a concurrent solver */
105 extern
107  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
108  );
109 
110 /** sets the data of a concurrent solver */
111 extern
113  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
114  SCIP_CONCSOLVERDATA* data /**< the concurrent solver's data */
115  );
116 
117 /** gets the name of a concurrent solver */
118 extern
120  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
121  );
122 
123 /** initializes the random seeds of a concurrent solver */
124 extern
126  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
127  unsigned int seed /**< seed for initializing the solver's internal random seeds */
128  );
129 
130 /** start the solving process of a concurrent solver */
131 extern
133  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
134  );
135 
136 /** gets solving data of concurrent solver and stores it in the given SCIP instance */
137 extern
139  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
140  SCIP* scip /**< SCIP datastructure */
141  );
142 
143 /** interrupt solving in a concurrent solver */
144 extern
146  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
147  );
148 
149 /** let the given concurrent solver synchronize, i.e. pass its own solutions and bounds to
150  * the SPI.
151  */
152 extern
154  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
155  SCIP_SET* set /**< global SCIP settings */
156  );
157 
158 /** gets the current synchronization frequency of the concurent solver */
159 extern
161  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
162  );
163 
164 /** gets the total memory used by the concurent solver */
165 extern
167  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
168  );
169 
170 /** sets the time elapsed since the last synchronization. Must be set before the synchronization is
171  * started.
172  */
173 extern
175  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
176  SCIP_Real time /**< the time passed since the last synchronization */
177  );
178 
179 /** gets the solving time of the concurrent solver */
180 extern
182  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
183  );
184 
185 /** gets the time spent for synchronization for the concurrent solver */
186 extern
188  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
189  );
190 
191 /** gets the number of lp iterations the concurrent solver used */
192 extern
194  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
195  );
196 
197 /** gets the number of branch and bound nodes the concurrent solver used */
198 extern
200  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
201  );
202 
203 /** gets the number of solutions the concurrent solver received during synchronization */
204 extern
206  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
207  );
208 
209 /** gets the number of solutions the concurrent solver shared during synchronization */
210 extern
212  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
213  );
214 
215 /** gets the number of tighter global variable bounds the solver received */
216 extern
218  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
219  );
220 
221 /** gets the number of tighter global variable bounds of integer variables the solver received */
222 extern
224  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
225  );
226 
227 /** gets index of concurrent solver */
228 extern
230  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
231  );
232 
233 #ifdef __cplusplus
234 }
235 #endif
236 
237 #endif
SCIP_Longint SCIPconcsolverGetNTighterBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:592
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:290
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
#define SCIP_DECL_CONCSOLVERSYNCREAD(x)
void SCIPconcsolverTypeFree(SCIP_CONCSOLVERTYPE **concsolvertype)
Definition: concsolver.c:143
char * SCIPconcsolverTypeGetName(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:180
#define SCIP_DECL_CONCSOLVEREXEC(x)
SCIP_RETCODE SCIPconcsolverGetSolvingData(SCIP_CONCSOLVER *concsolver, SCIP *scip)
Definition: concsolver.c:333
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for global SCIP settings
SCIP_Real SCIPconcsolverGetSyncFreq(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:499
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPconcsolverCreateInstance(SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:200
#define SCIP_DECL_CONCSOLVERDESTROYINST(x)
SCIP_RETCODE SCIPconcsolverTypeCreate(SCIP_CONCSOLVERTYPE **concsolvertype, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, SCIP_Real prefpriodefault, SCIP_DECL_CONCSOLVERCREATEINST((*concsolvercreateinst)), SCIP_DECL_CONCSOLVERDESTROYINST((*concsolverdestroyinst)), SCIP_DECL_CONCSOLVERINITSEEDS((*concsolverinitseeds)), SCIP_DECL_CONCSOLVEREXEC((*concsolverexec)), SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA((*concsolvercopysolvdata)), SCIP_DECL_CONCSOLVERSTOP((*concsolverstop)), SCIP_DECL_CONCSOLVERSYNCWRITE((*concsolversyncwrite)), SCIP_DECL_CONCSOLVERSYNCREAD((*concsolversyncread)), SCIP_DECL_CONCSOLVERTYPEFREEDATA((*concsolvertypefreedata)), SCIP_CONCSOLVERTYPEDATA *data)
Definition: concsolver.c:103
SCIP_Longint SCIPconcsolverGetNSolsShared(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:582
SCIP_Longint SCIPconcsolverGetMemTotal(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:509
#define SCIP_DECL_CONCSOLVERSTOP(x)
SCIP_Longint SCIPconcsolverGetNNodes(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:562
void SCIPconcsolverSetTimeSinceLastSync(SCIP_CONCSOLVER *concsolver, SCIP_Real time)
Definition: concsolver.c:521
void SCIPconcsolverSetData(SCIP_CONCSOLVER *concsolver, SCIP_CONCSOLVERDATA *data)
Definition: concsolver.c:279
SCIP_RETCODE SCIPconcsolverSync(SCIP_CONCSOLVER *concsolver, SCIP_SET *set)
Definition: concsolver.c:365
SCIP_Real SCIPconcsolverGetSolvingTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:532
SCIP_Longint SCIPconcsolverGetNSolsRecvd(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:572
SCIP_RETCODE SCIPconcsolverStop(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:346
SCIP_RETCODE SCIPconcsolverDestroyInstance(SCIP_SET *set, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:247
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
int SCIPconcsolverGetIdx(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:612
SCIP_Real SCIPconcsolverGetSyncTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:542
SCIP_RETCODE SCIPconcsolverExec(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:315
#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x)
SCIP_RETCODE SCIPconcsolverInitSeeds(SCIP_CONCSOLVER *concsolver, unsigned int seed)
Definition: concsolver.c:300
SCIP_Longint SCIPconcsolverGetNTighterIntBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:602
#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x)
SCIP_Longint SCIPconcsolverGetNLPIterations(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:552
the type definitions for the synchronization store
SCIP_CONCSOLVERDATA * SCIPconcsolverGetData(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:269
SCIP_CONCSOLVERTYPEDATA * SCIPconcsolverTypeGetData(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:159
#define SCIP_Real
Definition: def.h:157
#define SCIP_Longint
Definition: def.h:142
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:426
void SCIPconcsolverTypeSetData(SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVERTYPEDATA *data)
Definition: concsolver.c:169
#define SCIP_DECL_CONCSOLVERSYNCWRITE(x)
SCIP_Real SCIPconcsolverTypeGetPrefPrio(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:190
#define SCIP_DECL_CONCSOLVERCREATEINST(x)
struct SCIP_ConcSolverData SCIP_CONCSOLVERDATA
type definitions for concurrent solvers
memory allocation routines