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