Detailed Description
includes solution pool for Steiner tree problems
This file contains several basic methods for a Steiner tree solution pool.
Definition in file solpool.c.
Go to the source code of this file.
Functions | |
SCIP_Bool | solpool_isContained (const int *soledges, const STPSOLPOOL *pool) |
STPSOL * | solpool_solFromIndex (STPSOLPOOL *pool, const int soindex) |
SCIP_RETCODE | solpool_init (SCIP *scip, STPSOLPOOL **pool, const int nedges, const int maxsize) |
void | solpool_free (SCIP *scip, STPSOLPOOL **pool) |
SCIP_RETCODE | solpool_addSolToScip (SCIP *scip, SCIP_HEUR *heur, const GRAPH *g, const int *result, SCIP_Bool *success) |
SCIP_RETCODE | solpool_addSol (SCIP *scip, const SCIP_Real obj, const int *soledges, STPSOLPOOL *pool, SCIP_Bool *success) |
Function Documentation
◆ solpool_isContained()
SCIP_Bool solpool_isContained | ( | const int * | soledges, |
const STPSOLPOOL * | pool | ||
) |
is given solution in pool?
- Parameters
-
soledges edge array of solution to be checked pool the pool
Definition at line 35 of file solpool.c.
References FALSE, stp_solution_pool::nedges, NULL, SCIPdebugMessage, stp_solution_pool::size, stp_solution::soledges, stp_solution_pool::sols, and TRUE.
Referenced by solpool_addSol().
◆ solpool_solFromIndex()
STPSOL* solpool_solFromIndex | ( | STPSOLPOOL * | pool, |
const int | soindex | ||
) |
get solution from index
- Parameters
-
pool the pool soindex the index
Definition at line 66 of file solpool.c.
References stp_solution::index, NULL, stp_solution_pool::size, and stp_solution_pool::sols.
Referenced by computeSteinerTreeRedCosts(), and computeSteinerTreeRedCostsPcMw().
◆ solpool_init()
SCIP_RETCODE solpool_init | ( | SCIP * | scip, |
STPSOLPOOL ** | pool, | ||
const int | nedges, | ||
const int | maxsize | ||
) |
initializes STPSOL pool
- Parameters
-
scip SCIP data structure pool the pool nedges number of edges of solutions to be stored in the pool maxsize capacity of pool
Definition at line 91 of file solpool.c.
References stp_solution_pool::maxindex, stp_solution_pool::maxsize, stp_solution_pool::nedges, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory(), SCIPallocMemoryArray, stp_solution_pool::size, and stp_solution_pool::sols.
Referenced by reduce_da(), and reduce_daPcMw().
◆ solpool_free()
void solpool_free | ( | SCIP * | scip, |
STPSOLPOOL ** | pool | ||
) |
frees STPSOL pool
- Parameters
-
scip SCIP data structure pool the pool
Definition at line 122 of file solpool.c.
References stp_solution_pool::maxsize, NULL, SCIPfreeBlockMemory, SCIPfreeMemoryArray, stp_solution_pool::size, stp_solution::soledges, and stp_solution_pool::sols.
Referenced by daPcMarkRoots(), reduce_da(), and reduce_daPcMw().
◆ solpool_addSolToScip()
SCIP_RETCODE solpool_addSolToScip | ( | SCIP * | scip, |
SCIP_HEUR * | heur, | ||
const GRAPH * | g, | ||
const int * | result, | ||
SCIP_Bool * | success | ||
) |
tries to add sol to SCIP
- Parameters
-
scip SCIP data structure heur heuristic data structure or NULL g graph data structure result edge array of solution to be added success has solution been added?
Definition at line 150 of file solpool.c.
References CONNECT, graph_get_nEdges(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMessage, SCIPfreeBufferArray, SCIPprobdataAddNewSol(), and SCIPprobdataGetNVars().
Referenced by addRedsol(), and SCIPStpHeurAscendPruneRun().
◆ solpool_addSol()
SCIP_RETCODE solpool_addSol | ( | SCIP * | scip, |
const SCIP_Real | obj, | ||
const int * | soledges, | ||
STPSOLPOOL * | pool, | ||
SCIP_Bool * | success | ||
) |
tries to add STPSOL to pool
- Parameters
-
scip SCIP data structure obj objective of solution to be added soledges edge array of solution to be added pool the pool success has solution been added?
Definition at line 183 of file solpool.c.
References BMScopyMemoryArray, FALSE, stp_solution::index, stp_solution_pool::maxindex, stp_solution_pool::maxsize, stp_solution_pool::nedges, NULL, stp_solution::obj, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory(), SCIPallocMemoryArray, SCIPdebugMessage, SCIPisGT(), stp_solution_pool::size, stp_solution::soledges, solpool_isContained(), stp_solution_pool::sols, and TRUE.
Referenced by computeSteinerTreeRedCosts(), computeSteinerTreeRedCostsPcMw(), daPcAddTmSolToPool(), and poolAddSol().