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   boundstore.h
26   	 * @ingroup PARALLEL
27   	 * @brief  the interface of the boundstore structure
28   	 * @author Leona Gottwald
29   	 */
30   	
31   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32   	
33   	#include "scip/def.h"
34   	#include "scip/type_syncstore.h"
35   	#include "scip/type_scip.h"
36   	#include "scip/type_lp.h"
37   	#include "scip/type_retcode.h"
38   	
39   	#ifndef __SCIP_BOUNDSTORE_H__
40   	#define __SCIP_BOUNDSTORE_H__
41   	
42   	/** create bound store data structure */
43   	SCIP_EXPORT
44   	SCIP_RETCODE SCIPboundstoreCreate(
45   	   SCIP*                 scip,               /**< scip main datastructure */
46   	   SCIP_BOUNDSTORE**     boundstore,         /**< pointer to store the bound store datastructure */
47   	   int                   nvars               /**< number of variables for which bounds may be stored */
48   	   );
49   	
50   	/** free bound store data structure */
51   	SCIP_EXPORT
52   	void SCIPboundstoreFree(
53   	   SCIP*                 scip,               /**< scip main datastructure */
54   	   SCIP_BOUNDSTORE**     boundstore          /**< pointer to the bound store datastructure */
55   	   );
56   	
57   	/** add bound change to bound store data structure */
58   	SCIP_EXPORT
59   	SCIP_RETCODE SCIPboundstoreAdd(
60   	   SCIP*                 scip,               /**< scip main datastructure */
61   	   SCIP_BOUNDSTORE*      boundstore,         /**< the bound store datastructure */
62   	   int                   varidx,             /**< variable index of bound change, must be smaller than the
63   	                                              *   number of variables given during creation of bound store */
64   	   SCIP_Real             newbound,           /**< bound value of variable */
65   	   SCIP_BOUNDTYPE        boundtype           /**< type of new bound */
66   	   );
67   	
68   	/** add all bound changes of source to target */
69   	SCIP_EXPORT
70   	SCIP_RETCODE SCIPboundstoreMerge(
71   	   SCIP*                 scip,               /**< scip main datastructure for target boundstore   */
72   	   SCIP_BOUNDSTORE*      target,             /**< the bound store datastructure where the bounds get merged in */
73   	   SCIP_BOUNDSTORE*      source              /**< the bound store datastructure from which the bounds get merged in */
74   	   );
75   	
76   	/** remove all boundchanges from bound store */
77   	SCIP_EXPORT
78   	void SCIPboundstoreClear(
79   	   SCIP_BOUNDSTORE*      boundstore          /**< the bound store datastructure */
80   	   );
81   	
82   	/** gets variable index of the i'th stored boundchange */
83   	SCIP_EXPORT
84   	int SCIPboundstoreGetChgVaridx(
85   	   SCIP_BOUNDSTORE*      boundstore,         /**< the bound store datastructure */
86   	   int                   i                   /**< the index of the bound change */
87   	   );
88   	
89   	/** gets the type of the i'th stored boundchange */
90   	SCIP_EXPORT
91   	SCIP_BOUNDTYPE SCIPboundstoreGetChgType(
92   	   SCIP_BOUNDSTORE*      boundstore,         /**< the bound store datastructure */
93   	   int                   i                   /**< the index of the bound change */
94   	   );
95   	
96   	/** gets the bound value of the i'th stored boundchange */
97   	SCIP_EXPORT
98   	SCIP_Real SCIPboundstoreGetChgVal(
99   	   SCIP_BOUNDSTORE*      boundstore,         /**< the bound store datastructure */
100  	   int                   i                   /**< the index of the bound change */
101  	   );
102  	
103  	/** gets the number of stored bound changes */
104  	SCIP_EXPORT
105  	int SCIPboundstoreGetNChgs(
106  	   SCIP_BOUNDSTORE*      boundstore          /**< the bound store datastructure */
107  	   );
108  	
109  	#endif
110