Scippy

SCIP

Solving Constraint Integer Programs

reader_tim.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_tim.h
26  * @ingroup FILEREADERS
27  * @brief TIM file reader - the stage information for a stochastic programming instance in SMPS format
28  * @author Stephen J. Maher
29  *
30  * This is a reader for the time 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  * Details regarding the SMPS file format can be found at:
40  * Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
41  * A standard input format for multiperiod stochastic linear programs
42  * IIASA, Laxenburg, Austria, WP-87-118, 1987
43  *
44  */
45 
46 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
47 
48 #ifndef __SCIP_READER_TIM_H__
49 #define __SCIP_READER_TIM_H__
50 
51 #include "scip/def.h"
52 #include "scip/type_cons.h"
53 #include "scip/type_reader.h"
54 #include "scip/type_result.h"
55 #include "scip/type_retcode.h"
56 #include "scip/type_scip.h"
57 #include "scip/type_var.h"
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 /** includes the tim file reader into SCIP
64  *
65  * @ingroup FileReaderIncludes
66  */
67 SCIP_EXPORT
69  SCIP* scip /**< SCIP data structure */
70  );
71 
72 /**@addtogroup FILEREADERS
73  *
74  * @{
75  */
76 
77 /** reads the stage information for a stochastic programming instance in SMPS format */
78 SCIP_EXPORT
80  SCIP* scip, /**< SCIP data structure */
81  const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
82  SCIP_RESULT* result /**< pointer to store the result of the file reading call */
83  );
84 
85 /** @} */
86 
87 /*
88  * Interface methods for the cor and sto files
89  */
90 
91 /* return whether the tim file has been read */
92 SCIP_EXPORT
94  SCIP_READER* reader /**< the file reader itself */
95  );
96 
97 /* returns the number of stages */
98 SCIP_EXPORT
100  SCIP* scip /**< SCIP data structure */
101  );
102 
103 /* returns the name for a given stage */
104 SCIP_EXPORT
105 const char* SCIPtimGetStageName(
106  SCIP* scip, /**< SCIP data structure */
107  int stagenum /**< the number of the requested stage */
108  );
109 
110 /* returns the stage name for a given constraint name */
111 const char* SCIPtimConsGetStageName(
112  SCIP* scip, /**< SCIP data structure */
113  const char* consname /**< the constraint to search for */
114  );
115 
116 /* returns the number for a given stage */
117 SCIP_EXPORT
118 int SCIPtimFindStage(
119  SCIP* scip, /**< SCIP data structure */
120  const char* stage /**< the name of the requested stage */
121  );
122 
123 /* returns the array of variables for a given stage */
124 SCIP_EXPORT
126  SCIP* scip, /**< SCIP data structure */
127  int stagenum /**< the number of the requested stage */
128  );
129 
130 /* returns an array of constraints for a given stage */
131 SCIP_EXPORT
133  SCIP* scip, /**< SCIP data structure */
134  int stagenum /**< the number of the requested stage */
135  );
136 
137 /* returns the number of variables for a given stage */
138 SCIP_EXPORT
140  SCIP* scip, /**< SCIP data structure */
141  int stagenum /**< the number of the requested stage */
142  );
143 
144 /* returns the number of constraints for a given stage */
145 SCIP_EXPORT
147  SCIP* scip, /**< SCIP data structure */
148  int stagenum /**< the number of the requested stage */
149  );
150 
151 #ifdef __cplusplus
152 }
153 #endif
154 
155 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
SCIP_RETCODE SCIPreadTim(SCIP *scip, const char *filename, SCIP_RESULT *result)
Definition: reader_tim.c:878
const char * SCIPtimGetStageName(SCIP *scip, int stagenum)
Definition: reader_tim.c:957
int SCIPtimGetStageNConss(SCIP *scip, int stagenum)
Definition: reader_tim.c:1120
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for return codes for SCIP methods
SCIP_Bool SCIPtimHasRead(SCIP_READER *reader)
Definition: reader_tim.c:921
type definitions for SCIP&#39;s main datastructure
const char * SCIPtimConsGetStageName(SCIP *scip, const char *consname)
Definition: reader_tim.c:978
int SCIPtimGetStageNVars(SCIP *scip, int stagenum)
Definition: reader_tim.c:1099
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:91
type definitions for input file readers
int SCIPtimGetNStages(SCIP *scip)
Definition: reader_tim.c:938
SCIP_CONS ** SCIPtimGetStageConss(SCIP *scip, int stagenum)
Definition: reader_tim.c:1078
int SCIPtimFindStage(SCIP *scip, const char *stage)
Definition: reader_tim.c:1019
result codes for SCIP callback methods
common defines and data types used in all packages of SCIP
SCIP_VAR ** SCIPtimGetStageVars(SCIP *scip, int stagenum)
Definition: reader_tim.c:1057
type definitions for constraints and constraint handlers
SCIP_RETCODE SCIPincludeReaderTim(SCIP *scip)
Definition: reader_tim.c:854