Scippy

GCG

Branch-and-Price & Column Generation for Everyone

solver.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program */
4 /* GCG --- Generic Column Generation */
5 /* a Dantzig-Wolfe decomposition based extension */
6 /* of the branch-cut-and-price framework */
7 /* SCIP --- Solving Constraint Integer Programs */
8 /* */
9 /* Copyright (C) 2010-2021 Operations Research, RWTH Aachen University */
10 /* Zuse Institute Berlin (ZIB) */
11 /* */
12 /* This program is free software; you can redistribute it and/or */
13 /* modify it under the terms of the GNU Lesser General Public License */
14 /* as published by the Free Software Foundation; either version 3 */
15 /* of the License, or (at your option) any later version. */
16 /* */
17 /* This program is distributed in the hope that it will be useful, */
18 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
19 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
20 /* GNU Lesser General Public License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with this program; if not, write to the Free Software */
24 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
25 /* */
26 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
28 /**@file solver.h
29  * @ingroup PRICING
30  * @brief private methods for GCG pricing solvers
31  * @author Henri Lotze
32  * @author Christian Puchert
33  */
34 
35 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36 
37 #ifndef GCG_SOLVER_H_
38 #define GCG_SOLVER_H_
39 
40 #include "type_solver.h"
41 #include "scip/scip.h"
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /**
48  * @ingroup PRICING
49  *
50  * @{
51  */
52 
53 /** creates a GCG pricing solver */
54 SCIP_EXPORT
55 SCIP_RETCODE GCGsolverCreate(
56  SCIP* scip, /**< SCIP data structure (master problem) */
57  GCG_SOLVER** solver, /**< pointer to pricing solver data structure */
58  const char* name, /**< name of solver */
59  const char* desc, /**< description of solver */
60  int priority, /**< priority of solver */
61  SCIP_Bool heurenabled, /**< flag to indicate whether heuristic solving method of the solver is enabled */
62  SCIP_Bool exactenabled, /**< flag to indicate whether exact solving method of the solver is enabled */
63  GCG_DECL_SOLVERUPDATE((*solverupdate)), /**< update method for solver */
64  GCG_DECL_SOLVERSOLVE ((*solversolve)), /**< solving method for solver */
65  GCG_DECL_SOLVERSOLVEHEUR((*solveheur)), /**< heuristic solving method for solver */
66  GCG_DECL_SOLVERFREE ((*solverfree)), /**< free method of solver */
67  GCG_DECL_SOLVERINIT ((*solverinit)), /**< init method of solver */
68  GCG_DECL_SOLVEREXIT ((*solverexit)), /**< exit method of solver */
69  GCG_DECL_SOLVERINITSOL((*solverinitsol)), /**< initsol method of solver */
70  GCG_DECL_SOLVEREXITSOL((*solverexitsol)), /**< exitsol method of solver */
71  GCG_SOLVERDATA* solverdata /**< pricing solver data */
72  );
73 
74 /** calls destructor and frees memory of GCG pricing solver */
75 SCIP_EXPORT
76 SCIP_RETCODE GCGsolverFree(
77  SCIP* scip, /**< SCIP data structure (master problem) */
78  GCG_SOLVER** solver /**< pointer to pricing solver data structure */
79  );
80 
81 /** initializes GCG pricing solver */
82 SCIP_EXPORT
83 SCIP_RETCODE GCGsolverInit(
84  SCIP* scip, /**< SCIP data structure (master problem) */
85  GCG_SOLVER* solver /**< pricing solver */
86  );
87 
88 /** calls exit method of GCG pricing solver */
89 SCIP_EXPORT
90 SCIP_RETCODE GCGsolverExit(
91  SCIP* scip, /**< SCIP data structure (master problem) */
92  GCG_SOLVER* solver /**< pricing solver */
93  );
94 
95 /** calls solving process initialization method of GCG pricing solver */
96 SCIP_EXPORT
97 SCIP_RETCODE GCGsolverInitsol(
98  SCIP* scip, /**< SCIP data structure (master problem) */
99  GCG_SOLVER* solver /**< pricing solver */
100  );
101 
102 /** calls solving process deinitialization method of GCG pricing solver */
103 SCIP_EXPORT
104 SCIP_RETCODE GCGsolverExitsol(
105  SCIP* scip, /**< SCIP data structure (master problem) */
106  GCG_SOLVER* solver /**< pricing solver */
107  );
108 
109 /** calls update method of GCG pricing solver */
110 SCIP_EXPORT
111 SCIP_RETCODE GCGsolverUpdate(
112  SCIP* pricingprob, /**< the pricing problem that should be solved */
113  GCG_SOLVER* solver, /**< pricing solver */
114  int probnr, /**< number of the pricing problem */
115  SCIP_Bool varobjschanged, /**< have the objective coefficients changed? */
116  SCIP_Bool varbndschanged, /**< have the lower and upper bounds changed? */
117  SCIP_Bool consschanged /**< have the constraints changed? */
118  );
119 
120 /** calls heuristic or exact solving method of GCG pricing solver */
121 SCIP_EXPORT
122 SCIP_RETCODE GCGsolverSolve(
123  SCIP* scip, /**< SCIP data structure (master problem) */
124  SCIP* pricingprob, /**< the pricing problem that should be solved */
125  GCG_SOLVER* solver, /**< pricing solver */
126  SCIP_Bool redcost, /**< is reduced cost (TRUE) or Farkas (FALSE) pricing performed? */
127  SCIP_Bool heuristic, /**< shall the pricing problem be solved heuristically? */
128  int probnr, /**< number of the pricing problem */
129  SCIP_Real dualsolconv, /**< dual solution of the corresponding convexity constraint */
130  SCIP_Real* lowerbound, /**< pointer to store lower bound of pricing problem */
131  GCG_PRICINGSTATUS* status, /**< pointer to store the returned pricing status */
132  SCIP_Bool* solved /**< pointer to store whether the solution method was called */
133  );
134 /**@} */
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 #endif
SCIP_EXPORT SCIP_RETCODE GCGsolverCreate(SCIP *scip, GCG_SOLVER **solver, const char *name, const char *desc, int priority, SCIP_Bool heurenabled, SCIP_Bool exactenabled, GCG_DECL_SOLVERUPDATE((*solverupdate)), GCG_DECL_SOLVERSOLVE((*solversolve)), GCG_DECL_SOLVERSOLVEHEUR((*solveheur)), GCG_DECL_SOLVERFREE((*solverfree)), GCG_DECL_SOLVERINIT((*solverinit)), GCG_DECL_SOLVEREXIT((*solverexit)), GCG_DECL_SOLVERINITSOL((*solverinitsol)), GCG_DECL_SOLVEREXITSOL((*solverexitsol)), GCG_SOLVERDATA *solverdata)
Definition: solver.c:59
#define GCG_DECL_SOLVERSOLVEHEUR(x)
Definition: type_solver.h:133
SCIP_EXPORT SCIP_RETCODE GCGsolverUpdate(SCIP *pricingprob, GCG_SOLVER *solver, int probnr, SCIP_Bool varobjschanged, SCIP_Bool varbndschanged, SCIP_Bool consschanged)
Definition: solver.c:257
enum GCG_PricingStatus GCG_PRICINGSTATUS
#define GCG_DECL_SOLVERINITSOL(x)
Definition: type_solver.h:86
SCIP_EXPORT SCIP_RETCODE GCGsolverInitsol(SCIP *scip, GCG_SOLVER *solver)
Definition: solver.c:223
#define GCG_DECL_SOLVEREXIT(x)
Definition: type_solver.h:75
type definitions for pricing problem solvers in GCG project
#define GCG_DECL_SOLVEREXITSOL(x)
Definition: type_solver.h:97
SCIP_EXPORT SCIP_RETCODE GCGsolverExit(SCIP *scip, GCG_SOLVER *solver)
Definition: solver.c:206
#define GCG_DECL_SOLVERFREE(x)
Definition: type_solver.h:59
#define GCG_DECL_SOLVERINIT(x)
Definition: type_solver.h:67
SCIP_EXPORT SCIP_RETCODE GCGsolverExitsol(SCIP *scip, GCG_SOLVER *solver)
Definition: solver.c:240
SCIP_EXPORT SCIP_RETCODE GCGsolverInit(SCIP *scip, GCG_SOLVER *solver)
Definition: solver.c:172
#define GCG_DECL_SOLVERUPDATE(x)
Definition: type_solver.h:105
SCIP_EXPORT SCIP_RETCODE GCGsolverSolve(SCIP *scip, SCIP *pricingprob, GCG_SOLVER *solver, SCIP_Bool redcost, SCIP_Bool heuristic, int probnr, SCIP_Real dualsolconv, SCIP_Real *lowerbound, GCG_PRICINGSTATUS *status, SCIP_Bool *solved)
Definition: solver.c:280
SCIP_EXPORT SCIP_RETCODE GCGsolverFree(SCIP *scip, GCG_SOLVER **solver)
Definition: solver.c:144
#define GCG_DECL_SOLVERSOLVE(x)
Definition: type_solver.h:119