Scippy

SCIP

Solving Constraint Integer Programs

reader_mps.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-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_mps.h
26  * @ingroup FILEREADERS
27  * @brief (extended) MPS file reader
28  * @author Thorsten Koch
29  * @author Tobias Achterberg
30  *
31  * This reader allows to parse and write MPS files with linear and quadratic constraints and objective,
32  * special ordered sets of type 1 and 2, indicators on linear constraints, and semicontinuous variables.
33  * For writing, linear (general and specialized), indicator, quadratic, second order cone, and
34  * special ordered set constraints are supported.
35  *
36  * See http://en.wikipedia.org/wiki/MPS_%28format%29 for a description.
37  */
38 
39 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
40 
41 #ifndef __SCIP_READER_MPS_H__
42 #define __SCIP_READER_MPS_H__
43 
44 #include "scip/def.h"
45 #include "scip/type_cons.h"
46 #include "scip/type_prob.h"
47 #include "scip/type_reader.h"
48 #include "scip/type_result.h"
49 #include "scip/type_retcode.h"
50 #include "scip/type_scip.h"
51 #include "scip/type_var.h"
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 /** includes the mps file reader into SCIP
58  *
59  * @ingroup FileReaderIncludes
60  */
61 SCIP_EXPORT
63  SCIP* scip /**< SCIP data structure */
64  );
65 
66 /**@addtogroup FILEREADERS
67  *
68  * @{
69  */
70 
71 /** reads problem from file */
72 SCIP_EXPORT
74  SCIP* scip, /**< SCIP data structure */
75  SCIP_READER* reader, /**< the file reader itself */
76  const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
77  SCIP_RESULT* result, /**< pointer to store the result of the file reading call */
78  const char*** varnames, /**< storage for the variable names, or NULL */
79  const char*** consnames, /**< storage for the constraint names, or NULL */
80  int* varnamessize, /**< the size of the variable names storage, or NULL */
81  int* consnamessize, /**< the size of the constraint names storage, or NULL */
82  int* nvarnames, /**< the number of stored variable names, or NULL */
83  int* nconsnames /**< the number of stored constraint names, or NULL */
84  );
85 
86 /** writes problem to file */
87 SCIP_EXPORT
89  SCIP* scip, /**< SCIP data structure */
90  SCIP_READER* reader, /**< the file reader itself */
91  FILE* file, /**< output file, or NULL if standard output should be used */
92  const char* name, /**< problem name */
93  SCIP_Bool transformed, /**< TRUE iff problem is the transformed problem */
94  SCIP_OBJSENSE objsense, /**< objective sense */
95  SCIP_Real objscale, /**< scalar applied to objective function; external objective value is
96  * extobj = objsense * objscale * (intobj + objoffset) */
97  SCIP_Real objoffset, /**< objective offset from bound shifting and fixing */
98  SCIP_VAR** vars, /**< array with active variables ordered binary, integer, implicit, continuous */
99  int nvars, /**< number of active variables in the problem */
100  int nbinvars, /**< number of binary variables */
101  int nintvars, /**< number of general integer variables */
102  int nimplvars, /**< number of implicit integer variables */
103  int ncontvars, /**< number of continuous variables */
104  SCIP_VAR** fixedvars, /**< array with fixed and aggregated variables */
105  int nfixedvars, /**< number of fixed and aggregated variables in the problem */
106  SCIP_CONS** conss, /**< array with constraints of the problem */
107  int nconss, /**< number of constraints in the problem */
108  SCIP_RESULT* result /**< pointer to store the result of the file writing call */
109  );
110 
111 /** @} */
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_RETCODE SCIPwriteMps(SCIP *scip, SCIP_READER *reader, 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_VAR **fixedvars, int nfixedvars, SCIP_CONS **conss, int nconss, SCIP_RESULT *result)
Definition: reader_mps.c:3878
type definitions for return codes for SCIP methods
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:93
type definitions for input file readers
enum SCIP_Objsense SCIP_OBJSENSE
Definition: type_prob.h:50
SCIP_RETCODE SCIPreadMps(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result, const char ***varnames, const char ***consnames, int *varnamessize, int *consnamessize, int *nvarnames, int *nconsnames)
Definition: reader_mps.c:3842
type definitions for storing and manipulating the main problem
#define SCIP_Real
Definition: def.h:186
result codes for SCIP callback methods
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPincludeReaderMps(SCIP *scip)
Definition: reader_mps.c:3808
type definitions for constraints and constraint handlers