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-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 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/scip.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /** creates the handler for countsol constraints and includes it in SCIP
36  *
37  * @ingroup ConshdlrIncludes
38  * */
39 extern
41  SCIP* scip /**< SCIP data structure */
42  );
43 
44 /**@addtogroup CONSHDLRS
45  *
46  * @{
47  *
48  * @name Constraint Handler for counting solutions
49  *
50  * @{
51  *
52  * If this constraint handler is activated than it counts or collects all feasible solutions. We refer to \ref COUNTER for
53  * more details about using SCIP for counting feasible solutions.
54  */
55 
56 /** dialog execution method for the count command */
57 extern
58 SCIP_DECL_DIALOGEXEC(SCIPdialogExecCountPresolve);
59 
60 /** dialog execution method for the count command */
61 extern
62 SCIP_DECL_DIALOGEXEC(SCIPdialogExecCount);
63 
64 /** execution method of dialog for writing all solutions */
65 extern
66 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteAllsolutions);
67 
68 /** execute counting */
69 extern
71  SCIP* scip /**< SCIP data structure */
72  );
73 
74 #if 0
75 /* returns TRUE if the counting process was correct; otherwise FALSE */
76 extern
77 SCIP_Bool SCIPisCountValid(
78  SCIP* scip /**< SCIP data structure */
79  );
80 #endif
81 
82 /** returns number of feasible solutions found as SCIP_Longint; if the number does not fit into
83  * a SCIP_Longint the valid flag is set to FALSE
84  */
85 extern
87  SCIP* scip, /**< SCIP data structure */
88  SCIP_Bool* valid /**< pointer to store if the return value is valid */
89  );
90 
91 /** returns number of counted solutions as string */
92 extern
94  SCIP* scip, /**< SCIP data structure */
95  char** buffer, /**< buffer to store the number for counted solutions */
96  int buffersize, /**< buffer size */
97  int* requiredsize /**< pointer to store the required size */
98  );
99 
100 /** returns number of counted feasible subtrees */
101 extern
103  SCIP* scip /**< SCIP data structure */
104  );
105 
106 /** Method to get the sparse solution.
107  *
108  * @note You get the pointer to the sparse solutions stored in the constraint handler (not a copy).
109  *
110  * @note The sparse solutions are stored w.r.t. the active variables. This are the variables which got not removed
111  * during presolving. For none active variables the value has to be computed depending on their aggregation
112  * type. See for more details about that \ref COLLECTALLFEASEBLES.
113  */
114 extern
116  SCIP* scip, /**< SCIP data structure */
117  SCIP_VAR*** vars, /**< pointer to variable array defining to variable order */
118  int* nvars, /**< number of variables */
119  SCIP_SPARSESOL*** sols, /**< pointer to the solutions */
120  int* nsols /**< pointer to number of solutions */
121  );
122 
123 /** setting SCIP parameters for such that a valid counting process is possible */
124 extern
126  SCIP* scip /**< SCIP data structure */
127  );
128 
129 /* @} */
130 
131 /* @} */
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 #endif
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
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)
SCIP_RETCODE SCIPincludeConshdlrCountsols(SCIP *scip)
#define SCIP_Bool
Definition: def.h:61
SCIP_Longint SCIPgetNCountedFeasSubtrees(SCIP *scip)
#define SCIP_Longint
Definition: def.h:130
SCIP callable library.
SCIP_RETCODE SCIPsetParamsCountsols(SCIP *scip)