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