Scippy

SCIP

Solving Constraint Integer Programs

reader_pip.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-2024 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_pip.h
26 * @ingroup FILEREADERS
27 * @brief file reader for polynomial mixed-integer programs in PIP format
28 * @author Stefan Vigerske
29 *
30 * This reader allows to parse and write PIP files with linear and polynomial constraints and objective.
31 * For writing, linear (general and specialized), quadratic, and "and" constraints are supported.
32 * Also nonlinear constraints may be written, if they are representable as polynomials.
33 *
34 * The PIP format is similar to the LP format and defined at http://polip.zib.de/pipformat.php .
35 */
36
37/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
38
39#ifndef __SCIP_READER_PIP_H__
40#define __SCIP_READER_PIP_H__
41
42#include "scip/def.h"
43#include "scip/type_cons.h"
44#include "scip/type_prob.h"
45#include "scip/type_reader.h"
46#include "scip/type_result.h"
47#include "scip/type_retcode.h"
48#include "scip/type_scip.h"
49#include "scip/type_var.h"
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55/** includes the pip file reader into SCIP
56 *
57 * @ingroup FileReaderIncludes
58 */
59SCIP_EXPORT
61 SCIP* scip /**< SCIP data structure */
62 );
63
64/**@addtogroup FILEREADERS
65 *
66 * @{
67 */
68
69/** reads problem from file */
70SCIP_EXPORT
72 SCIP* scip, /**< SCIP data structure */
73 SCIP_READER* reader, /**< the file reader itself */
74 const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
75 SCIP_RESULT* result /**< pointer to store the result of the file reading call */
76 );
77
78/** writes problem to file */
79SCIP_EXPORT
81 SCIP* scip, /**< SCIP data structure */
82 FILE* file, /**< output file, or NULL if standard output should be used */
83 const char* name, /**< problem name */
84 SCIP_Bool transformed, /**< TRUE iff problem is the transformed problem */
85 SCIP_OBJSENSE objsense, /**< objective sense */
86 SCIP_Real objscale, /**< scalar applied to objective function; external objective value is
87 * extobj = objsense * objscale * (intobj + objoffset) */
88 SCIP_Real objoffset, /**< objective offset from bound shifting and fixing */
89 SCIP_VAR** vars, /**< array with active variables ordered binary, integer, implicit, continuous */
90 int nvars, /**< number of active variables in the problem */
91 int nbinvars, /**< number of binary variables */
92 int nintvars, /**< number of general integer variables */
93 int nimplvars, /**< number of implicit integer variables */
94 int ncontvars, /**< number of continuous variables */
95 SCIP_CONS** conss, /**< array with constraints of the problem */
96 int nconss, /**< number of constraints in the problem */
97 SCIP_RESULT* result /**< pointer to store the result of the file writing call */
98 );
99
100/** @} */
101
102#ifdef __cplusplus
103}
104#endif
105
106#endif
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:173
SCIP_RETCODE SCIPwritePip(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_pip.c:2730
SCIP_RETCODE SCIPreadPip(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
Definition: reader_pip.c:3230
SCIP_RETCODE SCIPincludeReaderPip(SCIP *scip)
Definition: reader_pip.c:3211
type definitions for constraints and constraint handlers
type definitions for storing and manipulating the main problem
enum SCIP_Objsense SCIP_OBJSENSE
Definition: type_prob.h:50
type definitions for input file readers
result codes for SCIP callback methods
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for SCIP's main datastructure
type definitions for problem variables