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-2021 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 scipopt.org. */
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 */
43  SCIP_READER* reader, /**< reader */
44  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
45  );
46 
47 /** creates a reader */
49  SCIP_READER** reader, /**< pointer to store reader */
50  SCIP_SET* set, /**< global SCIP settings */
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 */
63  SCIP_READER** reader, /**< pointer to reader data structure */
64  SCIP_SET* set /**< global SCIP settings */
65  );
66 
67 /** reads problem data from file with given reader or returns SCIP_DIDNOTRUN */
69  SCIP_READER* reader, /**< reader */
70  SCIP_SET* set, /**< global SCIP settings */
71  const char* filename, /**< name of the input file */
72  const char* extension, /**< extension of the input file name */
73  SCIP_RESULT* result /**< pointer to store the result of the callback method */
74  );
75 
76 /** writes problem data to file with given reader or returns SCIP_DIDNOTRUN */
78  SCIP_READER* reader, /**< reader */
79  SCIP_PROB* prob, /**< problem data */
80  SCIP_SET* set, /**< global SCIP settings */
81  FILE* file, /**< output file (or NULL for standard output) */
82  const char* format, /**< file format (or NULL) */
83  SCIP_Bool genericnames, /**< using generic variable and constraint names? */
84  SCIP_RESULT* result /**< pointer to store the result of the callback method */
85  );
86 
87 /** gets time in seconds used in this reader for reading */
89  SCIP_READER* reader /**< reader */
90  );
91 
92 /** enables or disables all clocks of \p reader, depending on the value of the flag */
94  SCIP_READER* reader, /**< the reader for which all clocks should be enabled or disabled */
95  SCIP_Bool enable /**< should the clocks be enabled? */
96  );
97 
98 /** resets reading time of reader */
100  SCIP_READER* reader /**< reader */
101  );
102 
103 /** sets copy method of reader */
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 void SCIPreaderSetFree(
111  SCIP_READER* reader, /**< reader */
112  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
113  );
114 
115 /** sets read method of reader */
116 void SCIPreaderSetRead(
117  SCIP_READER* reader, /**< reader */
118  SCIP_DECL_READERREAD ((*readerread)) /**< read method */
119  );
120 
121 /** sets write method of reader */
122 void SCIPreaderSetWrite(
123  SCIP_READER* reader, /**< reader */
124  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method */
125  );
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
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:104
type definitions for global SCIP settings
SCIP_DECL_READERWRITE(ReaderTSP::scip_write)
Definition: ReaderTSP.cpp:487
SCIP_RETCODE SCIPreaderCopyInclude(SCIP_READER *reader, SCIP_SET *set)
Definition: reader.c:49
type definitions for return codes for SCIP methods
void SCIPreaderSetFree(SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: reader.c:515
void SCIPreaderEnableOrDisableClocks(SCIP_READER *reader, SCIP_Bool enable)
Definition: reader.c:608
void SCIPreaderSetCopy(SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: reader.c:504
SCIP_Real SCIPreaderGetReadingTime(SCIP_READER *reader)
Definition: reader.c:598
void SCIPreaderSetWrite(SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: reader.c:537
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:44
#define SCIP_Bool
Definition: def.h:70
type definitions for input file readers
type definitions for storing and manipulating the main problem
#define SCIP_DECL_READERCOPY(x)
Definition: type_reader.h:53
void SCIPreaderSetRead(SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: reader.c:526
SCIP_RETCODE SCIPreaderRead(SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
Definition: reader.c:174
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:261
#define SCIP_Real
Definition: def.h:163
result codes for SCIP callback methods
public methods for input file readers
SCIP_RETCODE SCIPreaderFree(SCIP_READER **reader, SCIP_SET *set)
Definition: reader.c:130
#define SCIP_DECL_READERREAD(x)
Definition: type_reader.h:78
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:619
common defines and data types used in all packages of SCIP
#define SCIP_DECL_READERFREE(x)
Definition: type_reader.h:62