Scippy

SCIP

Solving Constraint Integer Programs

sepastore.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-2024 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file sepastore.h
26  * @ingroup INTERNALAPI
27  * @brief internal methods for storing separated cuts
28  * @author Tobias Achterberg
29  * @author Leona Gottwald
30  */
31 
32 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
33 
34 #ifndef __SCIP_SEPASTORE_H__
35 #define __SCIP_SEPASTORE_H__
36 
37 
38 #include "scip/def.h"
39 #include "blockmemshell/memory.h"
40 #include "scip/type_implics.h"
41 #include "scip/type_retcode.h"
42 #include "scip/type_set.h"
43 #include "scip/type_stat.h"
44 #include "scip/type_event.h"
45 #include "scip/type_lp.h"
46 #include "scip/type_prob.h"
47 #include "scip/type_tree.h"
48 #include "scip/type_reopt.h"
49 #include "scip/type_sepastore.h"
50 #include "scip/type_branch.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /** creates separation storage */
58  SCIP_SEPASTORE** sepastore, /**< pointer to store separation storage */
59  BMS_BLKMEM* blkmem, /**< block memory */
60  SCIP_SET* set /**< global SCIP settings */
61  );
62 
63 /** frees separation storage */
65  SCIP_SEPASTORE** sepastore, /**< pointer to store separation storage */
66  BMS_BLKMEM* blkmem /**< block memory */
67  );
68 
69 /** informs separation storage that the setup of the initial LP starts now */
71  SCIP_SEPASTORE* sepastore /**< separation storage */
72  );
73 
74 /** informs separation storage that the setup of the initial LP is now finished */
76  SCIP_SEPASTORE* sepastore /**< separation storage */
77  );
78 
79 /** informs separation storage that the following cuts should be used in any case */
81  SCIP_SEPASTORE* sepastore /**< separation storage */
82  );
83 
84 /** informs separation storage that the following cuts should no longer be used in any case */
86  SCIP_SEPASTORE* sepastore /**< separation storage */
87  );
88 
89 /** adds cut to separation storage and captures it */
91  SCIP_SEPASTORE* sepastore, /**< separation storage */
92  BMS_BLKMEM* blkmem, /**< block memory */
93  SCIP_SET* set, /**< global SCIP settings */
94  SCIP_STAT* stat, /**< problem statistics data */
95  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
96  SCIP_EVENTFILTER* eventfilter, /**< event filter for global events */
97  SCIP_LP* lp, /**< LP data */
98  SCIP_ROW* cut, /**< separated cut */
99  SCIP_Bool forcecut, /**< should the cut be forced to enter the LP? */
100  SCIP_Bool root, /**< are we at the root node? */
101  SCIP_Bool* infeasible /**< pointer to store whether the cut is infeasible */
102  );
103 
104 /** adds cuts to the LP and clears separation storage */
106  SCIP_SEPASTORE* sepastore, /**< separation storage */
107  BMS_BLKMEM* blkmem, /**< block memory */
108  SCIP_SET* set, /**< global SCIP settings */
109  SCIP_STAT* stat, /**< problem statistics */
110  SCIP_PROB* transprob, /**< transformed problem */
111  SCIP_PROB* origprob, /**< original problem */
112  SCIP_TREE* tree, /**< branch and bound tree */
113  SCIP_REOPT* reopt, /**< reoptimization data structure */
114  SCIP_LP* lp, /**< LP data */
115  SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
116  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
117  SCIP_EVENTFILTER* eventfilter, /**< global event filter */
118  SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
119  SCIP_Bool root, /**< are we at the root node? */
120  SCIP_EFFICIACYCHOICE efficiacychoice, /**< type of solution to base efficiacy computation on */
121  SCIP_Bool* cutoff /**< pointer to store whether an empty domain was created */
122  );
123 
124 /** clears the separation storage without adding the cuts to the LP */
126  SCIP_SEPASTORE* sepastore, /**< separation storage */
127  BMS_BLKMEM* blkmem, /**< block memory */
128  SCIP_SET* set, /**< global SCIP settings */
129  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
130  SCIP_EVENTFILTER* eventfilter, /**< event filter for global events */
131  SCIP_LP* lp /**< LP data */
132  );
133 
134 /** removes cuts that are inefficacious w.r.t. the current LP solution from separation storage without adding the cuts to the LP */
136  SCIP_SEPASTORE* sepastore, /**< separation storage */
137  BMS_BLKMEM* blkmem, /**< block memory */
138  SCIP_SET* set, /**< global SCIP settings */
139  SCIP_STAT* stat, /**< problem statistics data */
140  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
141  SCIP_EVENTFILTER* eventfilter, /**< event filter for global events */
142  SCIP_LP* lp, /**< LP data */
143  SCIP_Bool root, /**< are we at the root node? */
144  SCIP_EFFICIACYCHOICE efficiacychoice /**< type of solution to base efficiacy computation on */
145  );
146 
147 /** indicates whether a cut is applicable
148  *
149  * A cut is applicable if it is modifiable, not a bound change, or a bound change that changes bounds by at least epsilon.
150  */
152  SCIP_SET* set, /**< global SCIP settings */
153  SCIP_ROW* cut /**< cut to check */
154  );
155 
156 /** get cuts in the separation storage */
158  SCIP_SEPASTORE* sepastore /**< separation storage */
159  );
160 
161 /** get number of cuts in the separation storage */
163  SCIP_SEPASTORE* sepastore /**< separation storage */
164  );
165 
166 /** gets the total number of cutting planes added to the separation storage;
167  * this is equal to the sum of added cuts directly and via the pool. */
169  SCIP_SEPASTORE* sepastore /**< separation storage */
170  );
171 
172 /** gets the number of cutting planes added to the separation storage from the cut pool */
174  SCIP_SEPASTORE* sepastore /**< separation storage */
175  );
176 
177 /** gets the number of cutting planes added to the separation storage directly */
179  SCIP_SEPASTORE* sepastore /**< separation storage */
180  );
181 
182 /** get number of cuts found so far in current separation round */
184  SCIP_SEPASTORE* sepastore /**< separation storage */
185  );
186 
187 /** gets the total number of cutting planes applied to the LP */
189  SCIP_SEPASTORE* sepastore /**< separation storage */
190  );
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
196 #endif
void SCIPsepastoreEndForceCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:167
SCIP_RETCODE SCIPsepastoreAddCut(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool root, SCIP_Bool *infeasible)
Definition: sepastore.c:428
SCIP_ROW ** SCIPsepastoreGetCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1139
type definitions for implications, variable bounds, and cliques
enum SCIP_Efficiacychoice SCIP_EFFICIACYCHOICE
int SCIPsepastoreGetNCutsApplied(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1200
void SCIPsepastoreStartForceCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:156
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for global SCIP settings
type definitions for return codes for SCIP methods
type definitions for collecting reoptimization information
SCIP_Bool SCIPsepastoreIsCutApplicable(SCIP_SET *set, SCIP_ROW *cut)
Definition: sepastore.c:1130
type definitions for branching rules
type definitions for problem statistics
type definitions for LP management
SCIP_RETCODE SCIPsepastoreRemoveInefficaciousCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_Bool root, SCIP_EFFICIACYCHOICE efficiacychoice)
Definition: sepastore.c:1073
SCIP_RETCODE SCIPsepastoreCreate(SCIP_SEPASTORE **sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: sepastore.c:87
int SCIPsepastoreGetNCutsAddedViaPool(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1170
int SCIPsepastoreGetNCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1149
type definitions for storing separated cuts
type definitions for managing events
#define SCIP_Bool
Definition: def.h:91
void SCIPsepastoreStartInitialLP(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:132
type definitions for branch and bound tree
int SCIPsepastoreGetNCutsAdded(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1160
int SCIPsepastoreGetNCutsAddedDirect(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1180
type definitions for storing and manipulating the main problem
int SCIPsepastoreGetNCutsFoundRound(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1190
void SCIPsepastoreEndInitialLP(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:144
SCIP_RETCODE SCIPsepastoreApplyCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool root, SCIP_EFFICIACYCHOICE efficiacychoice, SCIP_Bool *cutoff)
Definition: sepastore.c:921
SCIP_RETCODE SCIPsepastoreFree(SCIP_SEPASTORE **sepastore, BMS_BLKMEM *blkmem)
Definition: sepastore.c:115
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:437
SCIP_RETCODE SCIPsepastoreClearCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp)
Definition: sepastore.c:1027
memory allocation routines