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-2020 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 scipopt.org. */
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  * */
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 */
63 SCIP_DECL_DIALOGEXEC(SCIPdialogExecCountPresolve);
64 
65 /** dialog execution method for the count command */
67 SCIP_DECL_DIALOGEXEC(SCIPdialogExecCount);
68 
69 /** execution method of dialog for writing all solutions */
71 SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteAllsolutions);
72 
73 /** execute counting */
76  SCIP* scip /**< SCIP data structure */
77  );
78 
79 /** returns number of feasible solutions found as SCIP_Longint; if the number does not fit into
80  * a SCIP_Longint the valid flag is set to FALSE
81  */
84  SCIP* scip, /**< SCIP data structure */
85  SCIP_Bool* valid /**< pointer to store if the return value is valid */
86  );
87 
88 /** returns number of counted solutions as string */
91  SCIP* scip, /**< SCIP data structure */
92  char** buffer, /**< buffer to store the number for counted solutions */
93  int buffersize, /**< buffer size */
94  int* requiredsize /**< pointer to store the required size */
95  );
96 
97 /** returns number of counted feasible subtrees */
100  SCIP* scip /**< SCIP data structure */
101  );
102 
103 /** Method to get the sparse solution.
104  *
105  * @note You get the pointer to the sparse solutions stored in the constraint handler (not a copy).
106  *
107  * @note The sparse solutions are stored w.r.t. the active variables. This are the variables which got not removed
108  * during presolving. For none active variables the value has to be computed depending on their aggregation
109  * type. See for more details about that \ref COLLECTALLFEASEBLES.
110  */
113  SCIP* scip, /**< SCIP data structure */
114  SCIP_VAR*** vars, /**< pointer to variable array defining to variable order */
115  int* nvars, /**< number of variables */
116  SCIP_SPARSESOL*** sols, /**< pointer to the solutions */
117  int* nsols /**< pointer to number of solutions */
118  );
119 
120 /** setting SCIP parameters for such that a valid counting process is possible */
123  SCIP* scip /**< SCIP data structure */
124  );
125 
126 /** @} */
127 
128 /** @} */
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif
type definitions for miscellaneous datastructures
#define SCIP_EXPORT
Definition: def.h:100
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_EXPORT SCIP_RETCODE SCIPincludeConshdlrCountsols(SCIP *scip)
type definitions for return codes for SCIP methods
SCIP_EXPORT SCIP_Longint SCIPgetNCountedFeasSubtrees(SCIP *scip)
type definitions for SCIP&#39;s main datastructure
SCIP_EXPORT SCIP_RETCODE SCIPsetParamsCountsols(SCIP *scip)
SCIP_EXPORT SCIP_DECL_DIALOGEXEC(SCIPdialogExecCountPresolve)
type definitions for problem variables
SCIP_EXPORT void SCIPgetCountedSparseSols(SCIP *scip, SCIP_VAR ***vars, int *nvars, SCIP_SPARSESOL ***sols, int *nsols)
SCIP_EXPORT SCIP_RETCODE SCIPcount(SCIP *scip)
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT void SCIPgetNCountedSolsstr(SCIP *scip, char **buffer, int buffersize, int *requiredsize)
type definitions for user interface dialog
#define SCIP_Longint
Definition: def.h:148
SCIP_EXPORT SCIP_Longint SCIPgetNCountedSols(SCIP *scip, SCIP_Bool *valid)
common defines and data types used in all packages of SCIP