Scippy

SCIP

Solving Constraint Integer Programs

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 reader.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for input file readers
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_READER_H__
25 #define __SCIP_READER_H__
26 
27 
28 #include "scip/def.h"
29 #include "scip/type_prob.h"
30 #include "scip/type_retcode.h"
31 #include "scip/type_result.h"
32 #include "scip/type_set.h"
33 #include "scip/type_reader.h"
34 #include "scip/pub_reader.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 /** copies the given reader to a new scip */
42 extern
44  SCIP_READER* reader, /**< reader */
45  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
46  );
47 
48 /** creates a reader */
49 extern
51  SCIP_READER** reader, /**< pointer to store reader */
52  SCIP_SET* set, /**< global SCIP settings */
53  const char* name, /**< name of reader */
54  const char* desc, /**< description of reader */
55  const char* extension, /**< file extension that reader processes */
56  SCIP_DECL_READERCOPY ((*readercopy)), /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
57  SCIP_DECL_READERFREE ((*readerfree)), /**< destructor of reader */
58  SCIP_DECL_READERREAD ((*readerread)), /**< read method */
59  SCIP_DECL_READERWRITE ((*readerwrite)), /**< write method */
60  SCIP_READERDATA* readerdata /**< reader data */
61  );
62 
63 /** frees memory of reader */
64 extern
66  SCIP_READER** reader, /**< pointer to reader data structure */
67  SCIP_SET* set /**< global SCIP settings */
68  );
69 
70 /** reads problem data from file with given reader or returns SCIP_DIDNOTRUN */
71 extern
73  SCIP_READER* reader, /**< reader */
74  SCIP_SET* set, /**< global SCIP settings */
75  const char* filename, /**< name of the input file */
76  const char* extension, /**< extension of the input file name */
77  SCIP_RESULT* result /**< pointer to store the result of the callback method */
78  );
79 
80 /** writes problem data to file with given reader or returns SCIP_DIDNOTRUN */
81 extern
83  SCIP_READER* reader, /**< reader */
84  SCIP_PROB* prob, /**< problem data */
85  SCIP_SET* set, /**< global SCIP settings */
86  FILE* file, /**< output file (or NULL for standard output) */
87  const char* format, /**< file format (or NULL) */
88  SCIP_Bool genericnames, /**< using generic variable and constraint names? */
89  SCIP_RESULT* result /**< pointer to store the result of the callback method */
90  );
91 
92 /** gets time in seconds used in this reader for reading */
93 extern
95  SCIP_READER* reader /**< reader */
96  );
97 
98 /** enables or disables all clocks of \p reader, depending on the value of the flag */
99 extern
101  SCIP_READER* reader, /**< the reader for which all clocks should be enabled or disabled */
102  SCIP_Bool enable /**< should the clocks be enabled? */
103  );
104 
105 /** resets reading time of reader */
106 extern
108  SCIP_READER* reader /**< reader */
109  );
110 
111 /** sets copy method of reader */
112 extern
113 void SCIPreaderSetCopy(
114  SCIP_READER* reader, /**< reader */
115  SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
116  );
117 
118 /** sets destructor of reader */
119 extern
120 void SCIPreaderSetFree(
121  SCIP_READER* reader, /**< reader */
122  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
123  );
124 
125 /** sets read method of reader */
126 extern
127 void SCIPreaderSetRead(
128  SCIP_READER* reader, /**< reader */
129  SCIP_DECL_READERREAD ((*readerread)) /**< read method */
130  );
131 
132 /** sets write method of reader */
133 extern
134 void SCIPreaderSetWrite(
135  SCIP_READER* reader, /**< reader */
136  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method */
137  );
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPreaderCreate(SCIP_READER **reader, SCIP_SET *set, 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: reader.c:103
type definitions for global SCIP settings
SCIP_DECL_READERWRITE(ReaderTSP::scip_write)
Definition: ReaderTSP.cpp:483
SCIP_RETCODE SCIPreaderCopyInclude(SCIP_READER *reader, SCIP_SET *set)
Definition: reader.c:48
type definitions for return codes for SCIP methods
void SCIPreaderSetFree(SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: reader.c:514
void SCIPreaderEnableOrDisableClocks(SCIP_READER *reader, SCIP_Bool enable)
Definition: reader.c:607
void SCIPreaderSetCopy(SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: reader.c:503
SCIP_Real SCIPreaderGetReadingTime(SCIP_READER *reader)
Definition: reader.c:597
void SCIPreaderSetWrite(SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: reader.c:536
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:37
#define SCIP_Bool
Definition: def.h:62
type definitions for input file readers
type definitions for storing and manipulating the main problem
#define SCIP_DECL_READERCOPY(x)
Definition: type_reader.h:46
void SCIPreaderSetRead(SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: reader.c:525
SCIP_RETCODE SCIPreaderRead(SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
Definition: reader.c:173
SCIP_RETCODE SCIPreaderWrite(SCIP_READER *reader, SCIP_PROB *prob, SCIP_SET *set, FILE *file, const char *format, SCIP_Bool genericnames, SCIP_RESULT *result)
Definition: reader.c:260
#define SCIP_Real
Definition: def.h:150
result codes for SCIP callback methods
public methods for input file readers
SCIP_RETCODE SCIPreaderFree(SCIP_READER **reader, SCIP_SET *set)
Definition: reader.c:129
#define SCIP_DECL_READERREAD(x)
Definition: type_reader.h:71
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:618
common defines and data types used in all packages of SCIP
#define SCIP_DECL_READERFREE(x)
Definition: type_reader.h:55