1    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2    	/*                                                                           */
3    	/*                  This file is part of the program and library             */
4    	/*         SCIP --- Solving Constraint Integer Programs                      */
5    	/*                                                                           */
6    	/*  Copyright (c) 2002-2023 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   pricestore.h
26   	 * @ingroup INTERNALAPI
27   	 * @brief  internal methods for storing priced variables
28   	 * @author Tobias Achterberg
29   	 */
30   	
31   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32   	
33   	#ifndef __SCIP_PRICESTORE_H__
34   	#define __SCIP_PRICESTORE_H__
35   	
36   	
37   	#include "scip/def.h"
38   	#include "blockmemshell/memory.h"
39   	#include "scip/type_retcode.h"
40   	#include "scip/type_set.h"
41   	#include "scip/type_stat.h"
42   	#include "scip/type_event.h"
43   	#include "scip/type_lp.h"
44   	#include "scip/type_var.h"
45   	#include "scip/type_prob.h"
46   	#include "scip/type_tree.h"
47   	#include "scip/type_pricestore.h"
48   	#include "scip/type_branch.h"
49   	
50   	#ifdef __cplusplus
51   	extern "C" {
52   	#endif
53   	
54   	/** creates pricing storage */
55   	SCIP_RETCODE SCIPpricestoreCreate(
56   	   SCIP_PRICESTORE**     pricestore          /**< pointer to store pricing storage */
57   	   );
58   	
59   	/** frees pricing storage */
60   	SCIP_RETCODE SCIPpricestoreFree(
61   	   SCIP_PRICESTORE**     pricestore          /**< pointer to store pricing storage */
62   	   );
63   	
64   	/** informs pricing storage, that the setup of the initial LP starts now */
65   	void SCIPpricestoreStartInitialLP(
66   	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
67   	   );
68   	
69   	/** informs pricing storage, that the setup of the initial LP is now finished */
70   	void SCIPpricestoreEndInitialLP(
71   	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
72   	   );
73   	
74   	/** adds variable to pricing storage and capture it */
75   	SCIP_RETCODE SCIPpricestoreAddVar(
76   	   SCIP_PRICESTORE*      pricestore,         /**< pricing storage */
77   	   BMS_BLKMEM*           blkmem,             /**< block memory */
78   	   SCIP_SET*             set,                /**< global SCIP settings */
79   	   SCIP_EVENTQUEUE*      eventqueue,         /**< event queue */
80   	   SCIP_LP*              lp,                 /**< LP data */
81   	   SCIP_VAR*             var,                /**< priced variable */
82   	   SCIP_Real             score,              /**< pricing score of variable (the larger, the better the variable) */
83   	   SCIP_Bool             root                /**< are we at the root node? */
84   	   );
85   	
86   	/** adds variable where zero violates the bounds to pricing storage, capture it */
87   	SCIP_RETCODE SCIPpricestoreAddBdviolvar(
88   	   SCIP_PRICESTORE*      pricestore,         /**< pricing storage */
89   	   BMS_BLKMEM*           blkmem,             /**< block memory */
90   	   SCIP_SET*             set,                /**< global SCIP settings */
91   	   SCIP_STAT*            stat,               /**< problem statistics */
92   	   SCIP_LP*              lp,                 /**< LP data */
93   	   SCIP_BRANCHCAND*      branchcand,         /**< branching candidate storage */
94   	   SCIP_EVENTQUEUE*      eventqueue,         /**< event queue */
95   	   SCIP_VAR*             var                 /**< variable, where zero violates the bounds */
96   	   );
97   	
98   	/** adds problem variables with negative reduced costs to pricing storage */
99   	SCIP_RETCODE SCIPpricestoreAddProbVars(
100  	   SCIP_PRICESTORE*      pricestore,         /**< pricing storage */
101  	   BMS_BLKMEM*           blkmem,             /**< block memory buffers */
102  	   SCIP_SET*             set,                /**< global SCIP settings */
103  	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
104  	   SCIP_PROB*            prob,               /**< transformed problem after presolve */
105  	   SCIP_TREE*            tree,               /**< branch and bound tree */
106  	   SCIP_LP*              lp,                 /**< LP data */
107  	   SCIP_BRANCHCAND*      branchcand,         /**< branching candidate storage */
108  	   SCIP_EVENTQUEUE*      eventqueue          /**< event queue */
109  	   );
110  	
111  	/** adds priced variables to the LP */
112  	SCIP_RETCODE SCIPpricestoreApplyVars(
113  	   SCIP_PRICESTORE*      pricestore,         /**< pricing storage */
114  	   BMS_BLKMEM*           blkmem,             /**< block memory buffers */
115  	   SCIP_SET*             set,                /**< global SCIP settings */
116  	   SCIP_STAT*            stat,               /**< dynamic problem statistics */
117  	   SCIP_EVENTQUEUE*      eventqueue,         /**< event queue */
118  	   SCIP_PROB*            prob,               /**< transformed problem after presolve */
119  	   SCIP_TREE*            tree,               /**< branch and bound tree */
120  	   SCIP_LP*              lp                  /**< LP data */
121  	   );
122  	
123  	/** reset variables' bounds violated by zero to its original value */
124  	SCIP_RETCODE SCIPpricestoreResetBounds(
125  	   SCIP_PRICESTORE*      pricestore,         /**< pricing storage */
126  	   BMS_BLKMEM*           blkmem,             /**< block memory */
127  	   SCIP_SET*             set,                /**< global SCIP settings */
128  	   SCIP_STAT*            stat,               /**< problem statistics */
129  	   SCIP_LP*              lp,                 /**< LP data */
130  	   SCIP_BRANCHCAND*      branchcand,         /**< branching candidate storage */
131  	   SCIP_EVENTQUEUE*      eventqueue          /**< event queue */
132  	   );
133  	
134  	/** gets number of variables in pricing storage */
135  	int SCIPpricestoreGetNVars(
136  	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
137  	   );
138  	
139  	/** gets number of variables in pricing storage whose bounds must be reset */
140  	int SCIPpricestoreGetNBoundResets(
141  	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
142  	   );
143  	
144  	/** gets time needed to price existing problem variables */
145  	SCIP_Real SCIPpricestoreGetProbPricingTime(
146  	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
147  	   );
148  	
149  	/** gets total number of calls to problem variable pricing */
150  	int SCIPpricestoreGetNProbPricings(
151  	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
152  	   );
153  	
154  	/** gets total number of times, a problem variable was priced in */
155  	int SCIPpricestoreGetNProbvarsFound(
156  	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
157  	   );
158  	
159  	/** get total number of variables found so far in pricing */
160  	int SCIPpricestoreGetNVarsFound(
161  	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
162  	   );
163  	
164  	/** get total number of variables priced into the LP so far */
165  	int SCIPpricestoreGetNVarsApplied(
166  	   SCIP_PRICESTORE*      pricestore          /**< pricing storage */
167  	   );
168  	
169  	#ifdef __cplusplus
170  	}
171  	#endif
172  	
173  	#endif
174