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-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 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 /** primal CIP solution
40  *
41  * For reasons of efficiency, a working solution only stores values that have been accessed at least once,
42  * or that have been changed from the value in the solution's source.
43  * The user has to call SCIPsolUnlink() in order to retrieve all non-cached elements from the solution's source
44  * and to store the values in the solution's own array. This changes the solution's origin to SCIP_SOLORIGIN_ZERO.
45  * A linked solution with origin SCIP_SOLORIGIN_LPSOL or SCIP_SOLORIGIN_PSEUDOSOL becomes invalid after the
46  * next node is focused (i.e. the LP and pseudo solutions changed) and cannot be accessed anymore.
47  *
48  * Solutions with origin ORIGINAL contain the values for original variables. The stored objective value also
49  * corresponds to the original problem.
50  */
51 struct SCIP_Sol
52 {
53  SCIP_Real obj; /**< objective value of solution */
54  SCIP_Real time; /**< clock time, when the solution was discovered */
55  SCIP_Longint nodenum; /**< last node number of current run, where this solution was modified */
56 #ifndef NDEBUG
57  SCIP_Longint lpcount; /**< number of LPs solved when this solution was created, needed for debug checks
58  * concerning solutions linked to the LP solution
59  */
60 #endif
61  SCIP_REALARRAY* vals; /**< solution values for variables */
62  SCIP_BOOLARRAY* valid; /**< is value in vals array valid? otherwise it has to be retrieved from
63  * origin */
64  SCIP_HEUR* heur; /**< heuristic that found the solution (or NULL if it's an LP solution) */
65  int runnum; /**< branch and bound run number in which the solution was found */
66  int depth; /**< depth at which the solution was found */
67  int primalindex; /**< index of solution in array of existing solutions of primal data */
68  int index; /**< consecutively numbered unique index of all created solutions */
69  SCIP_SOLORIGIN solorigin; /**< origin of solution: where to retrieve uncached elements */
70  SCIP_Bool hasinfval; /**< does the solution (potentially) contain an infinite value? Note: this
71  * could also be implemented as a counter for the number of infinite
72  * values, to avoid redundant checks when resetting inf. solution values
73  */
74 };
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif
type definitions for miscellaneous datastructures
int depth
Definition: struct_sol.h:66
SCIP_Longint nodenum
Definition: struct_sol.h:55
SCIP_HEUR * heur
Definition: struct_sol.h:64
int runnum
Definition: struct_sol.h:65
type definitions for primal heuristics
SCIP_Longint lpcount
Definition: struct_sol.h:57
int primalindex
Definition: struct_sol.h:67
#define SCIP_Bool
Definition: def.h:61
type definitions for storing primal CIP solutions
SCIP_SOLORIGIN solorigin
Definition: struct_sol.h:69
SCIP_Real time
Definition: struct_sol.h:54
#define SCIP_Real
Definition: def.h:145
enum SCIP_SolOrigin SCIP_SOLORIGIN
Definition: type_sol.h:46
SCIP_REALARRAY * vals
Definition: struct_sol.h:61
#define SCIP_Longint
Definition: def.h:130
SCIP_BOOLARRAY * valid
Definition: struct_sol.h:62
common defines and data types used in all packages of SCIP
SCIP_Bool hasinfval
Definition: struct_sol.h:70
SCIP_Real obj
Definition: struct_sol.h:53
int index
Definition: struct_sol.h:68