Scippy

SCIP

Solving Constraint Integer Programs

reader_cor.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-2022 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_cor.h
17  * @ingroup FILEREADERS
18  * @brief COR file reader (MPS format of the core problem for stochastic programs)
19  * @author Stephen J. Maher
20  *
21  * This is a reader for the core file of a stochastic programming instance in SMPS format.
22  * The three files that must be read are:
23  * - .cor
24  * - .tim
25  * - .sto
26  *
27  * Alternatively, it is possible to create a .smps file with the relative path to the .cor, .tim and .sto files.
28  * A file reader is available for the .smps file.
29  *
30  * The core file is in the form of an MPS.
31  *
32  * Details regarding the SMPS file format can be found at:
33  * Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
34  * A standard input format for multiperiod stochastic linear programs
35  * IIASA, Laxenburg, Austria, WP-87-118, 1987
36  *
37  */
38 
39 
40 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
41 
42 #ifndef __SCIP_READER_COR_H__
43 #define __SCIP_READER_COR_H__
44 
45 #include "scip/def.h"
46 #include "scip/type_reader.h"
47 #include "scip/type_result.h"
48 #include "scip/type_retcode.h"
49 #include "scip/type_scip.h"
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /** includes the cor file reader into SCIP
56  *
57  * @ingroup FileReaderIncludes
58  */
59 SCIP_EXPORT
61  SCIP* scip /**< SCIP data structure */
62  );
63 
64 /**@addtogroup FILEREADERS
65  *
66  * @{
67  */
68 
69 /** reads problem from file */
70 SCIP_EXPORT
72  SCIP* scip, /**< SCIP data structure */
73  const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
74  SCIP_RESULT* result /**< pointer to store the result of the file reading call */
75  );
76 
77 /*
78  * Interface method for the tim and sto readers
79  */
80 
81 /** returns whether the COR file has been successfully read. This is used by the TIM and STO readers. */
82 SCIP_EXPORT
84  SCIP_READER* reader /**< the file reader itself */
85  );
86 
87 /** returns the number of variable names in the COR problem */
88 SCIP_EXPORT
90  SCIP_READER* reader /**< the file reader itself */
91  );
92 
93 /** returns the number of constraint names in the COR problem */
94 SCIP_EXPORT
96  SCIP_READER* reader /**< the file reader itself */
97  );
98 
99 /** returns the variable name for the given index */
100 SCIP_EXPORT
101 const char* SCIPcorGetVarName(
102  SCIP_READER* reader, /**< the file reader itself */
103  int i /**< the index of the variable that is requested */
104  );
105 
106 /** returns the constraint name for the given index */
107 SCIP_EXPORT
108 const char* SCIPcorGetConsName(
109  SCIP_READER* reader, /**< the file reader itself */
110  int i /**< the index of the constraint that is requested */
111  );
112 
113 /** @} */
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
const char * SCIPcorGetVarName(SCIP_READER *reader, int i)
Definition: reader_cor.c:256
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
type definitions for return codes for SCIP methods
const char * SCIPcorGetConsName(SCIP_READER *reader, int i)
Definition: reader_cor.c:274
type definitions for SCIP&#39;s main datastructure
int SCIPcorGetNConsNames(SCIP_READER *reader)
Definition: reader_cor.c:240
#define SCIP_Bool
Definition: def.h:84
type definitions for input file readers
SCIP_RETCODE SCIPreadCor(SCIP *scip, const char *filename, SCIP_RESULT *result)
Definition: reader_cor.c:178
SCIP_RETCODE SCIPincludeReaderCor(SCIP *scip)
Definition: reader_cor.c:151
SCIP_Bool SCIPcorHasRead(SCIP_READER *reader)
Definition: reader_cor.c:208
result codes for SCIP callback methods
int SCIPcorGetNVarNames(SCIP_READER *reader)
Definition: reader_cor.c:224
common defines and data types used in all packages of SCIP