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-2017 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 email to 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 
115 #ifdef NDEBUG
116 
117 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
118  * speed up the algorithms.
119  */
120 
121 #define SCIPsolGetOrigin(sol) ((sol)->solorigin)
122 #define SCIPsolIsOriginal(sol) ((sol)->solorigin == SCIP_SOLORIGIN_ORIGINAL || (sol)->solorigin == SCIP_SOLORIGIN_PARTIAL)
123 #define SCIPsolGetOrigObj(sol) (sol)->obj
124 #define SCIPsolGetTime(sol) (sol)->time
125 #define SCIPsolGetNodenum(sol) (sol)->nodenum
126 #define SCIPsolGetRunnum(sol) (sol)->runnum
127 #define SCIPsolGetDepth(sol) (sol)->depth
128 #define SCIPsolGetHeur(sol) (sol)->heur
129 #define SCIPsolGetIndex(sol) (sol)->index
130 #define SCIPsolSetHeur(sol,newheur) ((sol)->heur = (newheur))
131 #endif
132 
133 /* @} */
134 
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 #endif
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2299
SCIP_Real SCIPsolGetTime(SCIP_SOL *sol)
Definition: sol.c:2342
SCIP_Real SCIPsolGetOrigObj(SCIP_SOL *sol)
Definition: sol.c:2319
type definitions for primal heuristics
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2382
datastructures for storing primal CIP solutions
#define SCIP_Bool
Definition: def.h:61
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
Definition: sol.c:2362
void SCIPsolSetHeur(SCIP_SOL *sol, SCIP_HEUR *heur)
Definition: sol.c:2423
type definitions for storing primal CIP solutions
SCIP_SOLORIGIN SCIPsolGetOrigin(SCIP_SOL *sol)
Definition: sol.c:2289
#define SCIP_Real
Definition: def.h:135
enum SCIP_SolOrigin SCIP_SOLORIGIN
Definition: type_sol.h:46
int SCIPsolGetDepth(SCIP_SOL *sol)
Definition: sol.c:2372
#define SCIP_Longint
Definition: def.h:120
SCIP_Bool SCIPsolIsPartial(SCIP_SOL *sol)
Definition: sol.c:2309
common defines and data types used in all packages of SCIP
int SCIPsolGetRunnum(SCIP_SOL *sol)
Definition: sol.c:2352
int SCIPsolGetIndex(SCIP_SOL *sol)
Definition: sol.c:2413