Scippy

SCIP

Solving Constraint Integer Programs

cons_countsols.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 cons_countsols.h
17  * @ingroup CONSHDLRS
18  * @brief Constraint handler for counting feasible solutions
19  * @author Stefan Heinz
20  * @author Michael Winkler
21  *
22  */
23 
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
25 
26 #ifndef __SCIP_CONS_COUNTSOLS_H__
27 #define __SCIP_CONS_COUNTSOLS_H__
28 
29 #include "scip/def.h"
30 #include "scip/type_dialog.h"
31 #include "scip/type_misc.h"
32 #include "scip/type_retcode.h"
33 #include "scip/type_scip.h"
34 #include "scip/type_var.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /** creates the handler for countsol constraints and includes it in SCIP
41  *
42  * @ingroup ConshdlrIncludes
43  * */
44 extern
46  SCIP* scip /**< SCIP data structure */
47  );
48 
49 /**@addtogroup CONSHDLRS
50  *
51  * @{
52  *
53  * @name Constraint Handler for counting solutions
54  *
55  * @{
56  *
57  * If this constraint handler is activated than it counts or collects all feasible solutions. We refer to \ref COUNTER for
58  * more details about using SCIP for counting feasible solutions.
59  */
60 
61 /** dialog execution method for the count command */
62 extern
63 SCIP_DECL_DIALOGEXEC(SCIPdialogExecCountPresolve);
64 
65 /** dialog execution method for the count command */
66 extern
67 SCIP_DECL_DIALOGEXEC(SCIPdialogExecCount);
68 
69 /** execution method of dialog for writing all solutions */
70 extern
71 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteAllsolutions);
72 
73 /** execute counting */
74 extern
76  SCIP* scip /**< SCIP data structure */
77  );
78 
79 #if 0
80 /* returns TRUE if the counting process was correct; otherwise FALSE */
81 extern
82 SCIP_Bool SCIPisCountValid(
83  SCIP* scip /**< SCIP data structure */
84  );
85 #endif
86 
87 /** returns number of feasible solutions found as SCIP_Longint; if the number does not fit into
88  * a SCIP_Longint the valid flag is set to FALSE
89  */
90 extern
92  SCIP* scip, /**< SCIP data structure */
93  SCIP_Bool* valid /**< pointer to store if the return value is valid */
94  );
95 
96 /** returns number of counted solutions as string */
97 extern
99  SCIP* scip, /**< SCIP data structure */
100  char** buffer, /**< buffer to store the number for counted solutions */
101  int buffersize, /**< buffer size */
102  int* requiredsize /**< pointer to store the required size */
103  );
104 
105 /** returns number of counted feasible subtrees */
106 extern
108  SCIP* scip /**< SCIP data structure */
109  );
110 
111 /** Method to get the sparse solution.
112  *
113  * @note You get the pointer to the sparse solutions stored in the constraint handler (not a copy).
114  *
115  * @note The sparse solutions are stored w.r.t. the active variables. This are the variables which got not removed
116  * during presolving. For none active variables the value has to be computed depending on their aggregation
117  * type. See for more details about that \ref COLLECTALLFEASEBLES.
118  */
119 extern
121  SCIP* scip, /**< SCIP data structure */
122  SCIP_VAR*** vars, /**< pointer to variable array defining to variable order */
123  int* nvars, /**< number of variables */
124  SCIP_SPARSESOL*** sols, /**< pointer to the solutions */
125  int* nsols /**< pointer to number of solutions */
126  );
127 
128 /** setting SCIP parameters for such that a valid counting process is possible */
129 extern
131  SCIP* scip /**< SCIP data structure */
132  );
133 
134 /* @} */
135 
136 /* @} */
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif
type definitions for miscellaneous datastructures
SCIP_RETCODE SCIPcount(SCIP *scip)
void SCIPgetNCountedSolsstr(SCIP *scip, char **buffer, int buffersize, int *requiredsize)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for return codes for SCIP methods
SCIP_DECL_DIALOGEXEC(SCIPdialogExecCountPresolve)
void SCIPgetCountedSparseSols(SCIP *scip, SCIP_VAR ***vars, int *nvars, SCIP_SPARSESOL ***sols, int *nsols)
SCIP_Longint SCIPgetNCountedSols(SCIP *scip, SCIP_Bool *valid)
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
SCIP_RETCODE SCIPincludeConshdlrCountsols(SCIP *scip)
#define SCIP_Bool
Definition: def.h:62
SCIP_Longint SCIPgetNCountedFeasSubtrees(SCIP *scip)
type definitions for user interface dialog
#define SCIP_Longint
Definition: def.h:135
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPsetParamsCountsols(SCIP *scip)