Scippy

SCIP

Solving Constraint Integer Programs

struct_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-2018 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file struct_sol.h
17  * @ingroup INTERNALAPI
18  * @brief datastructures for storing primal CIP solutions
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 
25 #ifndef __SCIP_STRUCT_SOL_H__
26 #define __SCIP_STRUCT_SOL_H__
27 
28 
29 #include "scip/def.h"
30 #include "scip/type_misc.h"
31 #include "scip/type_sol.h"
32 #include "scip/type_heur.h"
33 
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /** maximum violations of problem constraints */
40 struct SCIP_Viol
41 {
42  SCIP_Real absviolbounds; /**< maximum absolute violation of variable bounds */
43  SCIP_Real relviolbounds; /**< maximum relative violation of variable bounds */
44  SCIP_Real absviollprows; /**< maximum absolute violation of LP rows */
45  SCIP_Real relviollprows; /**< maximum relative violation of LP rows */
46  SCIP_Real absviolintegrality; /**< maximum absolute violation integrality */
47  SCIP_Real absviolcons; /**< maximum absolute violation of constraints */
48  SCIP_Real relviolcons; /**< maximum relative violation of constraints */
49 };
50 
51 /** primal CIP solution
52  *
53  * For reasons of efficiency, a working solution only stores values that have been accessed at least once,
54  * or that have been changed from the value in the solution's source.
55  * The user has to call SCIPsolUnlink() in order to retrieve all non-cached elements from the solution's source
56  * and to store the values in the solution's own array. This changes the solution's origin to SCIP_SOLORIGIN_ZERO.
57  * A linked solution with origin SCIP_SOLORIGIN_LPSOL or SCIP_SOLORIGIN_PSEUDOSOL becomes invalid after the
58  * next node is focused (i.e. the LP and pseudo solutions changed) and cannot be accessed anymore.
59  *
60  * Solutions with origin ORIGINAL contain the values for original variables. The stored objective value also
61  * corresponds to the original problem.
62  */
63 struct SCIP_Sol
64 {
65  SCIP_Real obj; /**< objective value of solution */
66  SCIP_Real time; /**< clock time, when the solution was discovered */
67  SCIP_Longint nodenum; /**< last node number of current run, where this solution was modified */
68 #ifndef NDEBUG
69  SCIP_Longint lpcount; /**< number of LPs solved when this solution was created, needed for debug checks
70  * concerning solutions linked to the LP solution
71  */
72 #endif
73  SCIP_REALARRAY* vals; /**< solution values for variables */
74  SCIP_BOOLARRAY* valid; /**< is value in vals array valid? otherwise it has to be retrieved from
75  * origin */
76  SCIP_HEUR* heur; /**< heuristic that found the solution (or NULL if it's an LP solution) */
77  SCIP_VIOL viol; /**< maximum violations of problem constraints */
78  int runnum; /**< branch and bound run number in which the solution was found */
79  int depth; /**< depth at which the solution was found */
80  int primalindex; /**< index of solution in array of existing solutions of primal data */
81  int index; /**< consecutively numbered unique index of all created solutions */
82  SCIP_SOLORIGIN solorigin; /**< origin of solution: where to retrieve uncached elements */
83  SCIP_Bool hasinfval; /**< does the solution (potentially) contain an infinite value? Note: this
84  * could also be implemented as a counter for the number of infinite
85  * values, to avoid redundant checks when resetting inf. solution values
86  */
87 };
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif
type definitions for miscellaneous datastructures
SCIP_Real absviolbounds
Definition: struct_sol.h:42
int depth
Definition: struct_sol.h:79
SCIP_Longint nodenum
Definition: struct_sol.h:67
SCIP_HEUR * heur
Definition: struct_sol.h:76
SCIP_Real relviolcons
Definition: struct_sol.h:48
int runnum
Definition: struct_sol.h:78
type definitions for primal heuristics
SCIP_Real relviollprows
Definition: struct_sol.h:45
SCIP_Real absviollprows
Definition: struct_sol.h:44
SCIP_Longint lpcount
Definition: struct_sol.h:69
int primalindex
Definition: struct_sol.h:80
#define SCIP_Bool
Definition: def.h:62
SCIP_VIOL viol
Definition: struct_sol.h:77
type definitions for storing primal CIP solutions
SCIP_SOLORIGIN solorigin
Definition: struct_sol.h:82
SCIP_Real time
Definition: struct_sol.h:66
#define SCIP_Real
Definition: def.h:150
enum SCIP_SolOrigin SCIP_SOLORIGIN
Definition: type_sol.h:46
SCIP_REALARRAY * vals
Definition: struct_sol.h:73
#define SCIP_Longint
Definition: def.h:135
SCIP_Real relviolbounds
Definition: struct_sol.h:43
SCIP_BOOLARRAY * valid
Definition: struct_sol.h:74
SCIP_Real absviolintegrality
Definition: struct_sol.h:46
common defines and data types used in all packages of SCIP
SCIP_Real absviolcons
Definition: struct_sol.h:47
SCIP_Bool hasinfval
Definition: struct_sol.h:83
SCIP_Real obj
Definition: struct_sol.h:65
int index
Definition: struct_sol.h:81