Scippy

SCIP

Solving Constraint Integer Programs

pub_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 pub_sol.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for primal CIP solutions
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_PUB_SOL_H__
26 #define __SCIP_PUB_SOL_H__
27 
28 
29 #include "scip/def.h"
30 #include "scip/type_sol.h"
31 #include "scip/type_heur.h"
32 
33 #ifdef NDEBUG
34 #include "scip/struct_sol.h"
35 #endif
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /**@addtogroup PublicSolutionMethods
42  *
43  * @{
44  */
45 
46 
47 /** gets origin of solution */
48 extern
50  SCIP_SOL* sol /**< primal CIP solution */
51  );
52 
53 /** returns whether the given solution is defined on original variables */
54 extern
56  SCIP_SOL* sol /**< primal CIP solution */
57  );
58 
59 /** returns whether the given solution is partial */
60 extern
62  SCIP_SOL* sol /**< primal CIP solution */
63  );
64 
65 /** gets objective value of primal CIP solution which lives in the original problem space */
66 extern
68  SCIP_SOL* sol /**< primal CIP solution */
69  );
70 
71 /** gets clock time, when this solution was found */
72 extern
74  SCIP_SOL* sol /**< primal CIP solution */
75  );
76 
77 /** gets branch and bound run number, where this solution was found */
78 extern
80  SCIP_SOL* sol /**< primal CIP solution */
81  );
82 
83 /** gets node number of the specific branch and bound run, where this solution was found */
84 extern
86  SCIP_SOL* sol /**< primal CIP solution */
87  );
88 
89 /** gets node's depth, where this solution was found */
90 extern
91 int SCIPsolGetDepth(
92  SCIP_SOL* sol /**< primal CIP solution */
93  );
94 
95 /** gets heuristic, that found this solution (or NULL if it's from the tree) */
96 extern
98  SCIP_SOL* sol /**< primal CIP solution */
99  );
100 
101 /** informs the solution that it now belongs to the given primal heuristic */
102 extern
103 void SCIPsolSetHeur(
104  SCIP_SOL* sol, /**< primal CIP solution */
105  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
106  );
107 
108 /** returns unique index of given solution */
109 extern
110 int SCIPsolGetIndex(
111  SCIP_SOL* sol /**< primal CIP solution */
112  );
113 
114 /** get maximum absolute bound violation of solution */
115 extern
117  SCIP_SOL* sol /**< primal CIP solution */
118  );
119 
120 /** get maximum relative bound violation of solution */
121 extern
123  SCIP_SOL* sol /**< primal CIP solution */
124  );
125 
126 /** get maximum absolute integrality violation of solution */
127 extern
129  SCIP_SOL* sol /**< primal CIP solution */
130  );
131 
132 /** get maximum absolute LP row violation of solution */
133 extern
135  SCIP_SOL* sol /**< primal CIP solution */
136  );
137 
138 /** get maximum relative LP row violation of solution */
139 extern
141  SCIP_SOL* sol /**< primal CIP solution */
142  );
143 
144 /** get maximum absolute constraint violation of solution */
145 extern
147  SCIP_SOL* sol /**< primal CIP solution */
148  );
149 
150 /** get maximum relative constraint violation of solution */
151 extern
153  SCIP_SOL* sol /**< primal CIP solution */
154  );
155 
156 #ifdef NDEBUG
157 
158 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
159  * speed up the algorithms.
160  */
161 
162 #define SCIPsolGetOrigin(sol) ((sol)->solorigin)
163 #define SCIPsolIsOriginal(sol) ((sol)->solorigin == SCIP_SOLORIGIN_ORIGINAL || (sol)->solorigin == SCIP_SOLORIGIN_PARTIAL)
164 #define SCIPsolGetOrigObj(sol) (sol)->obj
165 #define SCIPsolGetTime(sol) (sol)->time
166 #define SCIPsolGetNodenum(sol) (sol)->nodenum
167 #define SCIPsolGetRunnum(sol) (sol)->runnum
168 #define SCIPsolGetDepth(sol) (sol)->depth
169 #define SCIPsolGetHeur(sol) (sol)->heur
170 #define SCIPsolGetIndex(sol) (sol)->index
171 #define SCIPsolSetHeur(sol,newheur) ((sol)->heur = (newheur))
172 #endif
173 
174 /* @} */
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2470
SCIP_Real SCIPsolGetRelBoundViolation(SCIP_SOL *sol)
Definition: sol.c:2376
SCIP_Real SCIPsolGetTime(SCIP_SOL *sol)
Definition: sol.c:2513
SCIP_Real SCIPsolGetAbsConsViolation(SCIP_SOL *sol)
Definition: sol.c:2416
SCIP_Real SCIPsolGetOrigObj(SCIP_SOL *sol)
Definition: sol.c:2490
SCIP_Real SCIPsolGetRelConsViolation(SCIP_SOL *sol)
Definition: sol.c:2426
SCIP_Real SCIPsolGetAbsIntegralityViolation(SCIP_SOL *sol)
Definition: sol.c:2386
type definitions for primal heuristics
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2553
datastructures for storing primal CIP solutions
#define SCIP_Bool
Definition: def.h:62
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
Definition: sol.c:2533
SCIP_Real SCIPsolGetAbsBoundViolation(SCIP_SOL *sol)
Definition: sol.c:2366
void SCIPsolSetHeur(SCIP_SOL *sol, SCIP_HEUR *heur)
Definition: sol.c:2594
type definitions for storing primal CIP solutions
SCIP_Real SCIPsolGetRelLPRowViolation(SCIP_SOL *sol)
Definition: sol.c:2406
SCIP_SOLORIGIN SCIPsolGetOrigin(SCIP_SOL *sol)
Definition: sol.c:2460
#define SCIP_Real
Definition: def.h:150
enum SCIP_SolOrigin SCIP_SOLORIGIN
Definition: type_sol.h:46
int SCIPsolGetDepth(SCIP_SOL *sol)
Definition: sol.c:2543
#define SCIP_Longint
Definition: def.h:135
SCIP_Bool SCIPsolIsPartial(SCIP_SOL *sol)
Definition: sol.c:2480
common defines and data types used in all packages of SCIP
int SCIPsolGetRunnum(SCIP_SOL *sol)
Definition: sol.c:2523
int SCIPsolGetIndex(SCIP_SOL *sol)
Definition: sol.c:2584
SCIP_Real SCIPsolGetAbsLPRowViolation(SCIP_SOL *sol)
Definition: sol.c:2396