Scippy

SCIP

Solving Constraint Integer Programs

type_reader.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
4/* SCIP --- Solving Constraint Integer Programs */
5/* */
6/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file type_reader.h
26 * @ingroup TYPEDEFINITIONS
27 * @brief type definitions for input file readers
28 * @author Tobias Achterberg
29 */
30
31/** @defgroup DEFPLUGINS_READER Default Readers
32 * @ingroup DEFPLUGINS
33 * @brief implementation files (.c files) of the default readers of SCIP
34 */
35
36/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37
38#ifndef __SCIP_TYPE_READER_H__
39#define __SCIP_TYPE_READER_H__
40
41#include "scip/def.h"
42#include "scip/type_rational.h"
43#include "scip/type_cons.h"
44#include "scip/type_retcode.h"
45#include "scip/type_result.h"
46#include "scip/type_scip.h"
47#include "scip/type_var.h"
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53typedef struct SCIP_Reader SCIP_READER; /**< reader data structure */
54typedef struct SCIP_ReaderData SCIP_READERDATA; /**< reader specific data */
55
56
57/** copy method for reader plugins (called when SCIP copies plugins)
58 *
59 * input:
60 * - scip : SCIP main data structure
61 * - reader : the reader itself
62 */
63#define SCIP_DECL_READERCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER* reader)
64
65
66/** destructor of reader to free user data (called when SCIP is exiting)
67 *
68 * input:
69 * - scip : SCIP main data structure
70 * - reader : the reader itself
71 */
72#define SCIP_DECL_READERFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER* reader)
73
74/** problem reading method of reader
75 *
76 * input:
77 * - scip : SCIP main data structure
78 * - reader : the reader itself
79 * - filename : full path and name of file to read, or NULL if stdin should be used
80 * - result : pointer to store the result of the file reading call
81 *
82 * possible return values for *result:
83 * - SCIP_SUCCESS : the reader read the file correctly and created an appropriate problem
84 * - SCIP_DIDNOTRUN : the reader is not responsible for given input file
85 *
86 * If the reader detected an error in the input file, it should return with RETCODE SCIP_READERROR or SCIP_NOFILE.
87 */
88#define SCIP_DECL_READERREAD(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER* reader, const char* filename, SCIP_RESULT* result)
89
90/** problem writing method of reader; NOTE: if the parameter "genericnames" is TRUE, then
91 * SCIP already set all variable and constraint names to generic names; therefore, this
92 * method should always use SCIPvarGetName() and SCIPconsGetName();
93 *
94 * input:
95 * - scip : SCIP main data structure
96 * - reader : the reader itself
97 * - file : output file, or NULL if standard output should be used
98 * - filename : name of output file, if available, otherwise NULL
99 * - name : problem name
100 * - probdata : user problem data set by the reader
101 * - transformed : TRUE iff problem is the transformed problem
102 * - objsense : objective sense
103 * - objoffset : objective offset from bound shifting and fixing
104 * - objscale : scalar applied to objective function; external objective value is
105 extobj = objsense * objscale * (intobj + objoffset)
106 * - objoffsetexact : exact objective offset from bound shifting and fixing
107 * - objscaleexact : exact scalar applied to objective function; external objective value is
108 extobjexact = objsense * objscaleexact * (intobjexact + objoffsetexact)
109 * - vars : array with active variables ordered binary, integer, implicit, continuous
110 * - nvars : number of active variables in the problem
111 * - nbinvars : number of binary variables
112 * - nintvars : number of general integer variables
113 * - nimplvars : number of implicit integer variables
114 * - ncontvars; : number of continuous variables
115 * - fixedvars : array with fixed and aggregated variables
116 * - nfixedvars : number of fixed and aggregated variables in the problem
117 * - startnvars : number of variables existing when problem solving started
118 * - conss : array with constraints of the problem
119 * - nconss : number of constraints in the problem
120 * - maxnconss : maximum number of constraints existing at the same time
121 * - startnconss : number of constraints existing when problem solving started
122 * - genericnames : using generic variable and constraint names?
123 * - result : pointer to store the result of the file reading call
124 *
125 * possible return values for *result:
126 * - SCIP_SUCCESS : the reader wrote the file correctly
127 * - SCIP_DIDNOTRUN : the reader is not responsible for given input file
128 *
129 * If the reader detected an error while writing the output file, it should return with RETCODE SCIP_WRITEERROR
130 */
131#define SCIP_DECL_READERWRITE(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER* reader, FILE* file, \
132 const char* filename, const char* name, SCIP_PROBDATA* probdata, SCIP_Bool transformed, \
133 SCIP_OBJSENSE objsense, SCIP_Real objoffset, SCIP_Real objscale, \
134 SCIP_RATIONAL* objoffsetexact, SCIP_RATIONAL* objscaleexact, \
135 SCIP_VAR** vars, int nvars, int nbinvars, int nintvars, int nimplvars, int ncontvars, \
136 SCIP_VAR** fixedvars, int nfixedvars, int startnvars, \
137 SCIP_CONS** conss, int nconss, int maxnconss, int startnconss, \
138 SCIP_Bool genericnames, SCIP_RESULT* result)
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif
common defines and data types used in all packages of SCIP
type definitions for constraints and constraint handlers
type definitions for rational numbers
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:54
result codes for SCIP callback methods
type definitions for return codes for SCIP methods
type definitions for SCIP's main datastructure
type definitions for problem variables