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