1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the program and library */ 4 /* SCIP --- Solving Constraint Integer Programs */ 5 /* */ 6 /* Copyright (c) 2002-2023 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_sto.h 26 * @ingroup FILEREADERS 27 * @brief STO file reader - the stochastic information of an instance in SMPS format 28 * @author Stephen J. Maher 29 * 30 * This is a reader for the stochastic information 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_STO_H__ 49 #define __SCIP_READER_STO_H__ 50 51 #include "scip/def.h" 52 #include "scip/type_cons.h" 53 #include "scip/type_prob.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 sto file reader into SCIP 64 * 65 * @ingroup FileReaderIncludes 66 */ 67 SCIP_EXPORT 68 SCIP_RETCODE SCIPincludeReaderSto( 69 SCIP* scip /**< SCIP data structure */ 70 ); 71 72 /**@addtogroup FILEREADERS 73 * 74 * @{ 75 */ 76 77 /** reads the stochastic information for a stochastic program that is in SMPS format */ 78 SCIP_EXPORT 79 SCIP_RETCODE SCIPreadSto( 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 /** writes problem to file */ 86 SCIP_EXPORT 87 SCIP_RETCODE SCIPwriteSto( 88 SCIP* scip, /**< SCIP data structure */ 89 FILE* file, /**< output file, or NULL if standard output should be used */ 90 const char* name, /**< problem name */ 91 SCIP_Bool transformed, /**< TRUE iff problem is the transformed problem */ 92 SCIP_OBJSENSE objsense, /**< objective sense */ 93 SCIP_Real objscale, /**< scalar applied to objective function; external objective value is 94 * extobj = objsense * objscale * (intobj + objoffset) */ 95 SCIP_Real objoffset, /**< objective offset from bound shifting and fixing */ 96 SCIP_VAR** vars, /**< array with active variables ordered binary, integer, implicit, continuous */ 97 int nvars, /**< number of active variables in the problem */ 98 int nbinvars, /**< number of binary variables */ 99 int nintvars, /**< number of general integer variables */ 100 int nimplvars, /**< number of implicit integer variables */ 101 int ncontvars, /**< number of continuous variables */ 102 SCIP_CONS** conss, /**< array with constraints of the problem */ 103 int nconss, /**< number of constraints in the problem */ 104 SCIP_RESULT* result /**< pointer to store the result of the file writing call */ 105 ); 106 107 /** returns the total number of scenarios added to the problem */ 108 SCIP_EXPORT 109 int SCIPstoGetNScenarios( 110 SCIP* scip /**< SCIP data structure */ 111 ); 112 113 /** @} */ 114 115 #ifdef __cplusplus 116 } 117 #endif 118 119 #endif 120