SCIP Doxygen Documentation
 
Loading...
Searching...
No Matches

Detailed Description

sparse storage for multiple integer solutions

Functions

SCIP_RETCODE SCIPsparseSolCreate (SCIP_SPARSESOL **sparsesol, SCIP_VAR **vars, int nvars, SCIP_Bool cleared)
 
void SCIPsparseSolFree (SCIP_SPARSESOL **sparsesol)
 
SCIP_VAR ** SCIPsparseSolGetVars (SCIP_SPARSESOL *sparsesol)
 
int SCIPsparseSolGetNVars (SCIP_SPARSESOL *sparsesol)
 
SCIP_LongintSCIPsparseSolGetLbs (SCIP_SPARSESOL *sparsesol)
 
SCIP_LongintSCIPsparseSolGetUbs (SCIP_SPARSESOL *sparsesol)
 
void SCIPsparseSolGetFirstSol (SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars)
 
SCIP_Bool SCIPsparseSolGetNextSol (SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars)
 

Function Documentation

◆ SCIPsparseSolCreate()

SCIP_RETCODE SCIPsparseSolCreate ( SCIP_SPARSESOL ** sparsesol,
SCIP_VAR ** vars,
int nvars,
SCIP_Bool cleared )

creates a sparse solution

Parameters
sparsesolpointer to store the created sparse solution
varsvariables in the sparse solution, must not contain continuous variables
nvarsnumber of variables to store, size of the lower and upper bound arrays
clearedshould the lower and upper bound arrays be cleared (entries set to 0)

Definition at line 713 of file misc.c.

References assert(), BMSallocClearMemoryArray, BMSallocMemory, BMSallocMemoryArray, BMSduplicateMemoryArray, i, NULL, nvars, SCIP_ALLOC, SCIP_OKAY, and vars.

Referenced by collectSolution().

◆ SCIPsparseSolFree()

void SCIPsparseSolFree ( SCIP_SPARSESOL ** sparsesol)

frees sparse solution

Parameters
sparsesolpointer to a sparse solution

Definition at line 765 of file misc.c.

References assert(), BMSfreeMemory, BMSfreeMemoryArray, i, and NULL.

Referenced by collectSolution(), and SCIP_DECL_CONSEXIT().

◆ SCIPsparseSolGetVars()

SCIP_VAR ** SCIPsparseSolGetVars ( SCIP_SPARSESOL * sparsesol)

returns the variables in the given sparse solution

returns the variables stored in the given sparse solution

Parameters
sparsesola sparse solution

Definition at line 779 of file misc.c.

References assert(), i, and NULL.

◆ SCIPsparseSolGetNVars()

int SCIPsparseSolGetNVars ( SCIP_SPARSESOL * sparsesol)

returns the number of variables in the given sparse solution

returns the number of variables stored in the given sparse solution

Parameters
sparsesola sparse solution

Definition at line 789 of file misc.c.

References assert(), i, and NULL.

Referenced by SCIPsparseSolGetFirstSol(), SCIPsparseSolGetNextSol(), and writeExpandedSolutions().

◆ SCIPsparseSolGetLbs()

SCIP_Longint * SCIPsparseSolGetLbs ( SCIP_SPARSESOL * sparsesol)

returns the the lower bound array for all variables for a given sparse solution

returns the lower bound array for all variables for a given sparse solution

Parameters
sparsesola sparse solution

Definition at line 799 of file misc.c.

References assert(), i, and NULL.

Referenced by collectSolution(), SCIPsparseSolGetFirstSol(), and SCIPsparseSolGetNextSol().

◆ SCIPsparseSolGetUbs()

SCIP_Longint * SCIPsparseSolGetUbs ( SCIP_SPARSESOL * sparsesol)

returns the the upper bound array for all variables for a given sparse solution

returns the upper bound array for all variables for a given sparse solution

Parameters
sparsesola sparse solution

Definition at line 809 of file misc.c.

References assert(), i, and NULL.

Referenced by collectSolution(), and SCIPsparseSolGetNextSol().

◆ SCIPsparseSolGetFirstSol()

void SCIPsparseSolGetFirstSol ( SCIP_SPARSESOL * sparsesol,
SCIP_Longint * sol,
int nvars )

constructs the first solution of sparse solution (all variables are set to their lower bound value

Parameters
sparsesolsparse solutions
solarray to store the first solution
nvarsnumber of variables

Definition at line 819 of file misc.c.

References assert(), i, NULL, nvars, SCIPsparseSolGetLbs(), SCIPsparseSolGetNVars(), and sol.

Referenced by writeExpandedSolutions().

◆ SCIPsparseSolGetNextSol()

SCIP_Bool SCIPsparseSolGetNextSol ( SCIP_SPARSESOL * sparsesol,
SCIP_Longint * sol,
int nvars )

constructs the next solution of the sparse solution and return whether there was one more or not

Parameters
sparsesolsparse solutions
solcurrent solution array which get changed to the next solution
nvarsnumber of variables

Definition at line 842 of file misc.c.

References assert(), FALSE, i, NULL, nvars, SCIPsparseSolGetLbs(), SCIPsparseSolGetNVars(), SCIPsparseSolGetUbs(), sol, and TRUE.

Referenced by writeExpandedSolutions().