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 email to 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  const char* name, /**< name of reader */
53  const char* desc, /**< description of reader */
54  const char* extension, /**< file extension that reader processes */
55  SCIP_DECL_READERCOPY ((*readercopy)), /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
56  SCIP_DECL_READERFREE ((*readerfree)), /**< destructor of reader */
57  SCIP_DECL_READERREAD ((*readerread)), /**< read method */
58  SCIP_DECL_READERWRITE ((*readerwrite)), /**< write method */
59  SCIP_READERDATA* readerdata /**< reader data */
60  );
61 
62 /** frees memory of reader */
63 extern
65  SCIP_READER** reader, /**< pointer to reader data structure */
66  SCIP_SET* set /**< global SCIP settings */
67  );
68 
69 /** reads problem data from file with given reader or returns SCIP_DIDNOTRUN */
70 extern
72  SCIP_READER* reader, /**< reader */
73  SCIP_SET* set, /**< global SCIP settings */
74  const char* filename, /**< name of the input file */
75  const char* extension, /**< extension of the input file name */
76  SCIP_RESULT* result /**< pointer to store the result of the callback method */
77  );
78 
79 /** writes problem data to file with given reader or returns SCIP_DIDNOTRUN */
80 extern
82  SCIP_READER* reader, /**< reader */
83  SCIP_PROB* prob, /**< problem data */
84  SCIP_SET* set, /**< global SCIP settings */
85  FILE* file, /**< output file (or NULL for standard output) */
86  const char* format, /**< file format (or NULL) */
87  SCIP_Bool genericnames, /**< using generic variable and constraint names? */
88  SCIP_RESULT* result /**< pointer to store the result of the callback method */
89  );
90 
91 /** gets time in seconds used in this reader for reading */
92 extern
94  SCIP_READER* reader /**< reader */
95  );
96 
97 /** enables or disables all clocks of \p reader, depending on the value of the flag */
98 extern
100  SCIP_READER* reader, /**< the reader for which all clocks should be enabled or disabled */
101  SCIP_Bool enable /**< should the clocks be enabled? */
102  );
103 
104 /** resets reading time of reader */
105 extern
107  SCIP_READER* reader /**< reader */
108  );
109 
110 /** sets copy method of reader */
111 extern
112 void SCIPreaderSetCopy(
113  SCIP_READER* reader, /**< reader */
114  SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
115  );
116 
117 /** sets destructor of reader */
118 extern
119 void SCIPreaderSetFree(
120  SCIP_READER* reader, /**< reader */
121  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
122  );
123 
124 /** sets read method of reader */
125 extern
126 void SCIPreaderSetRead(
127  SCIP_READER* reader, /**< reader */
128  SCIP_DECL_READERREAD ((*readerread)) /**< read method */
129  );
130 
131 /** sets write method of reader */
132 extern
133 void SCIPreaderSetWrite(
134  SCIP_READER* reader, /**< reader */
135  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method */
136  );
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_RETCODE SCIPreaderCreate(SCIP_READER **reader, 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:65
SCIP_DECL_READERFREE(ReaderTSP::scip_free)
Definition: ReaderTSP.cpp:137
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for global SCIP settings
SCIP_DECL_READERWRITE(ReaderTSP::scip_write)
Definition: ReaderTSP.cpp:472
SCIP_RETCODE SCIPreaderCopyInclude(SCIP_READER *reader, SCIP_SET *set)
Definition: reader.c:47
type definitions for return codes for SCIP methods
void SCIPreaderSetFree(SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: reader.c:482
void SCIPreaderEnableOrDisableClocks(SCIP_READER *reader, SCIP_Bool enable)
Definition: reader.c:575
void SCIPreaderSetCopy(SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: reader.c:471
SCIP_Real SCIPreaderGetReadingTime(SCIP_READER *reader)
Definition: reader.c:565
void SCIPreaderSetWrite(SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: reader.c:504
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:37
#define SCIP_Bool
Definition: def.h:61
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:493
SCIP_RETCODE SCIPreaderRead(SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
Definition: reader.c:140
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:227
#define SCIP_Real
Definition: def.h:149
result codes for SCIP callback methods
public methods for input file readers
SCIP_RETCODE SCIPreaderFree(SCIP_READER **reader, SCIP_SET *set)
Definition: reader.c:99
SCIP_DECL_READERREAD(ReaderTSP::scip_read)
Definition: ReaderTSP.cpp:150
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:586
common defines and data types used in all packages of SCIP