SCIP Doxygen Documentation
Loading...
Searching...
No Matches
scip_sol.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-2026 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_sol.h
26 * @ingroup PUBLICCOREAPI
27 * @brief public methods for solutions
28 * @author Tobias Achterberg
29 * @author Timo Berthold
30 * @author Thorsten Koch
31 * @author Alexander Martin
32 * @author Marc Pfetsch
33 * @author Kati Wolter
34 * @author Gregor Hendel
35 * @author Leona Gottwald
36 */
37
38/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39
40#ifndef __SCIP_SCIP_SOL_H__
41#define __SCIP_SCIP_SOL_H__
42
43
44#include "scip/def.h"
45#include "scip/type_cons.h"
46#include "scip/type_heur.h"
47#include "scip/type_rational.h"
48#include "scip/type_retcode.h"
49#include "scip/type_scip.h"
50#include "scip/type_sol.h"
51#include "scip/type_var.h"
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57/**@addtogroup PublicSolutionMethods
58 *
59 * @{
60 */
61
62/** creates a primal solution, initialized to zero
63 *
64 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
65 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
66 *
67 * @pre This method can be called if SCIP is in one of the following stages:
68 * - \ref SCIP_STAGE_PROBLEM
69 * - \ref SCIP_STAGE_TRANSFORMING
70 * - \ref SCIP_STAGE_TRANSFORMED
71 * - \ref SCIP_STAGE_INITPRESOLVE
72 * - \ref SCIP_STAGE_PRESOLVING
73 * - \ref SCIP_STAGE_EXITPRESOLVE
74 * - \ref SCIP_STAGE_PRESOLVED
75 * - \ref SCIP_STAGE_INITSOLVE
76 * - \ref SCIP_STAGE_SOLVING
77 */
78SCIP_EXPORT
80 SCIP* scip, /**< SCIP data structure */
81 SCIP_SOL** sol, /**< pointer to store the solution */
82 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
83 );
84
85/** creates an exact primal solution, initialized to zero
86 *
87 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
88 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
89 *
90 * @pre This method can be called if SCIP is in one of the following stages:
91 * - \ref SCIP_STAGE_PROBLEM
92 * - \ref SCIP_STAGE_TRANSFORMING
93 * - \ref SCIP_STAGE_TRANSFORMED
94 * - \ref SCIP_STAGE_INITPRESOLVE
95 * - \ref SCIP_STAGE_PRESOLVING
96 * - \ref SCIP_STAGE_EXITPRESOLVE
97 * - \ref SCIP_STAGE_PRESOLVED
98 * - \ref SCIP_STAGE_INITSOLVE
99 * - \ref SCIP_STAGE_SOLVING
100 */
101SCIP_EXPORT
103 SCIP* scip, /**< SCIP data structure */
104 SCIP_SOL** sol, /**< pointer to store the solution */
105 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
106 );
107
108/** creates a primal solution, initialized to the current LP solution
109 *
110 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
111 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
112 *
113 * @pre This method can be called if SCIP is in one of the following stages:
114 * - \ref SCIP_STAGE_SOLVING
115 */
116SCIP_EXPORT
118 SCIP* scip, /**< SCIP data structure */
119 SCIP_SOL** sol, /**< pointer to store the solution */
120 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
121 );
122
123/** creates an exact primal solution, initialized to the current exact LP solution
124 *
125 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
126 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
127 *
128 * @pre This method can be called if SCIP is in one of the following stages:
129 * - \ref SCIP_STAGE_SOLVING
130 */
131SCIP_EXPORT
133 SCIP* scip, /**< SCIP data structure */
134 SCIP_SOL** sol, /**< pointer to store the solution */
135 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
136 );
137
138/** creates a primal solution, initialized to the current NLP solution
139 *
140 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
141 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
142 *
143 * @pre This method can be called if SCIP is in one of the following stages:
144 * - \ref SCIP_STAGE_SOLVING
145 */
146SCIP_EXPORT
148 SCIP* scip, /**< SCIP data structure */
149 SCIP_SOL** sol, /**< pointer to store the solution */
150 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
151 );
152
153/** creates a primal solution, initialized to the current relaxation solution
154 *
155 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
156 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
157 *
158 * @pre This method can be called if SCIP is in one of the following stages:
159 * - \ref SCIP_STAGE_SOLVING
160 */
161SCIP_EXPORT
163 SCIP* scip, /**< SCIP data structure */
164 SCIP_SOL** sol, /**< pointer to store the solution */
165 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
166 );
167
168/** creates a primal solution, initialized to the current pseudo solution
169 *
170 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
171 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
172 *
173 * @pre This method can be called if SCIP is in one of the following stages:
174 * - \ref SCIP_STAGE_SOLVING
175 */
176SCIP_EXPORT
178 SCIP* scip, /**< SCIP data structure */
179 SCIP_SOL** sol, /**< pointer to store the solution */
180 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
181 );
182
183/** creates a primal solution, initialized to the current LP or pseudo solution, depending on whether the LP was solved
184 * at the current node
185 *
186 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
187 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
188 *
189 * @pre This method can be called if SCIP is in one of the following stages:
190 * - \ref SCIP_STAGE_SOLVING
191 */
192SCIP_EXPORT
194 SCIP* scip, /**< SCIP data structure */
195 SCIP_SOL** sol, /**< pointer to store the solution */
196 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
197 );
198
199/** creates a partial primal solution, initialized to unknown values
200 *
201 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
202 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
203 *
204 * @pre This method can be called if SCIP is in one of the following stages:
205 * - \ref SCIP_STAGE_PROBLEM
206 */
207SCIP_EXPORT
209 SCIP* scip, /**< SCIP data structure */
210 SCIP_SOL** sol, /**< pointer to store the solution */
211 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
212 );
213
214/** creates a primal solution, initialized to unknown values
215 *
216 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
217 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
218 *
219 * @pre This method can be called if SCIP is in one of the following stages:
220 * - \ref SCIP_STAGE_TRANSFORMING
221 * - \ref SCIP_STAGE_TRANSFORMED
222 * - \ref SCIP_STAGE_INITPRESOLVE
223 * - \ref SCIP_STAGE_PRESOLVING
224 * - \ref SCIP_STAGE_EXITPRESOLVE
225 * - \ref SCIP_STAGE_PRESOLVED
226 * - \ref SCIP_STAGE_INITSOLVE
227 * - \ref SCIP_STAGE_SOLVING
228 */
229SCIP_EXPORT
231 SCIP* scip, /**< SCIP data structure */
232 SCIP_SOL** sol, /**< pointer to store the solution */
233 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
234 );
235
236/** creates a primal solution living in the original problem space, initialized to zero;
237 * a solution in original space allows to set original variables to values that would be invalid in the
238 * transformed problem due to preprocessing fixings or aggregations
239 *
240 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
241 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
242 *
243 * @pre This method can be called if SCIP is in one of the following stages:
244 * - \ref SCIP_STAGE_PROBLEM
245 * - \ref SCIP_STAGE_TRANSFORMING
246 * - \ref SCIP_STAGE_TRANSFORMED
247 * - \ref SCIP_STAGE_INITPRESOLVE
248 * - \ref SCIP_STAGE_PRESOLVING
249 * - \ref SCIP_STAGE_EXITPRESOLVE
250 * - \ref SCIP_STAGE_PRESOLVED
251 * - \ref SCIP_STAGE_INITSOLVE
252 * - \ref SCIP_STAGE_SOLVING
253 */
254SCIP_EXPORT
256 SCIP* scip, /**< SCIP data structure */
257 SCIP_SOL** sol, /**< pointer to store the solution */
258 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
259 );
260
261/** creates a copy of a primal solution; note that a copy of a linked solution is also linked and needs to be unlinked
262 * if it should stay unaffected from changes in the LP or pseudo solution
263 *
264 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
265 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
266 *
267 * @pre This method can be called if SCIP is in one of the following stages:
268 * - \ref SCIP_STAGE_PROBLEM
269 * - \ref SCIP_STAGE_TRANSFORMING
270 * - \ref SCIP_STAGE_TRANSFORMED
271 * - \ref SCIP_STAGE_INITPRESOLVE
272 * - \ref SCIP_STAGE_PRESOLVING
273 * - \ref SCIP_STAGE_EXITPRESOLVE
274 * - \ref SCIP_STAGE_PRESOLVED
275 * - \ref SCIP_STAGE_INITSOLVE
276 * - \ref SCIP_STAGE_SOLVING
277 */
278SCIP_EXPORT
280 SCIP* scip, /**< SCIP data structure */
281 SCIP_SOL** sol, /**< pointer to store the solution */
282 SCIP_SOL* sourcesol /**< primal CIP solution to copy */
283 );
284
285/** creates a copy of a solution in the original primal solution space
286 *
287 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
288 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
289 *
290 * @pre This method can be called if SCIP is in one of the following stages:
291 * - \ref SCIP_STAGE_PROBLEM
292 * - \ref SCIP_STAGE_TRANSFORMING
293 * - \ref SCIP_STAGE_TRANSFORMED
294 * - \ref SCIP_STAGE_INITPRESOLVE
295 * - \ref SCIP_STAGE_PRESOLVING
296 * - \ref SCIP_STAGE_EXITPRESOLVE
297 * - \ref SCIP_STAGE_PRESOLVED
298 * - \ref SCIP_STAGE_INITSOLVE
299 * - \ref SCIP_STAGE_SOLVING
300 * - \ref SCIP_STAGE_SOLVED
301 * - \ref SCIP_STAGE_EXITSOLVE
302 * - \ref SCIP_STAGE_FREETRANS
303 */
304SCIP_EXPORT
306 SCIP* scip, /**< SCIP data structure */
307 SCIP_SOL** sol, /**< pointer to store the solution */
308 SCIP_SOL* sourcesol /**< primal CIP solution to copy */
309 );
310
311/** creates a copy of a primal solution, thereby replacing infinite fixings of variables by finite values;
312 * the copy is always defined in the original variable space;
313 * success indicates whether the objective value of the solution was changed by removing infinite values
314 *
315 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
316 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
317 *
318 * @pre This method can be called if SCIP is in one of the following stages:
319 * - \ref SCIP_STAGE_PROBLEM
320 * - \ref SCIP_STAGE_TRANSFORMING
321 * - \ref SCIP_STAGE_TRANSFORMED
322 * - \ref SCIP_STAGE_INITPRESOLVE
323 * - \ref SCIP_STAGE_PRESOLVING
324 * - \ref SCIP_STAGE_EXITPRESOLVE
325 * - \ref SCIP_STAGE_PRESOLVED
326 * - \ref SCIP_STAGE_INITSOLVE
327 * - \ref SCIP_STAGE_SOLVING
328 * - \ref SCIP_STAGE_SOLVED
329 * - \ref SCIP_STAGE_EXITSOLVE
330 */
331SCIP_EXPORT
333 SCIP* scip, /**< SCIP data structure */
334 SCIP_SOL** sol, /**< pointer to store the solution */
335 SCIP_SOL* sourcesol, /**< primal CIP solution to copy */
336 SCIP_Bool* success /**< does the finite solution have the same objective value? */
337 );
338
339/** frees primal CIP solution
340 *
341 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
342 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
343 *
344 * @pre This method can be called if SCIP is in one of the following stages:
345 * - \ref SCIP_STAGE_PROBLEM
346 * - \ref SCIP_STAGE_TRANSFORMING
347 * - \ref SCIP_STAGE_TRANSFORMED
348 * - \ref SCIP_STAGE_INITPRESOLVE
349 * - \ref SCIP_STAGE_PRESOLVING
350 * - \ref SCIP_STAGE_EXITPRESOLVE
351 * - \ref SCIP_STAGE_PRESOLVED
352 * - \ref SCIP_STAGE_INITSOLVE
353 * - \ref SCIP_STAGE_SOLVING
354 * - \ref SCIP_STAGE_SOLVED
355 * - \ref SCIP_STAGE_EXITSOLVE
356 * - \ref SCIP_STAGE_FREETRANS
357 */
358SCIP_EXPORT
360 SCIP* scip, /**< SCIP data structure */
361 SCIP_SOL** sol /**< pointer to the solution */
362 );
363
364/** links a primal solution to the current LP solution
365 *
366 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
367 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
368 *
369 * @pre This method can be called if SCIP is in one of the following stages:
370 * - \ref SCIP_STAGE_SOLVING
371 */
372SCIP_EXPORT
374 SCIP* scip, /**< SCIP data structure */
375 SCIP_SOL* sol /**< primal solution */
376 );
377
378/** links a primal solution to the current exact LP solution
379 *
380 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
381 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
382 *
383 * @pre This method can be called if SCIP is in one of the following stages:
384 * - \ref SCIP_STAGE_SOLVING
385 */
387 SCIP* scip, /**< SCIP data structure */
388 SCIP_SOL* sol /**< primal solution */
389 );
390
391/** links a primal solution to the current NLP solution
392 *
393 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
394 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
395 *
396 * @pre This method can be called if SCIP is in one of the following stages:
397 * - \ref SCIP_STAGE_SOLVING
398 */
399SCIP_EXPORT
401 SCIP* scip, /**< SCIP data structure */
402 SCIP_SOL* sol /**< primal solution */
403 );
404
405/** links a primal solution to the current relaxation solution
406 *
407 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
408 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
409 *
410 * @pre This method can be called if SCIP is in one of the following stages:
411 * - \ref SCIP_STAGE_SOLVING
412 */
413SCIP_EXPORT
415 SCIP* scip, /**< SCIP data structure */
416 SCIP_SOL* sol /**< primal solution */
417 );
418
419/** links a primal solution to the current pseudo solution
420 *
421 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
422 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
423 *
424 * @pre This method can be called if SCIP is in one of the following stages:
425 * - \ref SCIP_STAGE_PRESOLVING
426 * - \ref SCIP_STAGE_SOLVING
427 */
428SCIP_EXPORT
430 SCIP* scip, /**< SCIP data structure */
431 SCIP_SOL* sol /**< primal solution */
432 );
433
434/** links a primal solution to the current LP or pseudo solution
435 *
436 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
437 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
438 *
439 * @pre This method can be called if SCIP is in one of the following stages:
440 * - \ref SCIP_STAGE_SOLVING
441 */
442SCIP_EXPORT
444 SCIP* scip, /**< SCIP data structure */
445 SCIP_SOL* sol /**< primal solution */
446 );
447
448/** clears a primal solution
449 *
450 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
451 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
452 *
453 * @pre This method can be called if SCIP is in one of the following stages:
454 * - \ref SCIP_STAGE_PROBLEM
455 * - \ref SCIP_STAGE_TRANSFORMING
456 * - \ref SCIP_STAGE_TRANSFORMED
457 * - \ref SCIP_STAGE_INITPRESOLVE
458 * - \ref SCIP_STAGE_PRESOLVING
459 * - \ref SCIP_STAGE_EXITPRESOLVE
460 * - \ref SCIP_STAGE_PRESOLVED
461 * - \ref SCIP_STAGE_INITSOLVE
462 * - \ref SCIP_STAGE_SOLVING
463 * - \ref SCIP_STAGE_SOLVED
464 * - \ref SCIP_STAGE_EXITSOLVE
465 * - \ref SCIP_STAGE_FREETRANS
466 */
467SCIP_EXPORT
469 SCIP* scip, /**< SCIP data structure */
470 SCIP_SOL* sol /**< primal solution */
471 );
472
473/** stores solution values of variables in solution's own array
474 *
475 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
476 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
477 *
478 * @pre This method can be called if SCIP is in one of the following stages:
479 * - \ref SCIP_STAGE_TRANSFORMING
480 * - \ref SCIP_STAGE_TRANSFORMED
481 * - \ref SCIP_STAGE_PRESOLVING
482 * - \ref SCIP_STAGE_PRESOLVED
483 * - \ref SCIP_STAGE_INITSOLVE
484 * - \ref SCIP_STAGE_SOLVING
485 * - \ref SCIP_STAGE_SOLVED
486 * - \ref SCIP_STAGE_EXITSOLVE
487 * - \ref SCIP_STAGE_FREETRANS
488 */
489SCIP_EXPORT
491 SCIP* scip, /**< SCIP data structure */
492 SCIP_SOL* sol /**< primal solution */
493 );
494
495/** stores exact solution values of variables in solution's own array
496 *
497 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
498 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
499 *
500 * @pre This method can be called if SCIP is in one of the following stages:
501 * - \ref SCIP_STAGE_TRANSFORMING
502 * - \ref SCIP_STAGE_TRANSFORMED
503 * - \ref SCIP_STAGE_PRESOLVING
504 * - \ref SCIP_STAGE_PRESOLVED
505 * - \ref SCIP_STAGE_INITSOLVE
506 * - \ref SCIP_STAGE_SOLVING
507 * - \ref SCIP_STAGE_SOLVED
508 * - \ref SCIP_STAGE_EXITSOLVE
509 * - \ref SCIP_STAGE_FREETRANS
510 */
511SCIP_EXPORT
513 SCIP* scip, /**< SCIP data structure */
514 SCIP_SOL* sol /**< primal solution */
515 );
516
517/** sets value of variable in primal CIP solution
518 *
519 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
520 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
521 *
522 * @pre This method can be called if SCIP is in one of the following stages:
523 * - \ref SCIP_STAGE_PROBLEM
524 * - \ref SCIP_STAGE_TRANSFORMING
525 * - \ref SCIP_STAGE_TRANSFORMED
526 * - \ref SCIP_STAGE_INITPRESOLVE
527 * - \ref SCIP_STAGE_PRESOLVING
528 * - \ref SCIP_STAGE_EXITPRESOLVE
529 * - \ref SCIP_STAGE_PRESOLVED
530 * - \ref SCIP_STAGE_INITSOLVE
531 * - \ref SCIP_STAGE_SOLVING
532 * - \ref SCIP_STAGE_SOLVED
533 * - \ref SCIP_STAGE_EXITSOLVE
534 * - \ref SCIP_STAGE_FREETRANS
535 */
536SCIP_EXPORT
538 SCIP* scip, /**< SCIP data structure */
539 SCIP_SOL* sol, /**< primal solution */
540 SCIP_VAR* var, /**< variable to add to solution */
541 SCIP_Real val /**< solution value of variable */
542 );
543
544/** sets exact value of variable in primal CIP solution
545 *
546 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
547 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
548 *
549 * @pre This method can be called if SCIP is in one of the following stages:
550 * - \ref SCIP_STAGE_PROBLEM
551 * - \ref SCIP_STAGE_TRANSFORMING
552 * - \ref SCIP_STAGE_TRANSFORMED
553 * - \ref SCIP_STAGE_INITPRESOLVE
554 * - \ref SCIP_STAGE_PRESOLVING
555 * - \ref SCIP_STAGE_EXITPRESOLVE
556 * - \ref SCIP_STAGE_PRESOLVED
557 * - \ref SCIP_STAGE_INITSOLVE
558 * - \ref SCIP_STAGE_SOLVING
559 * - \ref SCIP_STAGE_SOLVED
560 * - \ref SCIP_STAGE_EXITSOLVE
561 * - \ref SCIP_STAGE_FREETRANS
562 */
563SCIP_EXPORT
565 SCIP* scip, /**< SCIP data structure */
566 SCIP_SOL* sol, /**< primal solution */
567 SCIP_VAR* var, /**< variable to add to solution */
568 SCIP_RATIONAL* val /**< solution value of variable */
569 );
570
571/** sets values of multiple variables in primal CIP solution
572 *
573 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
574 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
575 *
576 * @pre This method can be called if SCIP is in one of the following stages:
577 * - \ref SCIP_STAGE_PROBLEM
578 * - \ref SCIP_STAGE_TRANSFORMING
579 * - \ref SCIP_STAGE_TRANSFORMED
580 * - \ref SCIP_STAGE_INITPRESOLVE
581 * - \ref SCIP_STAGE_PRESOLVING
582 * - \ref SCIP_STAGE_EXITPRESOLVE
583 * - \ref SCIP_STAGE_PRESOLVED
584 * - \ref SCIP_STAGE_INITSOLVE
585 * - \ref SCIP_STAGE_SOLVING
586 * - \ref SCIP_STAGE_SOLVED
587 * - \ref SCIP_STAGE_EXITSOLVE
588 * - \ref SCIP_STAGE_FREETRANS
589 */
590SCIP_EXPORT
592 SCIP* scip, /**< SCIP data structure */
593 SCIP_SOL* sol, /**< primal solution */
594 int nvars, /**< number of variables to set solution value for */
595 SCIP_VAR** vars, /**< array with variables to add to solution */
596 SCIP_Real* vals /**< array with solution values of variables */
597 );
598
599/** increases value of variable in primal CIP solution
600 *
601 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
602 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
603 *
604 * @pre This method can be called if SCIP is in one of the following stages:
605 * - \ref SCIP_STAGE_PROBLEM
606 * - \ref SCIP_STAGE_TRANSFORMING
607 * - \ref SCIP_STAGE_TRANSFORMED
608 * - \ref SCIP_STAGE_INITPRESOLVE
609 * - \ref SCIP_STAGE_PRESOLVING
610 * - \ref SCIP_STAGE_EXITPRESOLVE
611 * - \ref SCIP_STAGE_PRESOLVED
612 * - \ref SCIP_STAGE_INITSOLVE
613 * - \ref SCIP_STAGE_SOLVING
614 * - \ref SCIP_STAGE_SOLVED
615 * - \ref SCIP_STAGE_EXITSOLVE
616 * - \ref SCIP_STAGE_FREETRANS
617 */
618SCIP_EXPORT
620 SCIP* scip, /**< SCIP data structure */
621 SCIP_SOL* sol, /**< primal solution */
622 SCIP_VAR* var, /**< variable to increase solution value for */
623 SCIP_Real incval /**< increment for solution value of variable */
624 );
625
626/** returns value of variable in primal CIP solution, or in current LP/pseudo solution
627 *
628 * @return value of variable in primal CIP solution, or in current LP/pseudo solution
629 *
630 * @pre In case the solution pointer @p sol is @b NULL, that means it is asked for the LP or pseudo solution, this method
631 * can only be called if @p scip is in the solving stage \ref SCIP_STAGE_SOLVING. In any other case, this method
632 * can be called if @p scip is in one of the following stages:
633 * - \ref SCIP_STAGE_PROBLEM
634 * - \ref SCIP_STAGE_TRANSFORMING
635 * - \ref SCIP_STAGE_TRANSFORMED
636 * - \ref SCIP_STAGE_INITPRESOLVE
637 * - \ref SCIP_STAGE_PRESOLVING
638 * - \ref SCIP_STAGE_EXITPRESOLVE
639 * - \ref SCIP_STAGE_PRESOLVED
640 * - \ref SCIP_STAGE_INITSOLVE
641 * - \ref SCIP_STAGE_SOLVING
642 * - \ref SCIP_STAGE_SOLVED
643 * - \ref SCIP_STAGE_EXITSOLVE
644 * - \ref SCIP_STAGE_FREETRANS
645 */
646SCIP_EXPORT
648 SCIP* scip, /**< SCIP data structure */
649 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
650 SCIP_VAR* var /**< variable to get value for */
651 );
652
653/** gets value of variable in primal CIP solution, or in current LP/pseudo solution
654 *
655 * @pre In case the solution pointer @p sol is @b NULL, that means it is asked for the LP or pseudo solution, this method
656 * can only be called if @p scip is in the solving stage \ref SCIP_STAGE_SOLVING. In any other case, this method
657 * can be called if @p scip is in one of the following stages:
658 * - \ref SCIP_STAGE_PROBLEM
659 * - \ref SCIP_STAGE_TRANSFORMING
660 * - \ref SCIP_STAGE_TRANSFORMED
661 * - \ref SCIP_STAGE_INITPRESOLVE
662 * - \ref SCIP_STAGE_PRESOLVING
663 * - \ref SCIP_STAGE_EXITPRESOLVE
664 * - \ref SCIP_STAGE_PRESOLVED
665 * - \ref SCIP_STAGE_INITSOLVE
666 * - \ref SCIP_STAGE_SOLVING
667 * - \ref SCIP_STAGE_SOLVED
668 * - \ref SCIP_STAGE_EXITSOLVE
669 * - \ref SCIP_STAGE_FREETRANS
670 */
671SCIP_EXPORT
673 SCIP* scip, /**< SCIP data structure */
674 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
675 SCIP_VAR* var, /**< variable to get value for */
676 SCIP_RATIONAL* res /**< resulting rational */
677 );
678
679/** gets values of multiple variables in primal CIP solution
680 *
681 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
682 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
683 *
684 * @pre This method can be called if SCIP is in one of the following stages:
685 * - \ref SCIP_STAGE_PROBLEM
686 * - \ref SCIP_STAGE_TRANSFORMING
687 * - \ref SCIP_STAGE_TRANSFORMED
688 * - \ref SCIP_STAGE_INITPRESOLVE
689 * - \ref SCIP_STAGE_PRESOLVING
690 * - \ref SCIP_STAGE_EXITPRESOLVE
691 * - \ref SCIP_STAGE_PRESOLVED
692 * - \ref SCIP_STAGE_INITSOLVE
693 * - \ref SCIP_STAGE_SOLVING
694 * - \ref SCIP_STAGE_SOLVED
695 * - \ref SCIP_STAGE_EXITSOLVE
696 * - \ref SCIP_STAGE_FREETRANS
697 */
698SCIP_EXPORT
700 SCIP* scip, /**< SCIP data structure */
701 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
702 int nvars, /**< number of variables to get solution value for */
703 SCIP_VAR** vars, /**< array with variables to get value for */
704 SCIP_Real* vals /**< array to store solution values of variables */
705 );
706
707/** returns objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
708 *
709 * @return objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
710 *
711 * @pre This method can be called if SCIP is in one of the following stages:
712 * - \ref SCIP_STAGE_PROBLEM
713 * - \ref SCIP_STAGE_TRANSFORMING
714 * - \ref SCIP_STAGE_TRANSFORMED
715 * - \ref SCIP_STAGE_INITPRESOLVE
716 * - \ref SCIP_STAGE_PRESOLVING
717 * - \ref SCIP_STAGE_EXITPRESOLVE
718 * - \ref SCIP_STAGE_PRESOLVED
719 * - \ref SCIP_STAGE_INITSOLVE
720 * - \ref SCIP_STAGE_SOLVING
721 * - \ref SCIP_STAGE_SOLVED
722 * - \ref SCIP_STAGE_EXITSOLVE
723 * - \ref SCIP_STAGE_FREETRANS
724 */
725SCIP_EXPORT
727 SCIP* scip, /**< SCIP data structure */
728 SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
729 );
730
731/** gets exact objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
732 *
733 * @pre This method can be called if SCIP is in one of the following stages:
734 * - \ref SCIP_STAGE_PROBLEM
735 * - \ref SCIP_STAGE_TRANSFORMING
736 * - \ref SCIP_STAGE_TRANSFORMED
737 * - \ref SCIP_STAGE_INITPRESOLVE
738 * - \ref SCIP_STAGE_PRESOLVING
739 * - \ref SCIP_STAGE_EXITPRESOLVE
740 * - \ref SCIP_STAGE_PRESOLVED
741 * - \ref SCIP_STAGE_INITSOLVE
742 * - \ref SCIP_STAGE_SOLVING
743 * - \ref SCIP_STAGE_SOLVED
744 * - \ref SCIP_STAGE_EXITSOLVE
745 * - \ref SCIP_STAGE_FREETRANS
746 */
747SCIP_EXPORT
749 SCIP* scip, /**< SCIP data structure */
750 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo objective value */
751 SCIP_RATIONAL* res /**< result pointer to store rational */
752 );
753
754/** returns transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
755 *
756 * @return transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
757 *
758 * @pre This method can be called if SCIP is in one of the following stages:
759 * - \ref SCIP_STAGE_TRANSFORMING
760 * - \ref SCIP_STAGE_TRANSFORMED
761 * - \ref SCIP_STAGE_INITPRESOLVE
762 * - \ref SCIP_STAGE_PRESOLVING
763 * - \ref SCIP_STAGE_EXITPRESOLVE
764 * - \ref SCIP_STAGE_PRESOLVED
765 * - \ref SCIP_STAGE_INITSOLVE
766 * - \ref SCIP_STAGE_SOLVING
767 * - \ref SCIP_STAGE_SOLVED
768 * - \ref SCIP_STAGE_EXITSOLVE
769 * - \ref SCIP_STAGE_FREETRANS
770 */
771SCIP_EXPORT
773 SCIP* scip, /**< SCIP data structure */
774 SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
775 );
776
777/** gets transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
778 *
779 * @pre This method can be called if SCIP is in one of the following stages:
780 * - \ref SCIP_STAGE_TRANSFORMING
781 * - \ref SCIP_STAGE_TRANSFORMED
782 * - \ref SCIP_STAGE_INITPRESOLVE
783 * - \ref SCIP_STAGE_PRESOLVING
784 * - \ref SCIP_STAGE_EXITPRESOLVE
785 * - \ref SCIP_STAGE_PRESOLVED
786 * - \ref SCIP_STAGE_INITSOLVE
787 * - \ref SCIP_STAGE_SOLVING
788 * - \ref SCIP_STAGE_SOLVED
789 * - \ref SCIP_STAGE_EXITSOLVE
790 * - \ref SCIP_STAGE_FREETRANS
791 */
793 SCIP* scip, /**< SCIP data structure */
794 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo objective value */
795 SCIP_RATIONAL* res /**< result pointer to store rational */
796 );
797
798/** recomputes the objective value of an original solution, e.g., when transferring solutions
799 * from the solution pool (objective coefficients might have changed in the meantime)
800 *
801 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
802 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
803 *
804 * @pre This method can be called if SCIP is in one of the following stages:
805 * - \ref SCIP_STAGE_TRANSFORMED
806 * - \ref SCIP_STAGE_PRESOLVING
807 * - \ref SCIP_STAGE_SOLVING
808 *
809 */
810SCIP_EXPORT
812 SCIP* scip,
814 );
815
816/** maps original space objective value into transformed objective value
817 *
818 * @return transformed objective value
819 *
820 * @pre This method can be called if SCIP is in one of the following stages:
821 * - \ref SCIP_STAGE_TRANSFORMING
822 * - \ref SCIP_STAGE_TRANSFORMED
823 * - \ref SCIP_STAGE_INITPRESOLVE
824 * - \ref SCIP_STAGE_PRESOLVING
825 * - \ref SCIP_STAGE_EXITPRESOLVE
826 * - \ref SCIP_STAGE_PRESOLVED
827 * - \ref SCIP_STAGE_INITSOLVE
828 * - \ref SCIP_STAGE_SOLVING
829 * - \ref SCIP_STAGE_SOLVED
830 */
831SCIP_EXPORT
833 SCIP* scip, /**< SCIP data structure */
834 SCIP_Real obj /**< original space objective value to transform */
835 );
836
837/** maps transformed objective value into original space
838 *
839 * @return objective value into original space
840 *
841 * @pre This method can be called if SCIP is in one of the following stages:
842 * - \ref SCIP_STAGE_TRANSFORMING
843 * - \ref SCIP_STAGE_TRANSFORMED
844 * - \ref SCIP_STAGE_INITPRESOLVE
845 * - \ref SCIP_STAGE_PRESOLVING
846 * - \ref SCIP_STAGE_EXITPRESOLVE
847 * - \ref SCIP_STAGE_PRESOLVED
848 * - \ref SCIP_STAGE_INITSOLVE
849 * - \ref SCIP_STAGE_SOLVING
850 * - \ref SCIP_STAGE_SOLVED
851 */
852SCIP_EXPORT
854 SCIP* scip, /**< SCIP data structure */
855 SCIP_Real obj /**< transformed objective value to retransform in original space */
856 );
857
858/** gets clock time, when this solution was found
859 *
860 * @return clock time, when this solution was found
861 *
862 * @pre This method can be called if SCIP is in one of the following stages:
863 * - \ref SCIP_STAGE_TRANSFORMING
864 * - \ref SCIP_STAGE_TRANSFORMED
865 * - \ref SCIP_STAGE_INITPRESOLVE
866 * - \ref SCIP_STAGE_PRESOLVING
867 * - \ref SCIP_STAGE_EXITPRESOLVE
868 * - \ref SCIP_STAGE_PRESOLVED
869 * - \ref SCIP_STAGE_INITSOLVE
870 * - \ref SCIP_STAGE_SOLVING
871 * - \ref SCIP_STAGE_SOLVED
872 * - \ref SCIP_STAGE_EXITSOLVE
873 * - \ref SCIP_STAGE_FREETRANS
874 */
875SCIP_EXPORT
877 SCIP* scip, /**< SCIP data structure */
878 SCIP_SOL* sol /**< primal solution */
879 );
880
881/** gets branch and bound run number, where this solution was found
882 *
883 * @return branch and bound run number, where this solution was found
884 *
885 * @pre This method can be called if SCIP is in one of the following stages:
886 * - \ref SCIP_STAGE_TRANSFORMING
887 * - \ref SCIP_STAGE_TRANSFORMED
888 * - \ref SCIP_STAGE_INITPRESOLVE
889 * - \ref SCIP_STAGE_PRESOLVING
890 * - \ref SCIP_STAGE_EXITPRESOLVE
891 * - \ref SCIP_STAGE_PRESOLVED
892 * - \ref SCIP_STAGE_INITSOLVE
893 * - \ref SCIP_STAGE_SOLVING
894 * - \ref SCIP_STAGE_SOLVED
895 * - \ref SCIP_STAGE_EXITSOLVE
896 * - \ref SCIP_STAGE_FREETRANS
897 */
898SCIP_EXPORT
900 SCIP* scip, /**< SCIP data structure */
901 SCIP_SOL* sol /**< primal solution */
902 );
903
904/** gets node number of the specific branch and bound run, where this solution was found
905 *
906 * @return node number of the specific branch and bound run, where this solution was found
907 *
908 * @pre This method can be called if SCIP is in one of the following stages:
909 * - \ref SCIP_STAGE_TRANSFORMING
910 * - \ref SCIP_STAGE_TRANSFORMED
911 * - \ref SCIP_STAGE_INITPRESOLVE
912 * - \ref SCIP_STAGE_PRESOLVING
913 * - \ref SCIP_STAGE_EXITPRESOLVE
914 * - \ref SCIP_STAGE_PRESOLVED
915 * - \ref SCIP_STAGE_INITSOLVE
916 * - \ref SCIP_STAGE_SOLVING
917 * - \ref SCIP_STAGE_SOLVED
918 * - \ref SCIP_STAGE_EXITSOLVE
919 * - \ref SCIP_STAGE_FREETRANS
920 */
921SCIP_EXPORT
923 SCIP* scip, /**< SCIP data structure */
924 SCIP_SOL* sol /**< primal solution */
925 );
926
927/** gets heuristic, that found this solution (or NULL if it's from the tree)
928 *
929 * @return heuristic, that found this solution (or NULL if it's from the tree)
930 *
931 * @pre This method can be called if SCIP is in one of the following stages:
932 * - \ref SCIP_STAGE_TRANSFORMING
933 * - \ref SCIP_STAGE_TRANSFORMED
934 * - \ref SCIP_STAGE_INITPRESOLVE
935 * - \ref SCIP_STAGE_PRESOLVING
936 * - \ref SCIP_STAGE_EXITPRESOLVE
937 * - \ref SCIP_STAGE_PRESOLVED
938 * - \ref SCIP_STAGE_INITSOLVE
939 * - \ref SCIP_STAGE_SOLVING
940 * - \ref SCIP_STAGE_SOLVED
941 * - \ref SCIP_STAGE_EXITSOLVE
942 * - \ref SCIP_STAGE_FREETRANS
943 */
944SCIP_EXPORT
946 SCIP* scip, /**< SCIP data structure */
947 SCIP_SOL* sol /**< primal solution */
948 );
949
950/** returns whether two given solutions are exactly equal
951 *
952 * @return returns whether two given solutions are exactly equal
953 *
954 * @pre This method can be called if SCIP is in one of the following stages:
955 * - \ref SCIP_STAGE_PROBLEM
956 * - \ref SCIP_STAGE_TRANSFORMING
957 * - \ref SCIP_STAGE_TRANSFORMED
958 * - \ref SCIP_STAGE_INITPRESOLVE
959 * - \ref SCIP_STAGE_PRESOLVING
960 * - \ref SCIP_STAGE_EXITPRESOLVE
961 * - \ref SCIP_STAGE_PRESOLVED
962 * - \ref SCIP_STAGE_INITSOLVE
963 * - \ref SCIP_STAGE_SOLVING
964 * - \ref SCIP_STAGE_SOLVED
965 * - \ref SCIP_STAGE_EXITSOLVE
966 * - \ref SCIP_STAGE_FREETRANS
967 */
968SCIP_EXPORT
970 SCIP* scip, /**< SCIP data structure */
971 SCIP_SOL* sol1, /**< first primal CIP solution */
972 SCIP_SOL* sol2 /**< second primal CIP solution */
973 );
974
975/** adjusts solution values of implied integral variables in handed solution, solution objective value is not
976 * deteriorated by this method
977 *
978 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
979 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
980 *
981 * @pre This method can be called if SCIP is in one of the following stages:
982 * - \ref SCIP_STAGE_SOLVING
983 */
984SCIP_EXPORT
986 SCIP* scip, /**< SCIP data structure */
987 SCIP_SOL* sol, /**< primal CIP solution */
988 SCIP_Bool uselprows /**< should LP row information be considered for none-objective variables */
989 );
990
991/** outputs non-zero variables of solution in original problem space to the given file stream
992 *
993 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
994 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
995 *
996 * @pre In case the solution pointer @p sol is NULL (askinking for the current LP/pseudo solution), this method can be
997 * called if @p scip is in one of the following stages:
998 * - \ref SCIP_STAGE_PRESOLVING
999 * - \ref SCIP_STAGE_EXITPRESOLVE
1000 * - \ref SCIP_STAGE_PRESOLVED
1001 * - \ref SCIP_STAGE_INITSOLVE
1002 * - \ref SCIP_STAGE_SOLVING
1003 * - \ref SCIP_STAGE_SOLVED
1004 * - \ref SCIP_STAGE_EXITSOLVE
1005 *
1006 * @pre In case the solution pointer @p sol is @b not NULL, this method can be called if @p scip is in one of the
1007 * following stages:
1008 * - \ref SCIP_STAGE_PROBLEM
1009 * - \ref SCIP_STAGE_TRANSFORMED
1010 * - \ref SCIP_STAGE_INITPRESOLVE
1011 * - \ref SCIP_STAGE_PRESOLVING
1012 * - \ref SCIP_STAGE_EXITPRESOLVE
1013 * - \ref SCIP_STAGE_PRESOLVED
1014 * - \ref SCIP_STAGE_INITSOLVE
1015 * - \ref SCIP_STAGE_SOLVING
1016 * - \ref SCIP_STAGE_SOLVED
1017 * - \ref SCIP_STAGE_EXITSOLVE
1018 */
1019SCIP_EXPORT
1021 SCIP* scip, /**< SCIP data structure */
1022 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
1023 FILE* file, /**< output file (or NULL for standard output) */
1024 SCIP_Bool printzeros /**< should variables set to zero be printed? */
1025 );
1026
1027/** print a rational solution */
1028SCIP_EXPORT
1030 SCIP* scip, /**< SCIP data structure */
1031 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
1032 FILE* file, /**< output file (or NULL for standard output) */
1033 SCIP_Bool printzeros /**< should variables set to zero be printed? */
1034 );
1035
1036/** outputs non-zero variables of solution in transformed problem space to file stream
1037 *
1038 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1039 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1040 *
1041 * @pre This method can be called if SCIP is in one of the following stages:
1042 * - \ref SCIP_STAGE_TRANSFORMED
1043 * - \ref SCIP_STAGE_INITPRESOLVE
1044 * - \ref SCIP_STAGE_PRESOLVING
1045 * - \ref SCIP_STAGE_EXITPRESOLVE
1046 * - \ref SCIP_STAGE_PRESOLVED
1047 * - \ref SCIP_STAGE_INITSOLVE
1048 * - \ref SCIP_STAGE_SOLVING
1049 * - \ref SCIP_STAGE_SOLVED
1050 * - \ref SCIP_STAGE_EXITSOLVE
1051 */
1052SCIP_EXPORT
1054 SCIP* scip, /**< SCIP data structure */
1055 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
1056 FILE* file, /**< output file (or NULL for standard output) */
1057 SCIP_Bool printzeros /**< should variables set to zero be printed? */
1058 );
1059
1060/** outputs discrete variables of solution in original problem space to the given file stream
1061 *
1062 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1063 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1064 *
1065 * @pre This method can be called if @p scip is in one of the following stages:
1066 * - \ref SCIP_STAGE_PROBLEM
1067 * - \ref SCIP_STAGE_TRANSFORMED
1068 * - \ref SCIP_STAGE_INITPRESOLVE
1069 * - \ref SCIP_STAGE_PRESOLVING
1070 * - \ref SCIP_STAGE_EXITPRESOLVE
1071 * - \ref SCIP_STAGE_PRESOLVED
1072 * - \ref SCIP_STAGE_INITSOLVE
1073 * - \ref SCIP_STAGE_SOLVING
1074 * - \ref SCIP_STAGE_SOLVED
1075 * - \ref SCIP_STAGE_EXITSOLVE
1076 */
1077SCIP_EXPORT
1079 SCIP* scip, /**< SCIP data structure */
1080 SCIP_SOL* sol, /**< primal solution */
1081 FILE* file /**< output file (or NULL for standard output) */
1082 );
1083
1084/** returns dual solution value of a constraint */
1085SCIP_EXPORT
1087 SCIP* scip, /**< SCIP data structure */
1088 SCIP_CONS* cons, /**< constraint for which the dual solution should be returned */
1089 SCIP_Real* dualsolval, /**< pointer to store the dual solution value */
1090 SCIP_Bool* boundconstraint /**< pointer to store whether the constraint is a bound constraint (or NULL) */
1091 );
1092
1093/** check whether the dual solution is available
1094 *
1095 * @note This is used when calling \ref SCIPprintDualSol()
1096 *
1097 * @return is dual solution available?
1098 *
1099 * @pre This method can be called if SCIP is in one of the following stages:
1100 * - \ref SCIP_STAGE_SOLVED
1101 */
1102SCIP_EXPORT
1104 SCIP* scip, /**< SCIP data structure */
1105 SCIP_Bool printreason /**< print warning message if dualsol is not available? */
1106 );
1107
1108/** outputs dual solution from LP solver to file stream
1109 *
1110 * @note This only works if no presolving has been performed, which can be checked by calling method \ref
1111 * SCIPhasPerformedPresolve().
1112 *
1113 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1114 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1115 *
1116 * @pre This method can be called if SCIP is in one of the following stages:
1117 * - \ref SCIP_STAGE_SOLVED
1118 */
1119SCIP_EXPORT
1121 SCIP* scip, /**< SCIP data structure */
1122 FILE* file, /**< output file (or NULL for standard output) */
1123 SCIP_Bool printzeros /**< should variables set to zero be printed? */
1124 );
1125
1126
1127/** outputs non-zero variables of solution representing a ray in original problem space to file stream
1128 *
1129 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1130 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1131 *
1132 * @pre This method can be called if SCIP is in one of the following stages:
1133 * - \ref SCIP_STAGE_PROBLEM
1134 * - \ref SCIP_STAGE_TRANSFORMED
1135 * - \ref SCIP_STAGE_INITPRESOLVE
1136 * - \ref SCIP_STAGE_PRESOLVING
1137 * - \ref SCIP_STAGE_EXITPRESOLVE
1138 * - \ref SCIP_STAGE_PRESOLVED
1139 * - \ref SCIP_STAGE_INITSOLVE
1140 * - \ref SCIP_STAGE_SOLVING
1141 * - \ref SCIP_STAGE_SOLVED
1142 * - \ref SCIP_STAGE_EXITSOLVE
1143 */
1144SCIP_EXPORT
1146 SCIP* scip, /**< SCIP data structure */
1147 SCIP_SOL* sol, /**< primal solution representing ray */
1148 FILE* file, /**< output file (or NULL for standard output) */
1149 SCIP_Bool printzeros /**< should variables set to zero be printed? */
1150 );
1151
1152/** gets number of feasible primal solutions stored in the solution storage in case the problem is transformed;
1153 * in case the problem stage is SCIP_STAGE_PROBLEM, the number of solution in the original solution candidate
1154 * storage is returned
1155 *
1156 * @return number of feasible primal solutions stored in the solution storage in case the problem is transformed; or
1157 * number of solution in the original solution candidate storage if the problem stage is SCIP_STAGE_PROBLEM
1158 *
1159 * @pre This method can be called if SCIP is in one of the following stages:
1160 * - \ref SCIP_STAGE_PROBLEM
1161 * - \ref SCIP_STAGE_TRANSFORMED
1162 * - \ref SCIP_STAGE_INITPRESOLVE
1163 * - \ref SCIP_STAGE_PRESOLVING
1164 * - \ref SCIP_STAGE_EXITPRESOLVE
1165 * - \ref SCIP_STAGE_PRESOLVED
1166 * - \ref SCIP_STAGE_INITSOLVE
1167 * - \ref SCIP_STAGE_SOLVING
1168 * - \ref SCIP_STAGE_SOLVED
1169 * - \ref SCIP_STAGE_EXITSOLVE
1170 */
1171SCIP_EXPORT
1172int SCIPgetNSols(
1173 SCIP* scip /**< SCIP data structure */
1174 );
1175
1176/** gets array of feasible primal solutions stored in the solution storage in case the problem is transformed; in case
1177 * if the problem stage is in SCIP_STAGE_PROBLEM, it returns the number array of solution candidate stored
1178 *
1179 * @return array of feasible primal solutions
1180 *
1181 * @pre This method can be called if SCIP is in one of the following stages:
1182 * - \ref SCIP_STAGE_PROBLEM
1183 * - \ref SCIP_STAGE_TRANSFORMED
1184 * - \ref SCIP_STAGE_INITPRESOLVE
1185 * - \ref SCIP_STAGE_PRESOLVING
1186 * - \ref SCIP_STAGE_EXITPRESOLVE
1187 * - \ref SCIP_STAGE_PRESOLVED
1188 * - \ref SCIP_STAGE_INITSOLVE
1189 * - \ref SCIP_STAGE_SOLVING
1190 * - \ref SCIP_STAGE_SOLVED
1191 * - \ref SCIP_STAGE_EXITSOLVE
1192 */
1193SCIP_EXPORT
1195 SCIP* scip /**< SCIP data structure */
1196 );
1197
1198/** gets best feasible primal solution found so far if the problem is transformed; in case the problem is in
1199 * SCIP_STAGE_PROBLEM it returns the best solution candidate, or NULL if no solution has been found or the candidate
1200 * store is empty;
1201 *
1202 * @return best feasible primal solution so far
1203 *
1204 * @pre This method can be called if SCIP is in one of the following stages:
1205 * - \ref SCIP_STAGE_PROBLEM
1206 * - \ref SCIP_STAGE_TRANSFORMED
1207 * - \ref SCIP_STAGE_INITPRESOLVE
1208 * - \ref SCIP_STAGE_PRESOLVING
1209 * - \ref SCIP_STAGE_EXITPRESOLVE
1210 * - \ref SCIP_STAGE_PRESOLVED
1211 * - \ref SCIP_STAGE_INITSOLVE
1212 * - \ref SCIP_STAGE_SOLVING
1213 * - \ref SCIP_STAGE_SOLVED
1214 * - \ref SCIP_STAGE_EXITSOLVE
1215 */
1216SCIP_EXPORT
1218 SCIP* scip /**< SCIP data structure */
1219 );
1220
1221/** outputs best feasible primal solution found so far to file stream
1222 *
1223 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1224 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1225 *
1226 * @pre This method can be called if SCIP is in one of the following stages:
1227 * - \ref SCIP_STAGE_INIT
1228 * - \ref SCIP_STAGE_PROBLEM
1229 * - \ref SCIP_STAGE_TRANSFORMING
1230 * - \ref SCIP_STAGE_TRANSFORMED
1231 * - \ref SCIP_STAGE_INITPRESOLVE
1232 * - \ref SCIP_STAGE_PRESOLVING
1233 * - \ref SCIP_STAGE_EXITPRESOLVE
1234 * - \ref SCIP_STAGE_PRESOLVED
1235 * - \ref SCIP_STAGE_INITSOLVE
1236 * - \ref SCIP_STAGE_SOLVING
1237 * - \ref SCIP_STAGE_SOLVED
1238 * - \ref SCIP_STAGE_EXITSOLVE
1239 * - \ref SCIP_STAGE_FREE
1240 */
1241SCIP_EXPORT
1243 SCIP* scip, /**< SCIP data structure */
1244 FILE* file, /**< output file (or NULL for standard output) */
1245 SCIP_Bool printzeros /**< should variables set to zero be printed? */
1246 );
1247
1248/** outputs best feasible primal solution found so far in transformed variables to file stream
1249 *
1250 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1251 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1252 *
1253 * @pre This method can be called if SCIP is in one of the following stages:
1254 * - \ref SCIP_STAGE_INIT
1255 * - \ref SCIP_STAGE_PROBLEM
1256 * - \ref SCIP_STAGE_TRANSFORMED
1257 * - \ref SCIP_STAGE_INITPRESOLVE
1258 * - \ref SCIP_STAGE_PRESOLVING
1259 * - \ref SCIP_STAGE_EXITPRESOLVE
1260 * - \ref SCIP_STAGE_PRESOLVED
1261 * - \ref SCIP_STAGE_INITSOLVE
1262 * - \ref SCIP_STAGE_SOLVING
1263 * - \ref SCIP_STAGE_SOLVED
1264 * - \ref SCIP_STAGE_EXITSOLVE
1265 */
1266SCIP_EXPORT
1268 SCIP* scip, /**< SCIP data structure */
1269 FILE* file, /**< output file (or NULL for standard output) */
1270 SCIP_Bool printzeros /**< should variables set to zero be printed? */
1271 );
1272
1273/** try to round given solution
1274 *
1275 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1276 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1277 *
1278 * @pre This method can be called if SCIP is in one of the following stages:
1279 * - \ref SCIP_STAGE_SOLVING
1280 */
1281SCIP_EXPORT
1283 SCIP* scip, /**< SCIP data structure */
1284 SCIP_SOL* sol, /**< primal solution */
1285 SCIP_Bool* success /**< pointer to store whether rounding was successful */
1286 );
1287
1288/** copy the fp values to the exact arrays of the solution */
1289SCIP_EXPORT
1291 SCIP* scip, /**< SCIP data structure */
1292 SCIP_SOL* sol /**< primal solution */
1293 );
1294
1295/** retransforms solution to original problem space
1296 *
1297 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1298 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1299 *
1300 * @pre This method can be called if SCIP is in one of the following stages:
1301 * - \ref SCIP_STAGE_PROBLEM
1302 * - \ref SCIP_STAGE_TRANSFORMING
1303 * - \ref SCIP_STAGE_TRANSFORMED
1304 * - \ref SCIP_STAGE_INITPRESOLVE
1305 * - \ref SCIP_STAGE_PRESOLVING
1306 * - \ref SCIP_STAGE_EXITPRESOLVE
1307 * - \ref SCIP_STAGE_PRESOLVED
1308 * - \ref SCIP_STAGE_INITSOLVE
1309 * - \ref SCIP_STAGE_SOLVING
1310 * - \ref SCIP_STAGE_SOLVED
1311 * - \ref SCIP_STAGE_EXITSOLVE
1312 * - \ref SCIP_STAGE_FREETRANS
1313 */
1314SCIP_EXPORT
1316 SCIP* scip, /**< SCIP data structure */
1317 SCIP_SOL* sol /**< primal CIP solution */
1318 );
1319
1320/** retransforms exact solution to original problem space
1321 *
1322 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1323 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1324 *
1325 * @pre This method can be called if SCIP is in one of the following stages:
1326 * - \ref SCIP_STAGE_PROBLEM
1327 * - \ref SCIP_STAGE_TRANSFORMING
1328 * - \ref SCIP_STAGE_TRANSFORMED
1329 * - \ref SCIP_STAGE_INITPRESOLVE
1330 * - \ref SCIP_STAGE_PRESOLVING
1331 * - \ref SCIP_STAGE_EXITPRESOLVE
1332 * - \ref SCIP_STAGE_PRESOLVED
1333 * - \ref SCIP_STAGE_INITSOLVE
1334 * - \ref SCIP_STAGE_SOLVING
1335 * - \ref SCIP_STAGE_SOLVED
1336 * - \ref SCIP_STAGE_EXITSOLVE
1337 * - \ref SCIP_STAGE_FREETRANS
1338 */
1339SCIP_EXPORT
1341 SCIP* scip, /**< SCIP data structure */
1342 SCIP_SOL* sol /**< primal CIP solution */
1343 );
1344
1345/** reads a given solution file
1346 *
1347 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1348 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1349 *
1350 * @pre This method can be called if SCIP is in one of the following stages:
1351 * - \ref SCIP_STAGE_PROBLEM
1352 * - \ref SCIP_STAGE_TRANSFORMED
1353 * - \ref SCIP_STAGE_INITPRESOLVE
1354 * - \ref SCIP_STAGE_PRESOLVING
1355 * - \ref SCIP_STAGE_EXITPRESOLVE
1356 * - \ref SCIP_STAGE_PRESOLVED
1357 * - \ref SCIP_STAGE_INITSOLVE
1358 * - \ref SCIP_STAGE_SOLVING
1359 */
1360SCIP_EXPORT
1362 SCIP* scip, /**< SCIP data structure */
1363 const char* filename /**< name of the input file */
1364 );
1365
1366/** reads a given solution file and store the solution values in the given solution pointer
1367 *
1368 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1369 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1370 *
1371 * @pre This method can be called if SCIP is in one of the following stages:
1372 * - \ref SCIP_STAGE_PROBLEM
1373 * - \ref SCIP_STAGE_TRANSFORMED
1374 * - \ref SCIP_STAGE_INITPRESOLVE
1375 * - \ref SCIP_STAGE_PRESOLVING
1376 * - \ref SCIP_STAGE_EXITPRESOLVE
1377 * - \ref SCIP_STAGE_PRESOLVED
1378 * - \ref SCIP_STAGE_INITSOLVE
1379 * - \ref SCIP_STAGE_SOLVING
1380 */
1381SCIP_EXPORT
1383 SCIP* scip, /**< SCIP data structure */
1384 const char* filename, /**< name of the input file */
1385 SCIP_SOL* sol, /**< solution pointer */
1386 SCIP_Bool xml, /**< true, iff the given solution in written in XML */
1387 SCIP_Bool* partial, /**< pointer to store if the solution is partial */
1388 SCIP_Bool* error /**< pointer store if an error occured */
1389 );
1390
1391/** adds feasible primal solution to solution storage by copying it
1392 *
1393 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1394 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1395 *
1396 * @pre This method can be called if SCIP is in one of the following stages:
1397 * - \ref SCIP_STAGE_PROBLEM
1398 * - \ref SCIP_STAGE_TRANSFORMED
1399 * - \ref SCIP_STAGE_INITPRESOLVE
1400 * - \ref SCIP_STAGE_PRESOLVING
1401 * - \ref SCIP_STAGE_EXITPRESOLVE
1402 * - \ref SCIP_STAGE_PRESOLVED
1403 * - \ref SCIP_STAGE_SOLVING
1404 * - \ref SCIP_STAGE_FREETRANS
1405 *
1406 * @note Do not call during propagation, use heur_trysol instead.
1407 */
1408SCIP_EXPORT
1410 SCIP* scip, /**< SCIP data structure */
1411 SCIP_SOL* sol, /**< primal CIP solution */
1412 SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
1413 );
1414
1415/** adds primal solution to solution storage, frees the solution afterwards
1416 *
1417 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1418 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1419 *
1420 * @pre This method can be called if SCIP is in one of the following stages:
1421 * - \ref SCIP_STAGE_PROBLEM
1422 * - \ref SCIP_STAGE_TRANSFORMED
1423 * - \ref SCIP_STAGE_INITPRESOLVE
1424 * - \ref SCIP_STAGE_PRESOLVING
1425 * - \ref SCIP_STAGE_EXITPRESOLVE
1426 * - \ref SCIP_STAGE_PRESOLVED
1427 * - \ref SCIP_STAGE_SOLVING
1428 * - \ref SCIP_STAGE_FREETRANS
1429 *
1430 * @note Do not call during propagation, use heur_trysol instead.
1431 */
1432SCIP_EXPORT
1434 SCIP* scip, /**< SCIP data structure */
1435 SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
1436 SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
1437 );
1438
1439/** adds current LP/pseudo solution to solution storage
1440 *
1441 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1442 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1443 *
1444 * @pre This method can be called if SCIP is in one of the following stages:
1445 * - \ref SCIP_STAGE_PRESOLVED
1446 * - \ref SCIP_STAGE_SOLVING
1447 */
1448SCIP_EXPORT
1450 SCIP* scip, /**< SCIP data structure */
1451 SCIP_HEUR* heur, /**< heuristic that found the solution */
1452 SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
1453 );
1454
1455/** checks solution for feasibility; if possible, adds it to storage by copying
1456 *
1457 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1458 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1459 *
1460 * @pre This method can be called if SCIP is in one of the following stages:
1461 * - \ref SCIP_STAGE_TRANSFORMED
1462 * - \ref SCIP_STAGE_INITPRESOLVE
1463 * - \ref SCIP_STAGE_PRESOLVING
1464 * - \ref SCIP_STAGE_EXITPRESOLVE
1465 * - \ref SCIP_STAGE_PRESOLVED
1466 * - \ref SCIP_STAGE_SOLVING
1467 *
1468 * @note Do not call during propagation, use heur_trysol instead.
1469 */
1470SCIP_EXPORT
1472 SCIP* scip, /**< SCIP data structure */
1473 SCIP_SOL* sol, /**< primal CIP solution */
1474 SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
1475 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */
1476 SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
1477 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
1478 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
1479 SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
1480 );
1481
1482/** checks primal solution; if feasible, adds it to storage; solution is freed afterwards
1483 *
1484 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1485 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1486 *
1487 * @pre This method can be called if SCIP is in one of the following stages:
1488 * - \ref SCIP_STAGE_TRANSFORMED
1489 * - \ref SCIP_STAGE_INITPRESOLVE
1490 * - \ref SCIP_STAGE_PRESOLVING
1491 * - \ref SCIP_STAGE_EXITPRESOLVE
1492 * - \ref SCIP_STAGE_PRESOLVED
1493 * - \ref SCIP_STAGE_SOLVING
1494 *
1495 * @note Do not call during propagation, use heur_trysol instead.
1496 */
1497SCIP_EXPORT
1499 SCIP* scip, /**< SCIP data structure */
1500 SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
1501 SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
1502 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */
1503 SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
1504 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
1505 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
1506 SCIP_Bool* stored /**< stores whether solution was feasible and good enough to keep */
1507 );
1508
1509/** checks current LP/pseudo solution for feasibility; if possible, adds it to storage
1510 *
1511 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1512 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1513 *
1514 * @pre This method can be called if SCIP is in one of the following stages:
1515 * - \ref SCIP_STAGE_PRESOLVED
1516 * - \ref SCIP_STAGE_SOLVING
1517 */
1518SCIP_EXPORT
1520 SCIP* scip, /**< SCIP data structure */
1521 SCIP_HEUR* heur, /**< heuristic that found the solution */
1522 SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
1523 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */
1524 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
1525 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
1526 SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
1527 );
1528
1529/** returns all partial solutions
1530 *
1531 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1532 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1533 *
1534 * @pre This method can be called if SCIP is in one of the following stages:
1535 * - \ref SCIP_STAGE_PROBLEM
1536 * - \ref SCIP_STAGE_PRESOLVING
1537 * - \ref SCIP_STAGE_SOLVING
1538 * - \ref SCIP_STAGE_SOLVED
1539 */
1540SCIP_EXPORT
1542 SCIP* scip /**< SCIP data structure */
1543 );
1544
1545/** returns number of partial solutions
1546 *
1547 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1548 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1549 *
1550 * @pre This method can be called if SCIP is in one of the following stages:
1551 * - \ref SCIP_STAGE_PROBLEM
1552 * - \ref SCIP_STAGE_PRESOLVING
1553 * - \ref SCIP_STAGE_SOLVING
1554 * - \ref SCIP_STAGE_SOLVED
1555 */
1557 SCIP* scip /**< SCIP data structure */
1558 );
1559
1560/** checks solution for feasibility without adding it to the solution store
1561 *
1562 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1563 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1564 *
1565 * @pre This method can be called if SCIP is in one of the following stages:
1566 * - \ref SCIP_STAGE_PROBLEM
1567 * - \ref SCIP_STAGE_TRANSFORMED
1568 * - \ref SCIP_STAGE_INITPRESOLVE
1569 * - \ref SCIP_STAGE_PRESOLVING
1570 * - \ref SCIP_STAGE_EXITPRESOLVE
1571 * - \ref SCIP_STAGE_PRESOLVED
1572 * - \ref SCIP_STAGE_INITSOLVE
1573 * - \ref SCIP_STAGE_SOLVING
1574 * - \ref SCIP_STAGE_SOLVED
1575 */
1576SCIP_EXPORT
1578 SCIP* scip, /**< SCIP data structure */
1579 SCIP_SOL* sol, /**< primal CIP solution */
1580 SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
1581 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */
1582 SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
1583 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
1584 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
1585 SCIP_Bool* feasible /**< stores whether given solution is feasible */
1586 );
1587
1588/** checks solution for feasibility in original problem without adding it to the solution store;
1589 * this method is used to double check a solution in order to validate the presolving process
1590 *
1591 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1592 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1593 *
1594 * @pre This method can be called if SCIP is in one of the following stages:
1595 * - \ref SCIP_STAGE_PROBLEM
1596 * - \ref SCIP_STAGE_TRANSFORMED
1597 * - \ref SCIP_STAGE_INITPRESOLVE
1598 * - \ref SCIP_STAGE_PRESOLVING
1599 * - \ref SCIP_STAGE_EXITPRESOLVE
1600 * - \ref SCIP_STAGE_PRESOLVED
1601 * - \ref SCIP_STAGE_INITSOLVE
1602 * - \ref SCIP_STAGE_SOLVING
1603 * - \ref SCIP_STAGE_SOLVED
1604 */
1605SCIP_EXPORT
1607 SCIP* scip, /**< SCIP data structure */
1608 SCIP_SOL* sol, /**< primal CIP solution */
1609 SCIP_Bool* feasible, /**< stores whether given solution is feasible */
1610 SCIP_Bool printreason, /**< should the reason for the violation be printed? */
1611 SCIP_Bool completely /**< Should all violations be checked if printreason is true? */
1612 );
1613
1614/** update integrality violation of a solution */
1615SCIP_EXPORT
1617 SCIP* scip, /**< SCIP data structure */
1618 SCIP_SOL* sol, /**< primal CIP solution */
1619 SCIP_Real absviol /**< absolute violation */
1620 );
1621
1622/** update bound violation of a solution */
1623SCIP_EXPORT
1625 SCIP* scip, /**< SCIP data structure */
1626 SCIP_SOL* sol, /**< primal CIP solution */
1627 SCIP_Real absviol, /**< absolute violation */
1628 SCIP_Real relviol /**< relative violation */
1629 );
1630
1631/** update LP row violation of a solution */
1632SCIP_EXPORT
1634 SCIP* scip, /**< SCIP data structure */
1635 SCIP_SOL* sol, /**< primal CIP solution */
1636 SCIP_Real absviol, /**< absolute violation */
1637 SCIP_Real relviol /**< relative violation */
1638 );
1639
1640/** update constraint violation of a solution */
1641SCIP_EXPORT
1643 SCIP* scip, /**< SCIP data structure */
1644 SCIP_SOL* sol, /**< primal CIP solution */
1645 SCIP_Real absviol, /**< absolute violation */
1646 SCIP_Real relviol /**< relative violation */
1647 );
1648
1649/** update LP row and constraint violations of a solution */
1650SCIP_EXPORT
1652 SCIP* scip, /**< SCIP data structure */
1653 SCIP_SOL* sol, /**< primal CIP solution */
1654 SCIP_Real absviol, /**< absolute violation */
1655 SCIP_Real relviol /**< relative violation */
1656 );
1657
1658/** allow violation updates */
1659SCIP_EXPORT
1661 SCIP* scip /**< SCIP data structure */
1662 );
1663
1664/** disallow violation updates */
1665SCIP_EXPORT
1667 SCIP* scip /**< SCIP data structure */
1668 );
1669
1670/** return whether a primal ray is stored that proves unboundedness of the LP relaxation
1671 *
1672 * @return return whether a primal ray is stored that proves unboundedness of the LP relaxation
1673 *
1674 * @pre This method can be called if SCIP is in one of the following stages:
1675 * - \ref SCIP_STAGE_SOLVING
1676 * - \ref SCIP_STAGE_SOLVED
1677 */
1678SCIP_EXPORT
1680 SCIP* scip /**< SCIP data structure */
1681 );
1682
1683/** gets value of given variable in primal ray causing unboundedness of the LP relaxation;
1684 * should only be called if such a ray is stored (check with SCIPhasPrimalRay())
1685 *
1686 * @return value of given variable in primal ray causing unboundedness of the LP relaxation
1687 *
1688 * @pre This method can be called if SCIP is in one of the following stages:
1689 * - \ref SCIP_STAGE_SOLVING
1690 * - \ref SCIP_STAGE_SOLVED
1691 */
1692SCIP_EXPORT
1694 SCIP* scip, /**< SCIP data structure */
1695 SCIP_VAR* var /**< variable to get value for */
1696 );
1697
1698/** updates the primal ray thats proves unboundedness
1699 *
1700 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1701 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1702 *
1703 * @pre This method can be called if @p scip is in one of the following stages:
1704 * - \ref SCIP_STAGE_PRESOLVING
1705 * - \ref SCIP_STAGE_PRESOLVED
1706 * - \ref SCIP_STAGE_SOLVING
1707 * - \ref SCIP_STAGE_SOLVED
1708 *
1709 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1710 */
1711SCIP_EXPORT
1713 SCIP* scip, /**< SCIP data structure */
1714 SCIP_SOL* primalray /**< the new primal ray */
1715 );
1716
1717/** overwrite the fp-values in a solution with the rounded exact ones */
1718SCIP_EXPORT
1720 SCIP* scip, /**< SCIP data structure */
1721 SCIP_SOL* sol /**< primal CIP solution */
1722 );
1723
1724/** checks exact primal solution; if feasible, adds it to storage; solution is freed afterwards
1725 *
1726 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1727 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1728 *
1729 * @pre This method can be called if SCIP is in one of the following stages:
1730 * - \ref SCIP_STAGE_TRANSFORMED
1731 * - \ref SCIP_STAGE_INITPRESOLVE
1732 * - \ref SCIP_STAGE_PRESOLVING
1733 * - \ref SCIP_STAGE_EXITPRESOLVE
1734 * - \ref SCIP_STAGE_PRESOLVED
1735 * - \ref SCIP_STAGE_SOLVING
1736 *
1737 * @note Do not call during propagation, use heur_trysol instead.
1738 */
1740 SCIP* scip, /**< SCIP data structure */
1741 SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
1742 SCIP_Bool printreason, /**< Should all reasons of violations be printed */
1743 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */
1744 SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
1745 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
1746 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
1747 SCIP_Bool* stored /**< stores whether solution was feasible and good enough to keep */
1748 );
1749
1750/**@} */
1751
1752#ifdef __cplusplus
1753}
1754#endif
1755
1756#endif
common defines and data types used in all packages of SCIP
#define SCIP_Longint
Definition def.h:148
#define SCIP_Bool
Definition def.h:98
#define SCIP_Real
Definition def.h:163
SCIP_RETCODE SCIPcheckSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely)
Definition scip_sol.c:4387
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition scip_sol.c:2988
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:516
SCIP_RETCODE SCIPlinkPseudoSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1418
int SCIPgetSolRunnum(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:2193
SCIP_RETCODE SCIPreadSolFile(SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool xml, SCIP_Bool *partial, SCIP_Bool *error)
Definition scip_sol.c:3809
SCIP_RETCODE SCIPcreateUnknownSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:799
SCIP_RETCODE SCIPprintTransSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:2525
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition scip_sol.c:884
void SCIPupdateSolIntegralityViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol)
Definition scip_sol.c:406
SCIP_RETCODE SCIPprintBestSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:3054
SCIP_SOL ** SCIPgetPartialSols(SCIP *scip)
Definition scip_sol.c:4270
void SCIPupdateSolLPRowViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition scip_sol.c:437
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
Definition scip_sol.c:1252
SCIP_HEUR * SCIPgetSolHeur(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:2253
void SCIPupdateSolBoundViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition scip_sol.c:421
SCIP_RETCODE SCIPaddSolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool *stored)
Definition scip_sol.c:3916
SCIP_RETCODE SCIPprintRay(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:2852
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:2353
SCIP_RETCODE SCIPtrySolFreeExact(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition scip_sol.c:4527
SCIP_RETCODE SCIPsetSolValExact(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_RATIONAL *val)
Definition scip_sol.c:1616
SCIP_RETCODE SCIPcreateCurrentSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:749
SCIP_RETCODE SCIPgetDualSolVal(SCIP *scip, SCIP_CONS *cons, SCIP_Real *dualsolval, SCIP_Bool *boundconstraint)
Definition scip_sol.c:2627
void SCIPgetSolValExact(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_RATIONAL *res)
Definition scip_sol.c:1803
SCIP_Bool SCIPareSolsEqual(SCIP *scip, SCIP_SOL *sol1, SCIP_SOL *sol2)
Definition scip_sol.c:2284
SCIP_RETCODE SCIPclearSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1475
SCIP_RETCODE SCIPcreateNLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:664
SCIP_Real SCIPtransformObj(SCIP *scip, SCIP_Real obj)
Definition scip_sol.c:2111
SCIP_RETCODE SCIPoverwriteFPsol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:4496
int SCIPgetNPartialSols(SCIP *scip)
Definition scip_sol.c:4292
int SCIPgetNSols(SCIP *scip)
Definition scip_sol.c:2889
SCIP_RETCODE SCIPcreateLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:608
SCIP_RETCODE SCIPlinkCurrentSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1441
SCIP_RETCODE SCIPcreateFiniteSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol, SCIP_Bool *success)
Definition scip_sol.c:1116
SCIP_RETCODE SCIPprintBestTransSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:3094
SCIP_RETCODE SCIPadjustImplicitSolVals(SCIP *scip, SCIP_SOL *sol, SCIP_Bool uselprows)
Definition scip_sol.c:2309
SCIP_RETCODE SCIPaddCurrentSol(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool *stored)
Definition scip_sol.c:3979
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:831
SCIP_RETCODE SCIPlinkLPSolExact(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1324
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1506
SCIP_RETCODE SCIPcreateRelaxSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:699
SCIP_RETCODE SCIPprintMIPStart(SCIP *scip, SCIP_SOL *sol, FILE *file)
Definition scip_sol.c:2584
SCIP_RETCODE SCIPreadSol(SCIP *scip, const char *filename)
Definition scip_sol.c:3313
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition scip_sol.c:1846
SCIP_RETCODE SCIPrecomputeSolObj(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:2077
SCIP_RETCODE SCIPaddSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *stored)
Definition scip_sol.c:3849
SCIP_RETCODE SCIPincSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real incval)
Definition scip_sol.c:1719
SCIP_RETCODE SCIPcreateSolCopyOrig(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition scip_sol.c:924
SCIP_RETCODE SCIPlinkNLPSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1353
SCIP_RETCODE SCIProundSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *success)
Definition scip_sol.c:3130
SCIP_RETCODE SCIPcreatePartialSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:771
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:2223
SCIP_Real SCIPgetPrimalRayVal(SCIP *scip, SCIP_VAR *var)
Definition scip_sol.c:4452
void SCIPgetSolTransObjExact(SCIP *scip, SCIP_SOL *sol, SCIP_RATIONAL *res)
Definition scip_sol.c:2042
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition scip_sol.c:1662
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition scip_sol.c:453
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition scip_sol.c:2938
SCIP_Bool SCIPhasPrimalRay(SCIP *scip)
Definition scip_sol.c:4434
SCIP_RETCODE SCIPlinkRelaxSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1388
SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition scip_sol.c:4019
SCIP_RETCODE SCIPcheckSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
Definition scip_sol.c:4319
SCIP_Bool SCIPisDualSolAvailable(SCIP *scip, SCIP_Bool printreason)
Definition scip_sol.c:2756
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition scip_sol.c:4116
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1295
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1892
SCIP_RETCODE SCIPretransformSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:3189
SCIP_Real SCIPgetSolTime(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:2163
SCIP_RETCODE SCIPcreateLPSolExact(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:636
void SCIPdeactivateSolViolationUpdates(SCIP *scip)
Definition scip_sol.c:493
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
Definition scip_sol.c:1571
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition scip_sol.c:1765
void SCIPactivateSolViolationUpdates(SCIP *scip)
Definition scip_sol.c:485
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:2005
void SCIPupdateSolLPConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition scip_sol.c:469
SCIP_RETCODE SCIPupdatePrimalRay(SCIP *scip, SCIP_SOL *primalray)
Definition scip_sol.c:4480
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
Definition scip_sol.c:2136
SCIP_RETCODE SCIPprintSolExact(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:2428
SCIP_RETCODE SCIPcreateSolExact(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:566
SCIP_RETCODE SCIPcreatePseudoSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition scip_sol.c:726
SCIP_RETCODE SCIPmakeSolExact(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:3153
void SCIPgetSolOrigObjExact(SCIP *scip, SCIP_SOL *sol, SCIP_RATIONAL *res)
Definition scip_sol.c:1940
SCIP_RETCODE SCIPretransformSolExact(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:3252
SCIP_RETCODE SCIPprintDualSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:2819
SCIP_RETCODE SCIPtryCurrentSol(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition scip_sol.c:4214
SCIP_RETCODE SCIPunlinkSolExact(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:1537
static SCIP_SOL * sol
SCIP_Real obj
int nvars
SCIP_VAR * var
static SCIP_VAR ** vars
type definitions for constraints and constraint handlers
struct SCIP_Cons SCIP_CONS
Definition type_cons.h:63
type definitions for primal heuristics
struct SCIP_Heur SCIP_HEUR
Definition type_heur.h:76
type definitions for rational numbers
struct SCIP_Rational SCIP_RATIONAL
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
type definitions for SCIP's main datastructure
struct Scip SCIP
Definition type_scip.h:39
type definitions for storing primal CIP solutions
struct SCIP_Sol SCIP_SOL
Definition type_sol.h:57
type definitions for problem variables
struct SCIP_Var SCIP_VAR
Definition type_var.h:166