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-2023 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_cons.h"
43 #include "scip/type_retcode.h"
44 #include "scip/type_result.h"
45 #include "scip/type_scip.h"
46 #include "scip/type_var.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 typedef struct SCIP_Reader SCIP_READER; /**< reader data structure */
53 typedef struct SCIP_ReaderData SCIP_READERDATA; /**< reader specific data */
54 
55 
56 /** copy method for reader plugins (called when SCIP copies plugins)
57  *
58  * input:
59  * - scip : SCIP main data structure
60  * - reader : the reader itself
61  */
62 #define SCIP_DECL_READERCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER* reader)
63 
64 
65 /** destructor of reader to free user data (called when SCIP is exiting)
66  *
67  * input:
68  * - scip : SCIP main data structure
69  * - reader : the reader itself
70  */
71 #define SCIP_DECL_READERFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER* reader)
72 
73 /** problem reading method of reader
74  *
75  * input:
76  * - scip : SCIP main data structure
77  * - reader : the reader itself
78  * - filename : full path and name of file to read, or NULL if stdin should be used
79  * - result : pointer to store the result of the file reading call
80  *
81  * possible return values for *result:
82  * - SCIP_SUCCESS : the reader read the file correctly and created an appropriate problem
83  * - SCIP_DIDNOTRUN : the reader is not responsible for given input file
84  *
85  * If the reader detected an error in the input file, it should return with RETCODE SCIP_READERROR or SCIP_NOFILE.
86  */
87 #define SCIP_DECL_READERREAD(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER* reader, const char* filename, SCIP_RESULT* result)
88 
89 /** problem writing method of reader; NOTE: if the parameter "genericnames" is TRUE, then
90  * SCIP already set all variable and constraint names to generic names; therefore, this
91  * method should always use SCIPvarGetName() and SCIPconsGetName();
92  *
93  * input:
94  * - scip : SCIP main data structure
95  * - reader : the reader itself
96  * - file : output file, or NULL if standard output should be used
97  * - name : problem name
98  * - probdata : user problem data set by the reader
99  * - transformed : TRUE iff problem is the transformed problem
100  * - objsense : objective sense
101  * - objscale : scalar applied to objective function; external objective value is
102  extobj = objsense * objscale * (intobj + objoffset)
103  * - objoffset : objective offset from bound shifting and fixing
104  * - vars : array with active variables ordered binary, integer, implicit, continuous
105  * - nvars : number of active variables in the problem
106  * - nbinvars : number of binary variables
107  * - nintvars : number of general integer variables
108  * - nimplvars : number of implicit integer variables
109  * - ncontvars; : number of continuous variables
110  * - fixedvars : array with fixed and aggregated variables
111  * - nfixedvars : number of fixed and aggregated variables in the problem
112  * - startnvars : number of variables existing when problem solving started
113  * - conss : array with constraints of the problem
114  * - nconss : number of constraints in the problem
115  * - maxnconss : maximum number of constraints existing at the same time
116  * - startnconss : number of constraints existing when problem solving started
117  * - genericnames : using generic variable and constraint names?
118  * - result : pointer to store the result of the file reading call
119  *
120  * possible return values for *result:
121  * - SCIP_SUCCESS : the reader wrote the file correctly
122  * - SCIP_DIDNOTRUN : the reader is not responsible for given input file
123  *
124  * If the reader detected an error while writing the output file, it should return with RETCODE SCIP_WRITEERROR
125  */
126 #define SCIP_DECL_READERWRITE(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER* reader, FILE* file, \
127  const char* name, SCIP_PROBDATA* probdata, SCIP_Bool transformed, \
128  SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset, \
129  SCIP_VAR** vars, int nvars, int nbinvars, int nintvars, int nimplvars, int ncontvars, \
130  SCIP_VAR** fixedvars, int nfixedvars, int startnvars, \
131  SCIP_CONS** conss, int nconss, int maxnconss, int startnconss, \
132  SCIP_Bool genericnames, SCIP_RESULT* result)
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif
type definitions for return codes for SCIP methods
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:53
result codes for SCIP callback methods
common defines and data types used in all packages of SCIP
type definitions for constraints and constraint handlers