GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
cons_decomp.hpp
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
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-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file cons_decomp.hpp
30 * @ingroup CONSHDLRS-GCG
31 * @brief C++ interface of cons_decomp
32 * @author Erik Muehmer
33 */
34
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36
37#ifndef GCG_CONS_DECOMP_HPP
38#define GCG_CONS_DECOMP_HPP
39
40
42
43/** @brief gets vector of all partialdecs
44 * @returns finished partialdecs
45 */
47std::vector<gcg::PARTIALDECOMP*>* GCGconshdlrDecompGetPartialdecs(
48 GCG* gcg /**< GCG data structure */
49 );
50
53 GCG* gcg,
54 SCIP_Bool transformed
55 );
56
57/** @brief local method to find a partialdec for a given id or NULL if no partialdec with such id is found
58 * @returns partialdec pointer of partialdec with given id or NULL if it does not exist
59 * @note returns NULL if no partialdec by this id is known */
62 GCG* scip, /**< GCG data structure */
63 int partialdecid /**< partialdec id */
64 );
65
66/** @brief adds a preexisting partial dec to be considered at the beginning of the detection
67 *
68 * @note refines the partialdec to be consistent, adds meta data/statistics, completes partial dec by assigning open conss to master if USERGIVEN::COMPLETED_CONSTOMASTER is set
69 * @returns SCIP return code
70*/
73 GCG* gcg, /**< GCG data structure */
74 gcg::PARTIALDECOMP* partialdec/**< partial dec to add */
75 );
76
77/** @brief adds a preexisting partial dec to be considered at the beginning of the detection
78 *
79 * @note refines the partialdec to be consistent, adds meta data/statistics, completes partial dec by assigning open conss to master if USERGIVEN::COMPLETED_CONSTOMASTER is set
80 * @returns SCIP return code
81*/
84 GCG* gcg, /**< GCG data structure */
85 gcg::PARTIALDECOMP* partialdec, /**< partial dec to add */
86 SCIP_Bool addpartialdec /**< if completed, add partial dec as well */
87 );
88
89/** @brief deregisters a partialdec in the conshdlr
90 *
91 * Use this function at deletion of the partialdec.
92 * The partialdec is not destroyed in this function, the conshdlr will not know that it exists.
93 */
96 GCG* gcg, /**< GCG data structure */
97 gcg::PARTIALDECOMP* partialdec /**< the partialdec */
98 );
99
100/** @brief registers a partialdec in the conshdlr
101 *
102 * Use this function at initialization of the partialdec.
103 * If the partialdec already exists in the conshdlr it is ignored.
104 */
107 GCG* gcg, /**< GCG data structure */
108 gcg::PARTIALDECOMP* partialdec /**< the partialdec to register */
109 );
110
111/**
112 * @brief help method to access detprobdata for unpresolved problem
113 *
114 * @returns pointer to detprobdata in wrapper data structure
115 */
118 GCG* gcg /**< GCG data structure */
119 );
120
121/**
122 * @brief help method to access detprobdata for transformed problem
123 *
124 * @returns pointer to detprobdata in wrapper data structure
125 */
128 GCG* gcg /**< GCG data structure */
129 );
130
131/**
132 * @brief initilizes the candidates data structures with selected partialdecs
133 *
134 * initializes it with all if there are no selected partialdecs,
135 * sort them according to the current scoretype
136 * @param gcg GCG data structure
137 * @param candidates tuples of partialdecs and scores will be added to this vector (sorted w.r.t. the scores).
138 * @param original choose candidates for the original problem?
139 * @param printwarnings should warnings be printed?
140 * @returns SCIP return code
141 */
144 GCG* gcg,
145 std::vector<std::pair<gcg::PARTIALDECOMP*, SCIP_Real> >& candidates,
146 SCIP_Bool original,
147 SCIP_Bool printwarnings
148 );
149
150/** @brief gets detector history of partialdec with given id
151 * @returns detector history of partialdec as string
152 */
155 GCG* gcg, /**< GCG data structure */
156 int id /**< id of partialdec */
157 );
158
159#endif //GCG_CONS_DECOMP_HPP
class storing (potentially incomplete) decompositions
class to manage partial decompositions
std::vector< PARTIALDECOMP * > * GCGconshdlrDecompGetPartialdecs(GCG *gcg)
gets vector of all partialdecs
void GCGconshdlrDecompRegisterPartialdec(GCG *gcg, PARTIALDECOMP *partialdec)
registers a partialdec in the conshdlr
void GCGconshdlrDecompDeregisterPartialdec(GCG *gcg, PARTIALDECOMP *partialdec)
deregisters a partialdec in the conshdlr
DETPROBDATA * GCGconshdlrDecompGetDetprobdataPresolved(GCG *gcg)
help method to access detprobdata for transformed problem
DETPROBDATA * GCGconshdlrDecompGetDetprobdataOrig(GCG *gcg)
help method to access detprobdata for unpresolved problem
SCIP_RETCODE GCGconshdlrDecompChooseCandidatesFromSelected(GCG *gcg, std::vector< std::pair< gcg::PARTIALDECOMP *, SCIP_Real > > &candidates, SCIP_Bool original, SCIP_Bool printwarnings)
PARTIALDECOMP * GCGgetPartialdecToWrite(GCG *gcg, SCIP_Bool transformed)
SCIP_RETCODE GCGconshdlrDecompAddPreexisitingPartialDec(GCG *gcg, PARTIALDECOMP *partialdec)
adds a preexisting partial dec to be considered at the beginning of the detection
PARTIALDECOMP * GCGconshdlrDecompGetPartialdecFromID(GCG *gcg, int partialdecid)
local method to find a partialdec for a given id or NULL if no partialdec with such id is found
GCG_EXPORT std::string GCGconshdlrDecompGetDetectorHistoryByPartialdecId(GCG *gcg, int id)
gets detector history of partialdec with given id
#define GCG_EXPORT
Definition def.h:59
#define SCIP_Bool
struct Gcg GCG
Definition type_gcg.h:44
enum SCIP_Retcode SCIP_RETCODE