Scippy

SCIP

Solving Constraint Integer Programs

cons_countsols.h File Reference

Detailed Description

Constraint handler for counting feasible solutions.

Author
Stefan Heinz
Michael Winkler

If this constraint handler is activated than it counts or collects all feasible solutions. We refer to How to use SCIP to count/enumerate feasible solutions for more details about using SCIP for counting feasible solutions.

Definition in file cons_countsols.h.

#include "scip/scip.h"

Go to the source code of this file.

Functions

 SCIP_DECL_DIALOGEXEC (SCIPdialogExecCountPresolve)
 
 SCIP_DECL_DIALOGEXEC (SCIPdialogExecCount)
 
 SCIP_DECL_DIALOGEXEC (SCIPdialogExecWriteAllsolutions)
 
SCIP_RETCODE SCIPincludeConshdlrCountsols (SCIP *scip)
 
SCIP_RETCODE SCIPcount (SCIP *scip)
 
SCIP_Longint SCIPgetNCountedSols (SCIP *scip, SCIP_Bool *valid)
 
void SCIPgetNCountedSolsstr (SCIP *scip, char **buffer, int buffersize, int *requiredsize)
 
SCIP_Longint SCIPgetNCountedFeasSubtrees (SCIP *scip)
 
void SCIPgetCountedSparseSols (SCIP *scip, SCIP_VAR ***vars, int *nvars, SCIP_SPARSESOL ***sols, int *nsols)
 
SCIP_RETCODE SCIPsetParamsCountsols (SCIP *scip)
 

Function Documentation

SCIP_RETCODE SCIPincludeConshdlrCountsols ( SCIP scip)

creates the handler for countsol constraints and includes it in SCIP

creates the handler for countsols constraints and includes it in SCIP

Parameters
scipSCIP data structure

Definition at line 2559 of file cons_countsols.c.

References includeConshdlrCountsols(), SCIP_CALL, SCIP_OKAY, and TRUE.

Referenced by SCIPincludeDefaultPlugins().

SCIP_RETCODE SCIPcount ( SCIP scip)

execute counting

Parameters
scipSCIP data structure

Definition at line 2571 of file cons_countsols.c.

References checkParameters(), CONSHDLR_NAME, FALSE, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPgetBoolParam(), SCIPsetBoolParam(), SCIPsolve(), and TRUE.

Referenced by SCIP_DECL_DIALOGEXEC().

SCIP_Longint SCIPgetNCountedSols ( SCIP scip,
SCIP_Bool valid 
)

returns number of feasible solutions found as SCIP_Longint; if the number does not fit into a SCIP_Longint the valid flag is set to FALSE

Parameters
scipSCIP data structure
validpointer to store if the return value is valid

Definition at line 2603 of file cons_countsols.c.

References CONSHDLR_NAME, getNCountedSols(), NULL, SCIPconshdlrGetData(), and SCIPfindConshdlr().

Referenced by SCIP_DECL_DIALOGEXEC(), and SCIP_DECL_DISPOUTPUT().

void SCIPgetNCountedSolsstr ( SCIP scip,
char **  buffer,
int  buffersize,
int *  requiredsize 
)

returns number of counted solutions as string

puts the number of counted solutions in the given char* buffer

Parameters
scipSCIP data structure
bufferbuffer to store the number for counted solutions
buffersizebuffer size
requiredsizepointer to store the required size

Definition at line 2623 of file cons_countsols.c.

References CONSHDLR_NAME, NULL, pow(), SCIPconshdlrGetData(), SCIPfindConshdlr(), and toString().

Referenced by SCIP_DECL_DIALOGEXEC().

SCIP_Longint SCIPgetNCountedFeasSubtrees ( SCIP scip)

returns number of counted feasible subtrees

returns number of counted non trivial feasible subtrees

Parameters
scipSCIP data structure

Definition at line 2661 of file cons_countsols.c.

References CONSHDLR_NAME, NULL, SCIPconshdlrGetData(), and SCIPfindConshdlr().

Referenced by SCIP_DECL_DIALOGEXEC(), and SCIP_DECL_DISPOUTPUT().

void SCIPgetCountedSparseSols ( SCIP scip,
SCIP_VAR ***  vars,
int *  nvars,
SCIP_SPARSESOL ***  sols,
int *  nsols 
)

Method to get the sparse solution.

Note
You get the pointer to the sparse solutions stored in the constraint handler (not a copy).
The sparse solutions are stored w.r.t. the active variables. This are the variables which got not removed during presolving. For none active variables the value has to be computed depending on their aggregation type. See for more details about that Collect all feasible solution.
Parameters
scipSCIP data structure
varspointer to active variable array defining to variable order
nvarsnumber of active variables
solspointer to the solutions
nsolspointer to number of solutions

Definition at line 2689 of file cons_countsols.c.

References CONSHDLR_NAME, NULL, SCIPconshdlrGetData(), and SCIPfindConshdlr().

SCIP_RETCODE SCIPsetParamsCountsols ( SCIP scip)

setting SCIP parameters for such that a valid counting process is possible

Parameters
scipSCIP data structure

Definition at line 2716 of file cons_countsols.c.

References SCIP_CALL, SCIP_OKAY, SCIP_PARAMEMPHASIS_COUNTER, SCIPsetEmphasis(), and TRUE.