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