GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
struct_vardata.h
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 struct_vardata.h
30 * @ingroup DATASTRUCTURES
31 * @brief data structures for GCG variable data
32 * @author Gerald Gamrath
33 * @author Martin Bergner
34 */
35
36/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37
38#ifndef GCG_STRUCT_VARDATA_H__
39#define GCG_STRUCT_VARDATA_H__
40
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/** type of the variable */
49{
50 GCG_VARTYPE_ORIGINAL = 0, /**< variable belongs to original problem */
51 GCG_VARTYPE_PRICING = 1, /**< variable belongs to a pricing problem */
52 GCG_VARTYPE_MASTER = 2, /**< variable belongs to the master problem */
53 GCG_VARTYPE_INFERREDPRICING = 3, /**< pricing variable inferred from an extended master cons
54 and does not correspond to any original variable */
55};
57
58/** additional data for linking variables */
60{
61 SCIP_VAR** pricingvars; /**< array of corresponding variables in the pricing programs (NULL if variable is not linking this block)*/
62 SCIP_CONS** linkconss; /**< array of constraints in the master problem that ensure that all copies have the same values */
63 int nblocks; /**< number of blocks that this variable is linking */
64};
66
67
68/** data for original variables */
70{
71 SCIP_VAR* pricingvar; /**< corresponding variable in the pricing program */
72 SCIP_CONS** masterconss; /**< master constraints of the original program in which the variable has a nonzero entry */
73 SCIP_Real* coefs; /**< coefficients in the linking constraints of the original program */
74 int ncoefs; /**< number of coefficients */
75 SCIP_VAR** mastervars; /**< variables in the master problem that contain the variable */
76 SCIP_Real* mastervals; /**< value of this variable in the master problem variables */
77 int nmastervars; /**< number of corresponding master variables */
78 int maxmastervars; /**< length of arrays mastervars and vals */
79 GCG_LINKINGVARDATA* linkingvardata; /**< additional data for linking variables */
80};
82
83/** data for pricing variables */
85{
86 SCIP_VAR** origvars; /**< corresponding variables in the original program */
87 int norigvars; /**< number of corresponding variables in the original program */
88 int maxorigvars; /**< length of origvars array */
89};
91
92/** data for master variables */
94{
95 int norigvars; /**< number of variables in the original program corresponding to the current variable */
96 int maxorigvars; /**< capacity of origvars and origvals */
97 SCIP_VAR** origvars; /**< variables in the original program corresponding to the current variable */
98 SCIP_Real* origvals; /**< this variable represents vals[i] times the variable origvars[i] in the
99 * original program */
100 SCIP_Bool isray; /**< does this variable represent a ray or an extreme point? */
101 SCIP_Bool isartificial; /**< is variable artificial? */
102 SCIP_HASHMAP* origvar2val; /**< hash map that stores the fraction of original variables the master variable is contained in */
103 int index; /**< index of the master variable if stored in GCG's pricedvars array, -1 otherwise */
104};
106
107/** data for inferred pricing variables */
109{
110 GCG_EXTENDEDMASTERCONSDATA* extendedmasterconsdata; /**< extended master cons data that was used to infer the pricing variable */
111 SCIP_Bool iscoefvar; /**< is this a coefficient variable? */
112};
114
115/** variable data structure */
117{
118 union
119 {
120 GCG_ORIGVARDATA origvardata; /**< data for original variables */
121 GCG_PRICINGVARDATA pricingvardata; /**< data for pricing variables */
122 GCG_MASTERVARDATA mastervardata; /**< data for variable of the master problem */
123 GCG_INFERREDPRICINGVARDATA inferredpricingvardata; /**< data for inferred pricing variables */
125 GCG_VARTYPE vartype; /**< type of variable */
126 int blocknr; /**< number of the block and pricing problem, the variable belongs to,
127 * or -1 if variable is directly transferred to the master problem,
128 * or -2 if variable is a linking variable */
129 SCIP_Longint creationnode; /**< node where the variable is created */
130 SCIP_Longint rootredcostcall; /**< pricing reduced cost call when the variable is created
131 * (-1 if variable was not created at the root node or was created in Farkas pricing) */
132 SCIP_Real creationtime; /**< time when the variable is created */
133 SCIP_Longint iteration; /**< iteration when the variable is created */
134 SCIP_Real gap; /**< gap when the variable was created */
135 SCIP_Real redcost; /**< reduced cost of the variable */
136};
137
138#ifdef __cplusplus
139}
140#endif
141
142#endif
#define SCIP_Longint
#define SCIP_Bool
#define SCIP_Real
GCG_EXTENDEDMASTERCONSDATA * extendedmasterconsdata
SCIP_VAR ** pricingvars
SCIP_CONS ** linkconss
SCIP_Real * origvals
SCIP_HASHMAP * origvar2val
SCIP_VAR ** origvars
SCIP_Real * mastervals
SCIP_Real * coefs
GCG_LINKINGVARDATA * linkingvardata
SCIP_VAR * pricingvar
SCIP_VAR ** mastervars
SCIP_CONS ** masterconss
union SCIP_VarData::@366137245327061267011162307364031223073344301033 data
SCIP_Longint iteration
SCIP_Real redcost
SCIP_Longint rootredcostcall
SCIP_Longint creationnode
SCIP_Real creationtime
GCG_VARTYPE vartype
struct GCG_PricingVarData GCG_PRICINGVARDATA
enum GCG_Vartype GCG_VARTYPE
struct GCG_LinkingVarData GCG_LINKINGVARDATA
struct GCG_OrigVarData GCG_ORIGVARDATA
struct GCG_MasterVarData GCG_MASTERVARDATA
struct GCG_InferredPricingVarData GCG_INFERREDPRICINGVARDATA
GCG_Vartype
@ GCG_VARTYPE_PRICING
@ GCG_VARTYPE_ORIGINAL
@ GCG_VARTYPE_MASTER
@ GCG_VARTYPE_INFERREDPRICING
struct SCIP_Cons SCIP_CONS
type definitions for extended master conss in GCG projects
struct GCG_ExtendedMasterConsData GCG_EXTENDEDMASTERCONSDATA
struct SCIP_HashMap SCIP_HASHMAP
struct SCIP_Var SCIP_VAR
GCG_ORIGVARDATA origvardata
GCG_INFERREDPRICINGVARDATA inferredpricingvardata
GCG_MASTERVARDATA mastervardata
GCG_PRICINGVARDATA pricingvardata