1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program */
/* GCG --- Generic Column Generation */
/* a Dantzig-Wolfe decomposition based extension */
/* of the branch-cut-and-price framework */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2010-2022 Operations Research, RWTH Aachen University */
/* Zuse Institute Berlin (ZIB) */
/* */
/* This program is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU Lesser General Public License */
/* as published by the Free Software Foundation; either version 3 */
/* of the License, or (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file cons_decomp.hpp
* @brief C++ interface of cons_decomp
* @author Erik Muehmer
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef GCG_CONS_DECOMP_HPP
#define GCG_CONS_DECOMP_HPP
#include "class_partialdecomp.h"
/** @brief gets vector of all partialdecs
* @returns finished partialdecs
*/
extern
std::vector<gcg::PARTIALDECOMP*>* GCGconshdlrDecompGetPartialdecs(
SCIP* scip /**< SCIP data structure */
);
extern
gcg::PARTIALDECOMP* DECgetPartialdecToWrite(
SCIP* scip,
SCIP_Bool transformed
);
/** @brief local method to find a partialdec for a given id or NULL if no partialdec with such id is found
* @returns partialdec pointer of partialdec with given id or NULL if it does not exist
* @note returns NULL if no partialdec by this id is known */
extern
gcg::PARTIALDECOMP* GCGconshdlrDecompGetPartialdecFromID(
SCIP* scip, /**< SCIP data structure */
int partialdecid /**< partialdec id */
);
/** @brief adds a preexisting partial dec to be considered at the beginning of the detection
*
* @note refines the partialdec to be consistent, adds meta data/statistics
* @returns SCIP return code
*/
extern
SCIP_RETCODE GCGconshdlrDecompAddPreexisitingPartialDec(
SCIP* scip, /**< SCIP data structure */
gcg::PARTIALDECOMP* partialdec/**< partial dec to add */
);
/** @brief deregisters a partialdec in the conshdlr
*
* Use this function at deletion of the partialdec.
* The partialdec is not destroyed in this function, the conshdlr will not know that it exists.
*/
extern
void GCGconshdlrDecompDeregisterPartialdec(
SCIP* scip, /**< SCIP data structure */
gcg::PARTIALDECOMP* partialdec /**< the partialdec */
);
/** @brief registers a partialdec in the conshdlr
*
* Use this function at initialization of the partialdec.
* If the partialdec already exists in the conshdlr it is ignored.
*/
extern
void GCGconshdlrDecompRegisterPartialdec(
SCIP* scip, /**< SCIP data structure */
gcg::PARTIALDECOMP* partialdec /**< the partialdec to register */
);
/**
* @brief help method to access detprobdata for unpresolved problem
*
* @returns pointer to detprobdata in wrapper data structure
*/
extern
gcg::DETPROBDATA* GCGconshdlrDecompGetDetprobdataOrig(
SCIP* scip /**< SCIP data structure */
);
/**
* @brief help method to access detprobdata for transformed problem
*
* @returns pointer to detprobdata in wrapper data structure
*/
extern
gcg::DETPROBDATA* GCGconshdlrDecompGetDetprobdataPresolved(
SCIP* scip /**< SCIP data structure */
);
/**
* @brief initilizes the candidates data structures with selected partialdecs
*
* initializes it with all if there are no selected partialdecs,
* sort them according to the current scoretype
* @param scip SCIP data structure
* @param candidates tuples of partialdecs and scores will be added to this vector (sorted w.r.t. the scores).
* @param original choose candidates for the original problem?
* @param printwarnings should warnings be printed?
* @returns SCIP return code
*/
extern
SCIP_RETCODE GCGconshdlrDecompChooseCandidatesFromSelected(
SCIP* scip,
std::vector<std::pair<gcg::PARTIALDECOMP*, SCIP_Real> >& candidates,
SCIP_Bool original,
SCIP_Bool printwarnings
);
/** @brief gets detector history of partialdec with given id
* @returns detector history of partialdec as string
*/
extern
std::string GCGconshdlrDecompGetDetectorHistoryByPartialdecId(
SCIP* scip, /**< SCIP data structure */
int id /**< id of partialdec */
);
#endif //GCG_CONS_DECOMP_HPP