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-2025 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file reader.h
26 * @ingroup INTERNALAPI
27 * @brief internal methods for input file readers
28 * @author Tobias Achterberg
29 */
30
31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32
33#ifndef __SCIP_READER_H__
34#define __SCIP_READER_H__
35
36
37#include "scip/def.h"
38#include "scip/type_prob.h"
39#include "scip/type_retcode.h"
40#include "scip/type_result.h"
41#include "scip/type_set.h"
42#include "scip/type_reader.h"
43#include "scip/pub_reader.h"
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49
50/** copies the given reader to a new scip */
52 SCIP_READER* reader, /**< reader */
53 SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
54 );
55
56/** creates a reader */
58 SCIP_READER** reader, /**< pointer to store reader */
59 SCIP_SET* set, /**< global SCIP settings */
60 const char* name, /**< name of reader */
61 const char* desc, /**< description of reader */
62 const char* extension, /**< file extension that reader processes */
63 SCIP_DECL_READERCOPY ((*readercopy)), /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
64 SCIP_DECL_READERFREE ((*readerfree)), /**< destructor of reader */
65 SCIP_DECL_READERREAD ((*readerread)), /**< read method */
66 SCIP_DECL_READERWRITE ((*readerwrite)), /**< write method */
67 SCIP_READERDATA* readerdata /**< reader data */
68 );
69
70/** frees memory of reader */
72 SCIP_READER** reader, /**< pointer to reader data structure */
73 SCIP_SET* set /**< global SCIP settings */
74 );
75
76/** reads problem data from file with given reader or returns SCIP_DIDNOTRUN */
78 SCIP_READER* reader, /**< reader */
79 SCIP_SET* set, /**< global SCIP settings */
80 const char* filename, /**< name of the input file */
81 const char* extension, /**< extension of the input file name */
82 SCIP_RESULT* result /**< pointer to store the result of the callback method */
83 );
84
85/** writes problem data to file with given reader or returns SCIP_DIDNOTRUN */
87 SCIP_READER* reader, /**< reader */
88 SCIP_PROB* prob, /**< problem data */
89 SCIP_SET* set, /**< global SCIP settings */
90 SCIP_MESSAGEHDLR* msghdlr, /**< message handler */
91 FILE* file, /**< output file (or NULL for standard output) */
92 const char* filename, /**< name of output file, or NULL if not available */
93 const char* format, /**< file format (or NULL) */
94 SCIP_Bool genericnames, /**< using generic variable and constraint names? */
95 SCIP_RESULT* result /**< pointer to store the result of the callback method */
96 );
97
98/** gets time in seconds used in this reader for reading */
100 SCIP_READER* reader /**< reader */
101 );
102
103/** enables or disables all clocks of \p reader, depending on the value of the flag */
105 SCIP_READER* reader, /**< the reader for which all clocks should be enabled or disabled */
106 SCIP_Bool enable /**< should the clocks be enabled? */
107 );
108
109/** resets reading time of reader */
111 SCIP_READER* reader /**< reader */
112 );
113
114/** sets copy method of reader */
116 SCIP_READER* reader, /**< reader */
117 SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
118 );
119
120/** sets destructor of reader */
122 SCIP_READER* reader, /**< reader */
123 SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
124 );
125
126/** sets read method of reader */
128 SCIP_READER* reader, /**< reader */
129 SCIP_DECL_READERREAD ((*readerread)) /**< read method */
130 );
131
132/** sets write method of reader */
134 SCIP_READER* reader, /**< reader */
135 SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method */
136 );
137
138#ifdef __cplusplus
139}
140#endif
141
142#endif
SCIP_DECL_READERREAD(ReaderTSP::scip_read)
Definition: ReaderTSP.cpp:211
SCIP_DECL_READERWRITE(ReaderTSP::scip_write)
Definition: ReaderTSP.cpp:546
SCIP_DECL_READERFREE(ReaderTSP::scip_free)
Definition: ReaderTSP.cpp:198
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:156
public methods for input file readers
SCIP_RETCODE SCIPreaderFree(SCIP_READER **reader, SCIP_SET *set)
Definition: reader.c:139
void SCIPreaderSetFree(SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: reader.c:637
void SCIPreaderSetCopy(SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: reader.c:626
SCIP_RETCODE SCIPreaderWrite(SCIP_READER *reader, SCIP_PROB *prob, SCIP_SET *set, SCIP_MESSAGEHDLR *msghdlr, FILE *file, const char *filename, const char *format, SCIP_Bool genericnames, SCIP_RESULT *result)
Definition: reader.c:277
SCIP_Real SCIPreaderGetReadingTime(SCIP_READER *reader)
Definition: reader.c:730
SCIP_RETCODE SCIPreaderCopyInclude(SCIP_READER *reader, SCIP_SET *set)
Definition: reader.c:57
SCIP_RETCODE SCIPreaderRead(SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
Definition: reader.c:183
void SCIPreaderSetWrite(SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: reader.c:659
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:113
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:751
void SCIPreaderEnableOrDisableClocks(SCIP_READER *reader, SCIP_Bool enable)
Definition: reader.c:740
void SCIPreaderSetRead(SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: reader.c:648
Definition: heur_padm.c:135
type definitions for storing and manipulating the main problem
type definitions for input file readers
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:54
#define SCIP_DECL_READERCOPY(x)
Definition: type_reader.h:63
result codes for SCIP callback methods
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for global SCIP settings