Scippy

SCIP

Solving Constraint Integer Programs

scip_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-2018 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_reader.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for reader plugins
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Robert Lion Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_READER_H__
32 #define __SCIP_SCIP_READER_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_cons.h"
37 #include "scip/type_prob.h"
38 #include "scip/type_reader.h"
39 #include "scip/type_result.h"
40 #include "scip/type_retcode.h"
41 #include "scip/type_scip.h"
42 #include "scip/type_var.h"
43 
44 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
45  * this structure except the interface methods in scip.c.
46  * In optimized mode, the structure is included in scip.h, because some of the methods
47  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
48  * Additionally, the internal "set.h" is included, such that the defines in set.h are
49  * available in optimized mode.
50  */
51 #ifdef NDEBUG
52 #include "scip/struct_scip.h"
53 #include "scip/struct_stat.h"
54 #include "scip/set.h"
55 #include "scip/tree.h"
56 #include "scip/misc.h"
57 #include "scip/var.h"
58 #include "scip/cons.h"
59 #include "scip/solve.h"
60 #include "scip/debug.h"
61 #endif
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 /**@addtogroup PublicReaderMethods
68  *
69  * @{
70  */
71 
72 /** creates a reader and includes it in SCIP
73  *
74  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
75  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
76  *
77  * @pre This method can be called if SCIP is in one of the following stages:
78  * - \ref SCIP_STAGE_INIT
79  * - \ref SCIP_STAGE_PROBLEM
80  *
81  * @note method has all reader callbacks as arguments and is thus changed every time a new callback is added
82  * in future releases; consider using SCIPincludeReaderBasic() and setter functions
83  * if you seek for a method which is less likely to change in future releases
84  */
85 extern
87  SCIP* scip, /**< SCIP data structure */
88  const char* name, /**< name of reader */
89  const char* desc, /**< description of reader */
90  const char* extension, /**< file extension that reader processes */
91  SCIP_DECL_READERCOPY ((*readercopy)), /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
92  SCIP_DECL_READERFREE ((*readerfree)), /**< destructor of reader */
93  SCIP_DECL_READERREAD ((*readerread)), /**< read method */
94  SCIP_DECL_READERWRITE ((*readerwrite)), /**< write method */
95  SCIP_READERDATA* readerdata /**< reader data */
96  );
97 
98 /** creates a reader and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
99  * Optional callbacks can be set via specific setter functions, see
100  * SCIPsetReaderCopy(), SCIPsetReaderFree(), SCIPsetReaderRead(), SCIPsetReaderWrite().
101  *
102  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
103  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
104  *
105  * @pre This method can be called if SCIP is in one of the following stages:
106  * - \ref SCIP_STAGE_INIT
107  * - \ref SCIP_STAGE_PROBLEM
108  *
109  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeReader() instead
110  */
111 extern
113  SCIP* scip, /**< SCIP data structure */
114  SCIP_READER** readerptr, /**< reference to reader pointer, or NULL */
115  const char* name, /**< name of reader */
116  const char* desc, /**< description of reader */
117  const char* extension, /**< file extension that reader processes */
118  SCIP_READERDATA* readerdata /**< reader data */
119  );
120 
121 /** set copy method of reader
122  *
123  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
124  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
125  *
126  * @pre This method can be called if SCIP is in one of the following stages:
127  * - \ref SCIP_STAGE_INIT
128  * - \ref SCIP_STAGE_PROBLEM
129  */
130 extern
132  SCIP* scip, /**< SCIP data structure */
133  SCIP_READER* reader, /**< reader */
134  SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
135  );
136 
137 /** set deinitialization method of reader
138  *
139  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
140  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
141  *
142  * @pre This method can be called if SCIP is in one of the following stages:
143  * - \ref SCIP_STAGE_INIT
144  * - \ref SCIP_STAGE_PROBLEM
145  */
146 extern
148  SCIP* scip, /**< SCIP data structure */
149  SCIP_READER* reader, /**< reader */
150  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
151  );
152 
153 /** set read method of reader
154  *
155  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
156  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
157  *
158  * @pre This method can be called if SCIP is in one of the following stages:
159  * - \ref SCIP_STAGE_INIT
160  * - \ref SCIP_STAGE_PROBLEM
161  */
162 extern
164  SCIP* scip, /**< SCIP data structure */
165  SCIP_READER* reader, /**< reader */
166  SCIP_DECL_READERREAD ((*readerread)) /**< read method of reader */
167  );
168 
169 /** set write method of reader
170  *
171  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
172  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
173  *
174  * @pre This method can be called if SCIP is in one of the following stages:
175  * - \ref SCIP_STAGE_INIT
176  * - \ref SCIP_STAGE_PROBLEM
177  */
178 extern
180  SCIP* scip, /**< SCIP data structure */
181  SCIP_READER* reader, /**< reader */
182  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method of reader */
183  );
184 
185 /** returns the reader of the given name, or NULL if not existing */
186 extern
188  SCIP* scip, /**< SCIP data structure */
189  const char* name /**< name of reader */
190  );
191 
192 /** returns the array of currently available readers */
193 extern
195  SCIP* scip /**< SCIP data structure */
196  );
197 
198 /** returns the number of currently available readers */
199 extern
200 int SCIPgetNReaders(
201  SCIP* scip /**< SCIP data structure */
202  );
203 
204 /* @} */
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif
internal methods for branch and bound tree
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_DECL_READERWRITE(ReaderTSP::scip_write)
Definition: ReaderTSP.cpp:483
SCIP_READER * SCIPfindReader(SCIP *scip, const char *name)
Definition: scip_reader.c:306
type definitions for return codes for SCIP methods
SCIP_READER ** SCIPgetReaders(SCIP *scip)
Definition: scip_reader.c:319
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
internal methods for global SCIP settings
SCIP main data structure.
type definitions for problem variables
internal methods for problem variables
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:37
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
Definition: scip_reader.c:180
type definitions for input file readers
methods for debugging
SCIP_RETCODE SCIPincludeReader(SCIP *scip, const char *name, const char *desc, const char *extension, SCIP_DECL_READERCOPY((*readercopy)), SCIP_DECL_READERFREE((*readerfree)), SCIP_DECL_READERREAD((*readerread)), SCIP_DECL_READERWRITE((*readerwrite)), SCIP_READERDATA *readerdata)
Definition: scip_reader.c:137
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: scip_reader.c:290
datastructures for problem statistics
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: scip_reader.c:218
type definitions for storing and manipulating the main problem
#define SCIP_DECL_READERCOPY(x)
Definition: type_reader.h:46
internal methods for main solving loop and node processing
int SCIPgetNReaders(SCIP *scip)
Definition: scip_reader.c:330
result codes for SCIP callback methods
#define SCIP_DECL_READERREAD(x)
Definition: type_reader.h:71
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: scip_reader.c:266
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: scip_reader.c:242
type definitions for constraints and constraint handlers
#define SCIP_DECL_READERFREE(x)
Definition: type_reader.h:55