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-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_tim.h
17  * @ingroup FILEREADERS
18  * @brief TIM file reader - the stage information for a stochastic programming instance in SMPS format
19  * @author Stephen J. Maher
20  *
21  * This is a reader for the time 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  * Details regarding the SMPS file format can be found at:
31  * Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
32  * A standard input format for multiperiod stochastic linear programs
33  * IIASA, Laxenburg, Austria, WP-87-118, 1987
34  *
35  */
36 
37 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
38 
39 #ifndef __SCIP_READER_TIM_H__
40 #define __SCIP_READER_TIM_H__
41 
42 #include "scip/def.h"
43 #include "scip/type_cons.h"
44 #include "scip/type_reader.h"
45 #include "scip/type_result.h"
46 #include "scip/type_retcode.h"
47 #include "scip/type_scip.h"
48 #include "scip/type_var.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /** includes the tim file reader into SCIP
55  *
56  * @ingroup FileReaderIncludes
57  */
60  SCIP* scip /**< SCIP data structure */
61  );
62 
63 /**@addtogroup FILEREADERS
64  *
65  * @{
66  */
67 
68 /** reads the stage information for a stochastic programming instance in SMPS format */
71  SCIP* scip, /**< SCIP data structure */
72  const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
73  SCIP_RESULT* result /**< pointer to store the result of the file reading call */
74  );
75 
76 /** @} */
77 
78 /*
79  * Interface methods for the cor and sto files
80  */
81 
82 /* return whether the tim file has been read */
85  SCIP_READER* reader /**< the file reader itself */
86  );
87 
88 /* returns the number of stages */
91  SCIP* scip /**< SCIP data structure */
92  );
93 
94 /* returns the name for a given stage */
96 const char* SCIPtimGetStageName(
97  SCIP* scip, /**< SCIP data structure */
98  int stagenum /**< the number of the requested stage */
99  );
100 
101 /* returns the stage name for a given constraint name */
102 const char* SCIPtimConsGetStageName(
103  SCIP* scip, /**< SCIP data structure */
104  const char* consname /**< the constraint to search for */
105  );
106 
107 /* returns the number for a given stage */
109 int SCIPtimFindStage(
110  SCIP* scip, /**< SCIP data structure */
111  const char* stage /**< the name of the requested stage */
112  );
113 
114 /* returns the array of variables for a given stage */
117  SCIP* scip, /**< SCIP data structure */
118  int stagenum /**< the number of the requested stage */
119  );
120 
121 /* returns an array of constraints for a given stage */
124  SCIP* scip, /**< SCIP data structure */
125  int stagenum /**< the number of the requested stage */
126  );
127 
128 /* returns the number of variables for a given stage */
131  SCIP* scip, /**< SCIP data structure */
132  int stagenum /**< the number of the requested stage */
133  );
134 
135 /* returns the number of constraints for a given stage */
138  SCIP* scip, /**< SCIP data structure */
139  int stagenum /**< the number of the requested stage */
140  );
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_EXPORT int SCIPtimFindStage(SCIP *scip, const char *stage)
Definition: reader_tim.c:1010
SCIP_EXPORT SCIP_CONS ** SCIPtimGetStageConss(SCIP *scip, int stagenum)
Definition: reader_tim.c:1069
#define SCIP_EXPORT
Definition: def.h:100
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
type definitions for return codes for SCIP methods
SCIP_EXPORT int SCIPtimGetStageNConss(SCIP *scip, int stagenum)
Definition: reader_tim.c:1111
SCIP_EXPORT int SCIPtimGetNStages(SCIP *scip)
Definition: reader_tim.c:929
SCIP_EXPORT SCIP_VAR ** SCIPtimGetStageVars(SCIP *scip, int stagenum)
Definition: reader_tim.c:1048
type definitions for SCIP&#39;s main datastructure
const char * SCIPtimConsGetStageName(SCIP *scip, const char *consname)
Definition: reader_tim.c:969
SCIP_EXPORT const char * SCIPtimGetStageName(SCIP *scip, int stagenum)
Definition: reader_tim.c:948
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:70
type definitions for input file readers
SCIP_EXPORT int SCIPtimGetStageNVars(SCIP *scip, int stagenum)
Definition: reader_tim.c:1090
result codes for SCIP callback methods
SCIP_EXPORT SCIP_RETCODE SCIPincludeReaderTim(SCIP *scip)
Definition: reader_tim.c:845
SCIP_EXPORT SCIP_Bool SCIPtimHasRead(SCIP_READER *reader)
Definition: reader_tim.c:912
SCIP_EXPORT SCIP_RETCODE SCIPreadTim(SCIP *scip, const char *filename, SCIP_RESULT *result)
Definition: reader_tim.c:869
common defines and data types used in all packages of SCIP
type definitions for constraints and constraint handlers