1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /*                                                                           */
3 /*                  This file is part of the program and library             */
4 /*         SCIP --- Solving Constraint Integer Programs                      */
5 /*                                                                           */
6 /*    Copyright (C) 2002-2021 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   cutpool.h
17  * @ingroup INTERNALAPI
18  * @brief  internal methods for storing cuts in a cut pool
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_CUTPOOL_H__
25 #define __SCIP_CUTPOOL_H__
26 
27 
28 #include "scip/def.h"
29 #include "blockmemshell/memory.h"
30 #include "scip/type_event.h"
31 #include "scip/type_retcode.h"
32 #include "scip/type_result.h"
33 #include "scip/type_set.h"
34 #include "scip/type_sol.h"
35 #include "scip/type_stat.h"
36 #include "scip/type_lp.h"
37 #include "scip/type_sepastore.h"
38 #include "scip/type_cutpool.h"
39 #include "scip/pub_cutpool.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /** creates cut pool */
46 SCIP_RETCODE SCIPcutpoolCreate(
47    SCIP_CUTPOOL**        cutpool,            /**< pointer to store cut pool */
48    BMS_BLKMEM*           blkmem,             /**< block memory */
49    SCIP_SET*             set,                /**< global SCIP settings */
50    int                   agelimit,           /**< maximum age a cut can reach before it is deleted from the pool */
51    SCIP_Bool             globalcutpool       /**< is this the global cut pool of SCIP? */
52    );
53 
54 /** frees cut pool */
55 SCIP_RETCODE SCIPcutpoolFree(
56    SCIP_CUTPOOL**        cutpool,            /**< pointer to store cut pool */
57    BMS_BLKMEM*           blkmem,             /**< block memory */
58    SCIP_SET*             set,                /**< global SCIP settings */
59    SCIP_LP*              lp                  /**< current LP data */
60    );
61 
62 /** removes all rows from the cut pool */
63 SCIP_RETCODE SCIPcutpoolClear(
64    SCIP_CUTPOOL*         cutpool,            /**< cut pool */
65    BMS_BLKMEM*           blkmem,             /**< block memory */
66    SCIP_SET*             set,                /**< global SCIP settings */
67    SCIP_LP*              lp                  /**< current LP data */
68    );
69 
70 /** checks if cut is already existing */
71 SCIP_Bool SCIPcutpoolIsCutNew(
72    SCIP_CUTPOOL*         cutpool,            /**< cut pool */
73    SCIP_SET*             set,                /**< global SCIP settings */
74    SCIP_ROW*             row                 /**< cutting plane to add */
75    );
76 
77 /** if not already existing, adds row to cut pool and captures it */
78 SCIP_RETCODE SCIPcutpoolAddRow(
79    SCIP_CUTPOOL*         cutpool,            /**< cut pool */
80    BMS_BLKMEM*           blkmem,             /**< block memory */
81    SCIP_SET*             set,                /**< global SCIP settings */
82    SCIP_STAT*            stat,               /**< problem statistics data */
83    SCIP_LP*              lp,                 /**< current LP data */
84    SCIP_ROW*             row                 /**< cutting plane to add */
85    );
86 
87 /** adds row to cut pool and captures it; doesn't check for multiple cuts */
88 SCIP_RETCODE SCIPcutpoolAddNewRow(
89    SCIP_CUTPOOL*         cutpool,            /**< cut pool */
90    BMS_BLKMEM*           blkmem,             /**< block memory */
91    SCIP_SET*             set,                /**< global SCIP settings */
92    SCIP_STAT*            stat,               /**< problem statistics data */
93    SCIP_LP*              lp,                 /**< current LP data */
94    SCIP_ROW*             row                 /**< cutting plane to add */
95    );
96 
97 /** removes the LP row from the cut pool */
98 SCIP_RETCODE SCIPcutpoolDelRow(
99    SCIP_CUTPOOL*         cutpool,            /**< cut pool */
100    BMS_BLKMEM*           blkmem,             /**< block memory */
101    SCIP_SET*             set,                /**< global SCIP settings */
102    SCIP_STAT*            stat,               /**< problem statistics data */
103    SCIP_LP*              lp,                 /**< current LP data */
104    SCIP_ROW*             row                 /**< row to remove */
105    );
106 
107 /** separates cuts of the cut pool */
108 SCIP_RETCODE SCIPcutpoolSeparate(
109    SCIP_CUTPOOL*         cutpool,            /**< cut pool */
110    BMS_BLKMEM*           blkmem,             /**< block memory */
111    SCIP_SET*             set,                /**< global SCIP settings */
112    SCIP_STAT*            stat,               /**< problem statistics data */
113    SCIP_EVENTQUEUE*      eventqueue,         /**< event queue */
114    SCIP_EVENTFILTER*     eventfilter,        /**< event filter for global events */
115    SCIP_LP*              lp,                 /**< current LP data */
116    SCIP_SEPASTORE*       sepastore,          /**< separation storage */
117    SCIP_SOL*             sol,                /**< solution to be separated (or NULL for LP-solution) */
118    SCIP_Bool             cutpoolisdelayed,   /**< is the cutpool delayed (count cuts found)? */
119    SCIP_Bool             root,               /**< are we at the root node? */
120    SCIP_RESULT*          result              /**< pointer to store the result of the separation call */
121    );
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif
128