Scippy

SCIP

Solving Constraint Integer Programs

reader_sto.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-2020 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_sto.h
17  * @ingroup FILEREADERS
18  * @brief STO file reader - the stochastic information of an instance in SMPS format
19  * @author Stephen J. Maher
20  *
21  * This is a reader for the stochastic information 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_STO_H__
40 #define __SCIP_READER_STO_H__
41 
42 #include "scip/def.h"
43 #include "scip/type_cons.h"
44 #include "scip/type_prob.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 sto 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 stochastic information for a stochastic program that is 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 /** writes problem to file */
79  SCIP* scip, /**< SCIP data structure */
80  FILE* file, /**< output file, or NULL if standard output should be used */
81  const char* name, /**< problem name */
82  SCIP_Bool transformed, /**< TRUE iff problem is the transformed problem */
83  SCIP_OBJSENSE objsense, /**< objective sense */
84  SCIP_Real objscale, /**< scalar applied to objective function; external objective value is
85  * extobj = objsense * objscale * (intobj + objoffset) */
86  SCIP_Real objoffset, /**< objective offset from bound shifting and fixing */
87  SCIP_VAR** vars, /**< array with active variables ordered binary, integer, implicit, continuous */
88  int nvars, /**< number of active variables in the problem */
89  int nbinvars, /**< number of binary variables */
90  int nintvars, /**< number of general integer variables */
91  int nimplvars, /**< number of implicit integer variables */
92  int ncontvars, /**< number of continuous variables */
93  SCIP_CONS** conss, /**< array with constraints of the problem */
94  int nconss, /**< number of constraints in the problem */
95  SCIP_RESULT* result /**< pointer to store the result of the file writing call */
96  );
97 
98 /** returns the total number of scenarios added to the problem */
101  SCIP* scip /**< SCIP data structure */
102  );
103 
104 /** @} */
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
#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 SCIP_RETCODE SCIPincludeReaderSto(SCIP *scip)
Definition: reader_sto.c:2774
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:70
enum SCIP_Objsense SCIP_OBJSENSE
Definition: type_prob.h:41
SCIP_EXPORT SCIP_RETCODE SCIPwriteSto(SCIP *scip, FILE *file, const char *name, SCIP_Bool transformed, SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset, SCIP_VAR **vars, int nvars, int nbinvars, int nintvars, int nimplvars, int ncontvars, SCIP_CONS **conss, int nconss, SCIP_RESULT *result)
SCIP_EXPORT int SCIPstoGetNScenarios(SCIP *scip)
Definition: reader_sto.c:2838
type definitions for storing and manipulating the main problem
#define SCIP_Real
Definition: def.h:163
result codes for SCIP callback methods
SCIP_EXPORT SCIP_RETCODE SCIPreadSto(SCIP *scip, const char *filename, SCIP_RESULT *result)
Definition: reader_sto.c:2805
common defines and data types used in all packages of SCIP
type definitions for constraints and constraint handlers