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 2560 of file cons_countsols.c.

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

Referenced by includeConshdlrCountsols(), and SCIPincludeDefaultPlugins().

SCIP_RETCODE SCIPcount ( SCIP scip)
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 2604 of file cons_countsols.c.

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

Referenced by SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DISPOUTPUT(), and SCIPcount().

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 2624 of file cons_countsols.c.

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

Referenced by SCIP_DECL_DIALOGEXEC(), and SCIPgetNCountedSols().

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 2662 of file cons_countsols.c.

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

Referenced by SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DISPOUTPUT(), and SCIPgetNCountedSolsstr().

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 2690 of file cons_countsols.c.

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

Referenced by SCIPgetNCountedFeasSubtrees().

SCIP_RETCODE SCIPsetParamsCountsols ( SCIP scip)

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

Parameters
scipSCIP data structure

Definition at line 2717 of file cons_countsols.c.

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

Referenced by SCIPgetCountedSparseSols().