Scippy

SCIP

Solving Constraint Integer Programs

scip_certificate.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-2025 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 scip_certificate.h
26 * @ingroup PUBLICCOREAPI
27 * @brief public methods for certified solving
28 * @author Leon Eifler
29 * @author Ambros Gleixner
30 */
31
32/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
33
34#ifndef __SCIP_SCIP_CERTIFICATE_H__
35#define __SCIP_SCIP_CERTIFICATE_H__
36
37
38#include "scip/def.h"
39#include "scip/type_cuts.h"
40#include "scip/type_cons.h"
41#include "scip/type_heur.h"
42#include "scip/type_retcode.h"
43#include "scip/type_scip.h"
44#include "scip/type_sol.h"
45#include "scip/type_var.h"
47#include "scip/type_lpexact.h"
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53/**@addtogroup PublicCertificateMethods
54 *
55 * @{
56 */
57
58/** returns whether certificate output is activated */
59SCIP_EXPORT
61 SCIP* scip /**< certificate information */
62 );
63
64/** should the certificate track bound changes?
65 *
66 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
67 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
68 *
69 * @pre This method can be called if @p scip is in one of the following stages:
70 * - \ref SCIP_STAGE_SOLVING
71 *
72 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
73 */
74SCIP_EXPORT
76 SCIP* scip /**< SCIP data structure */
77 );
78
79/** prints constraint to certificate
80 *
81 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
82 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
83 *
84 * @pre This method can be called if @p scip is in one of the following stages:
85 * - \ref SCIP_STAGE_INITSOLVE
86 *
87 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
88 */
89SCIP_EXPORT
91 SCIP* scip, /**< certificate information */
92 SCIP_Bool isorigfile, /**< should the original solution be printed or in transformed space */
93 const char* consname, /**< name of the constraint */
94 const char sense, /**< sense of the constraint, i.e., G, L, or E */
95 SCIP_RATIONAL* side, /**< left/right-hand side */
96 int len, /**< number of nonzeros */
97 int* ind, /**< index array */
98 SCIP_RATIONAL** val /**< coefficient array */
99 );
100
101/** prints activity bound to proof section
102 *
103 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
104 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
105 *
106 * @pre This method can be called if @p scip is in one of the following stages:
107 * - \ref SCIP_STAGE_SOLVING
108 *
109 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
110 */
111SCIP_EXPORT
113 SCIP* scip, /**< SCIP data structure */
114 const char* linename, /**< name of the unsplitting line */
115 SCIP_BOUNDTYPE boundtype, /**< type of bound (upper/lower) */
116 SCIP_Real newbound, /**< pointer to lower bound on the objective, NULL indicating infeasibility */
117 SCIP_Bool ismaxactivity, /**< TRUE for maxactivity, FALSE for minactivity */
118 SCIP_CONS* constraint, /**< the constraint */
119 SCIP_VAR* variable, /**< the variable */
120 SCIP_ROWEXACT* row, /**< the corresponding row, or NULL if constraint has no row representation */
121 SCIP_RATIONAL** vals, /**< value array */
122 SCIP_RATIONAL* lhs, /**< lhs of the constraint */
123 SCIP_RATIONAL* rhs, /**< rhs of the constraint */
124 SCIP_VAR** vars, /**< variable array */
125 int nvars /**< number of values */
126 );
127
128/** prints activity bound to proof section
129 *
130 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
131 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
132 *
133 * @pre This method can be called if @p scip is in one of the following stages:
134 * - \ref SCIP_STAGE_SOLVING
135 *
136 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
137 */
138SCIP_EXPORT
140 SCIP* scip, /**< SCIP data structure */
141 const char* linename, /**< name of the unsplitting line */
142 SCIP_BOUNDTYPE boundtype, /**< type of bound (upper/lower) */
143 SCIP_RATIONAL* newbound, /**< pointer to lower bound on the objective, NULL indicating infeasibility */
144 SCIP_Bool ismaxactivity, /**< TRUE for maxactivity, FALSE for minactivity */
145 SCIP_CONS* constraint, /**< the constraint */
146 SCIP_VAR* variable, /**< the variable */
147 SCIP_ROWEXACT* row, /**< the corresponding row, or NULL if constraint has no row representation */
148 SCIP_RATIONAL** vals, /**< value array */
149 SCIP_RATIONAL* lhs, /**< lhs of the constraint */
150 SCIP_RATIONAL* rhs, /**< rhs of the constraint */
151 SCIP_VAR** vars, /**< variable array */
152 int nvars /**< number of values */
153 );
154
155/** prints activity conflict to certificate file
156 *
157 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
158 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
159 *
160 * @pre This method can be called if @p scip is in one of the following stages:
161 * - \ref SCIP_STAGE_SOLVING
162 *
163 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
164 */
165SCIP_EXPORT
167 SCIP* scip, /**< SCIP data structure */
168 SCIP_CONS* cons, /**< constraint */
169 SCIP_ROWEXACT* row, /**< row */
170 SCIP_RATIONAL* lhs, /**< lhs of the constraint */
171 SCIP_RATIONAL* rhs, /**< rhs of the constraint */
172 int nvals, /**< number of values */
173 SCIP_RATIONAL** vals, /**< values */
174 SCIP_VAR** vars, /**< variables */
175 SCIP_RATIONAL* diff, /**< difference */
176 SCIP_Bool userhs /**< is rhs */
177 );
178
179/** adds aggregation information to certificate for one row
180 *
181 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
182 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
183 *
184 * @pre This method can be called if @p scip is in one of the following stages:
185 * - \ref SCIP_STAGE_SOLVING
186 *
187 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
188 */
189SCIP_EXPORT
191 SCIP* scip, /**< SCIP data structure */
192 SCIP_AGGRROW* aggrrow, /**< agrrrow that results from the aggregation */
193 SCIP_ROW** aggrrows, /**< array of rows used fo the aggregation */
194 SCIP_Real* weights, /**< array of weights */
195 int naggrrows, /**< length of the arrays */
196 SCIP_ROW** negslackrows, /**< array of rows that are added implicitly with negative slack */
197 SCIP_Real* negslackweights, /**< array of negative slack weights */
198 int nnegslackrows /**< length of the negative slack array */
199 );
200
201/** stores the active aggregation information in the certificate data structures for a row
202 *
203 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
204 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
205 *
206 * @pre This method can be called if @p scip is in one of the following stages:
207 * - \ref SCIP_STAGE_SOLVING
208 *
209 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
210 */
211SCIP_EXPORT
213 SCIP* scip, /**< SCIP data structure */
214 SCIP_ROW* row /**< row that aggregation information is stored for */
215 );
216
217/** frees the active aggregation information
218 *
219 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
220 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
221 *
222 * @pre This method can be called if @p scip is in one of the following stages:
223 * - \ref SCIP_STAGE_SOLVING
224 *
225 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
226 */
227SCIP_EXPORT
229 SCIP* scip /**< SCIP data structure */
230 );
231
232/** adds mir information (split, etc) to certificate for one row
233 *
234 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
235 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
236 *
237 * @pre This method can be called if @p scip is in one of the following stages:
238 * - \ref SCIP_STAGE_SOLVING
239 *
240 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
241 */
242SCIP_EXPORT
244 SCIP* scip /**< SCIP data structure */
245 );
246
247/** stores the active mir information in the certificate data structures for a row
248 *
249 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
250 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
251 *
252 * @pre This method can be called if @p scip is in one of the following stages:
253 * - \ref SCIP_STAGE_SOLVING
254 *
255 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
256 */
257SCIP_EXPORT
259 SCIP* scip, /**< SCIP data structure */
260 SCIP_ROW* row /**< row that mirinfo is stored for */
261 );
262
263/** print MIR cut to certificate file
264 *
265 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
266 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
267 *
268 * @pre This method can be called if @p scip is in one of the following stages:
269 * - \ref SCIP_STAGE_SOLVING
270 *
271 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
272 */
273SCIP_EXPORT
275 SCIP* scip, /**< SCIP data structure */
276 SCIP_ROW* row /**< row that needs to be certified */
277 );
278
279/** frees the active mir information
280 *
281 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
282 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
283 *
284 * @pre This method can be called if @p scip is in one of the following stages:
285 * - \ref SCIP_STAGE_SOLVING
286 *
287 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
288 */
289SCIP_EXPORT
291 SCIP* scip /**< SCIP data structure */
292 );
293
294/**@} */
295
296#ifdef __cplusplus
297}
298#endif
299
300#endif
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:156
SCIP_RETCODE SCIPcertifyCons(SCIP *scip, SCIP_Bool isorigfile, const char *consname, const char sense, SCIP_RATIONAL *side, int len, int *ind, SCIP_RATIONAL **val)
SCIP_RETCODE SCIPaddCertificateMirInfo(SCIP *scip)
SCIP_RETCODE SCIPfreeCertificateActiveMirInfo(SCIP *scip)
SCIP_RETCODE SCIPstoreCertificateActiveAggrInfo(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPcertifyActivityVarBound(SCIP *scip, const char *linename, SCIP_BOUNDTYPE boundtype, SCIP_Real newbound, SCIP_Bool ismaxactivity, SCIP_CONS *constraint, SCIP_VAR *variable, SCIP_ROWEXACT *row, SCIP_RATIONAL **vals, SCIP_RATIONAL *lhs, SCIP_RATIONAL *rhs, SCIP_VAR **vars, int nvars)
SCIP_RETCODE SCIPcertifyActivityConflict(SCIP *scip, SCIP_CONS *cons, SCIP_ROWEXACT *row, SCIP_RATIONAL *lhs, SCIP_RATIONAL *rhs, int nvals, SCIP_RATIONAL **vals, SCIP_VAR **vars, SCIP_RATIONAL *diff, SCIP_Bool userhs)
SCIP_Bool SCIPisCertified(SCIP *scip)
SCIP_RETCODE SCIPcertifyActivityVarBoundExact(SCIP *scip, const char *linename, SCIP_BOUNDTYPE boundtype, SCIP_RATIONAL *newbound, SCIP_Bool ismaxactivity, SCIP_CONS *constraint, SCIP_VAR *variable, SCIP_ROWEXACT *row, SCIP_RATIONAL **vals, SCIP_RATIONAL *lhs, SCIP_RATIONAL *rhs, SCIP_VAR **vars, int nvars)
SCIP_RETCODE SCIPaddCertificateAggrInfo(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW **aggrrows, SCIP_Real *weights, int naggrrows, SCIP_ROW **negslackrows, SCIP_Real *negslackweights, int nnegslackrows)
SCIP_Bool SCIPshouldCertificateTrackBounds(SCIP *scip)
SCIP_RETCODE SCIPfreeCertificateActiveAggrInfo(SCIP *scip)
SCIP_RETCODE SCIPcertifyMirCut(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPstoreCertificateActiveMirInfo(SCIP *scip, SCIP_ROW *row)
type definitions for certificate output
type definitions for constraints and constraint handlers
type definitions for cuts
type definitions for primal heuristics
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:60
type definitions for exact LP management
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for SCIP's main datastructure
type definitions for storing primal CIP solutions
type definitions for problem variables