Scippy

SCIP

Solving Constraint Integer Programs

reader_lp.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_lp.h
26  * @ingroup FILEREADERS
27  * @brief LP file reader
28  * @author Tobias Achterberg
29  *
30  * This reader allows to parse and write CPLEX .lp files with linear and quadratic constraints and objective,
31  * special ordered sets of type 1 and 2, indicators on linear constraints, and semicontinuous variables.
32  * For writing, linear (general and specialized), indicator, quadratic, second order cone, and
33  * special ordered set constraints are supported.
34  *
35  * The lp format is defined within the CPLEX documentation.
36  */
37 
38 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39 
40 #ifndef __SCIP_READER_LP_H__
41 #define __SCIP_READER_LP_H__
42 
43 #include "scip/def.h"
44 #include "scip/type_cons.h"
45 #include "scip/type_prob.h"
46 #include "scip/type_reader.h"
47 #include "scip/type_result.h"
48 #include "scip/type_retcode.h"
49 #include "scip/type_scip.h"
50 #include "scip/type_var.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /** includes the lp file reader into SCIP
57  *
58  * @ingroup FileReaderIncludes
59  */
60 SCIP_EXPORT
62  SCIP* scip /**< SCIP data structure */
63  );
64 
65 /**@addtogroup FILEREADERS
66  *
67  * @{
68  */
69 
70 /** reads problem from file */
71 SCIP_EXPORT
73  SCIP* scip, /**< SCIP data structure */
74  SCIP_READER* reader, /**< the file reader itself */
75  const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
76  SCIP_RESULT* result /**< pointer to store the result of the file reading call */
77  );
78 
79 /** writes problem to file */
80 SCIP_EXPORT
82  SCIP* scip, /**< SCIP data structure */
83  FILE* file, /**< output file, or NULL if standard output should be used */
84  const char* name, /**< problem name */
85  SCIP_Bool transformed, /**< TRUE iff problem is the transformed problem */
86  SCIP_OBJSENSE objsense, /**< objective sense */
87  SCIP_Real objscale, /**< scalar applied to objective function; external objective value is
88  * extobj = objsense * objscale * (intobj + objoffset) */
89  SCIP_Real objoffset, /**< objective offset from bound shifting and fixing */
90  SCIP_VAR** vars, /**< array with active variables ordered binary, integer, implicit, continuous */
91  int nvars, /**< number of active variables in the problem */
92  int nbinvars, /**< number of binary variables */
93  int nintvars, /**< number of general integer variables */
94  int nimplvars, /**< number of implicit integer variables */
95  int ncontvars, /**< number of continuous variables */
96  SCIP_CONS** conss, /**< array with constraints of the problem */
97  int nconss, /**< number of constraints in the problem */
98  SCIP_RESULT* result /**< pointer to store the result of the file writing call */
99  );
100 
101 /** @} */
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for return codes for SCIP methods
type definitions for SCIP&#39;s main datastructure
type definitions for problem variables
SCIP_RETCODE SCIPincludeReaderLp(SCIP *scip)
Definition: reader_lp.c:3389
#define SCIP_Bool
Definition: def.h:93
type definitions for input file readers
enum SCIP_Objsense SCIP_OBJSENSE
Definition: type_prob.h:50
type definitions for storing and manipulating the main problem
#define SCIP_Real
Definition: def.h:186
result codes for SCIP callback methods
SCIP_RETCODE SCIPreadLp(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
Definition: reader_lp.c:3423
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPwriteLp(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)
Definition: reader_lp.c:3500
type definitions for constraints and constraint handlers