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_Longint * | SCIPsparseSolGetLbs (SCIP_SPARSESOL *sparsesol) |
SCIP_Longint * | SCIPsparseSolGetUbs (SCIP_SPARSESOL *sparsesol) |
void | SCIPsparseSolGetFirstSol (SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars) |
SCIP_Bool | SCIPsparseSolGetNextSol (SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars) |
SCIP_RETCODE SCIPsparseSolCreate | ( | SCIP_SPARSESOL ** | sparsesol, |
SCIP_VAR ** | vars, | ||
int | nvars, | ||
SCIP_Bool | cleared ) |
creates a sparse solution
sparsesol | pointer to store the created sparse solution |
vars | variables in the sparse solution, must not contain continuous variables |
nvars | number of variables to store, size of the lower and upper bound arrays |
cleared | should the lower and upper bound arrays be cleared (entries set to 0) |
Definition at line 763 of file misc.c.
References assert(), BMSallocClearMemoryArray, BMSallocMemory, BMSallocMemoryArray, BMSduplicateMemoryArray, NULL, nvars, SCIP_ALLOC, SCIP_OKAY, and vars.
Referenced by collectSolution().
void SCIPsparseSolFree | ( | SCIP_SPARSESOL ** | sparsesol | ) |
frees sparse solution
sparsesol | pointer to a sparse solution |
Definition at line 815 of file misc.c.
References assert(), BMSfreeMemory, BMSfreeMemoryArray, and NULL.
Referenced by collectSolution(), and SCIP_DECL_CONSEXIT().
SCIP_VAR ** SCIPsparseSolGetVars | ( | SCIP_SPARSESOL * | sparsesol | ) |
returns the variables in the given sparse solution
returns the variables stored in the given sparse solution
sparsesol | a sparse solution |
Definition at line 829 of file misc.c.
References assert(), NULL, and SCIP_SparseSol::vars.
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
sparsesol | a sparse solution |
Definition at line 839 of file misc.c.
References assert(), NULL, and SCIP_SparseSol::nvars.
Referenced by SCIPsparseSolGetFirstSol(), SCIPsparseSolGetNextSol(), and writeExpandedSolutions().
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
sparsesol | a sparse solution |
Definition at line 849 of file misc.c.
References assert(), SCIP_SparseSol::lbvalues, and NULL.
Referenced by collectSolution(), SCIPsparseSolGetFirstSol(), and SCIPsparseSolGetNextSol().
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
sparsesol | a sparse solution |
Definition at line 859 of file misc.c.
References assert(), NULL, and SCIP_SparseSol::ubvalues.
Referenced by collectSolution(), and SCIPsparseSolGetNextSol().
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
sparsesol | sparse solutions |
sol | array to store the first solution |
nvars | number of variables |
Definition at line 869 of file misc.c.
References assert(), NULL, nvars, SCIPsparseSolGetLbs(), SCIPsparseSolGetNVars(), and sol.
Referenced by writeExpandedSolutions().
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
sparsesol | sparse solutions |
sol | current solution array which get changed to the next solution |
nvars | number of variables |
Definition at line 892 of file misc.c.
References assert(), FALSE, NULL, nvars, SCIPsparseSolGetLbs(), SCIPsparseSolGetNVars(), SCIPsparseSolGetUbs(), sol, and TRUE.
Referenced by writeExpandedSolutions().