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-2014 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 /** resets reading time of reader */
97 extern
99  SCIP_READER* reader /**< reader */
100  );
101 
102 /** sets copy method of reader */
103 extern
104 void SCIPreaderSetCopy(
105  SCIP_READER* reader, /**< reader */
106  SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
107  );
108 
109 /** sets destructor of reader */
110 extern
111 void SCIPreaderSetFree(
112  SCIP_READER* reader, /**< reader */
113  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
114  );
115 
116 /** sets read method of reader */
117 extern
118 void SCIPreaderSetRead(
119  SCIP_READER* reader, /**< reader */
120  SCIP_DECL_READERREAD ((*readerread)) /**< read method */
121  );
122 
123 /** sets write method of reader */
124 extern
125 void SCIPreaderSetWrite(
126  SCIP_READER* reader, /**< reader */
127  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method */
128  );
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif
135