Scippy

GCG

Branch-and-Price & Column Generation for Everyone

disp_master.c
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 disp_master.c
30 *
31 * @brief master display columns
32 * @author Gerald Gamrath
33 * @author Christian Puchert
34 * @author Martin Bergner
35 */
36
37/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
38
39#include <assert.h>
40#include <string.h>
41
42#include "gcg/disp_master.h"
43#include "scip/disp_default.h"
44#include "gcg/gcg.h"
45
46#define DISP_NAME_ORIGINAL "original"
47#define DISP_DESC_ORIGINAL "display column printing a display line of the original SCIP instance"
48#define DISP_HEAD_ORIGINAL ""
49#define DISP_WIDT_ORIGINAL 5
50#define DISP_PRIO_ORIGINAL 80000
51#define DISP_POSI_ORIGINAL 3550
52#define DISP_STRI_ORIGINAL TRUE
53
54struct SCIP_DispData
55{
56 GCG* gcg; /**< GCG data structure */
57};
58
59/*
60 * Callback methods
61 */
62
63/** copy method for display plugins (called when SCIP copies plugins) */
64static
65SCIP_DECL_DISPCOPY(dispCopyMaster)
66{ /*lint --e{715}*/
67 assert(scip != NULL);
68 assert(disp != NULL);
69
70 /* call inclusion method of default SCIP display plugin */
72
73 return SCIP_OKAY;
74}
75
76/** output method of display column to output file stream 'file' printing a display column of the original SCIP instance */
77static
78SCIP_DECL_DISPOUTPUT(SCIPdispOutputOriginal)
79{ /*lint --e{715}*/
80 SCIP_DISPDATA* dispdata;
81 assert(disp != NULL);
82 assert(strcmp(SCIPdispGetName(disp), DISP_NAME_ORIGINAL) == 0);
83 assert(scip != NULL);
84 dispdata = SCIPdispGetData(disp);
85 assert(dispdata != NULL);
86
88
89 return SCIP_OKAY;
90}
91
92/** destructor method of display plugin */
93static
94SCIP_DECL_DISPFREE(SCIPdispFreeMaster)
95{ /*lint --e{715}*/
96 SCIP_DISPDATA* dispdata;
97 dispdata = SCIPdispGetData(disp);
98 assert(dispdata != NULL);
99
100 SCIPfreeBlockMemory(scip, &dispdata);
101
102 return SCIP_OKAY;
103}
104
105/*
106 * default display columns specific interface methods
107 */
108
109/** includes the default display columns in SCIP */
111 GCG* gcg, /**< GCG data structure */
112 SCIP* masterprob /**< SCIP data structure */
113 )
114{
115 SCIP_DISPDATA* dispdata;
116
117 SCIP_CALL( SCIPallocBlockMemory(masterprob, &dispdata) );
118 dispdata->gcg = gcg;
119
121 SCIP_DISPSTATUS_AUTO, dispCopyMaster, SCIPdispFreeMaster, NULL, NULL, NULL, NULL, SCIPdispOutputOriginal, dispdata,
123
124 return SCIP_OKAY;
125}
#define SCIP_CALL(x)
#define FALSE
#define DISP_POSI_ORIGINAL
Definition: disp_master.c:51
#define DISP_WIDT_ORIGINAL
Definition: disp_master.c:49
static SCIP_DECL_DISPCOPY(dispCopyMaster)
Definition: disp_master.c:65
static SCIP_DECL_DISPFREE(SCIPdispFreeMaster)
Definition: disp_master.c:94
static SCIP_DECL_DISPOUTPUT(SCIPdispOutputOriginal)
Definition: disp_master.c:78
#define DISP_DESC_ORIGINAL
Definition: disp_master.c:47
SCIP_RETCODE GCGincludeDispMaster(GCG *gcg, SCIP *masterprob)
Definition: disp_master.c:110
#define DISP_NAME_ORIGINAL
Definition: disp_master.c:46
#define DISP_PRIO_ORIGINAL
Definition: disp_master.c:50
#define DISP_HEAD_ORIGINAL
Definition: disp_master.c:48
#define DISP_STRI_ORIGINAL
Definition: disp_master.c:52
master display columns
GCG interface methods.
SCIP_RETCODE SCIPincludeDispDefault(SCIP *scip)
SCIP * GCGgetOrigprob(GCG *gcg)
Definition: gcg.cpp:87
const char * SCIPdispGetName(SCIP_DISP *disp)
SCIP_DISPDATA * SCIPdispGetData(SCIP_DISP *disp)
SCIP_RETCODE SCIPincludeDisp(SCIP *scip, const char *name, const char *desc, const char *header, SCIP_DISPSTATUS dispstatus, SCIP_DECL_DISPCOPY((*dispcopy)), SCIP_DECL_DISPFREE((*dispfree)), SCIP_DECL_DISPINIT((*dispinit)), SCIP_DECL_DISPEXIT((*dispexit)), SCIP_DECL_DISPINITSOL((*dispinitsol)), SCIP_DECL_DISPEXITSOL((*dispexitsol)), SCIP_DECL_DISPOUTPUT((*dispoutput)), SCIP_DISPDATA *dispdata, int width, int priority, int position, SCIP_Bool stripline)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
#define NULL
Definition: struct_gcg.h:55
SCIP_DISPSTATUS_AUTO
SCIP_VERBLEVEL_HIGH
SCIP_OKAY
enum SCIP_Retcode SCIP_RETCODE