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_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 52 extern "C" { 53 #endif 54 55 /** includes the pip file reader into SCIP 56 * 57 * @ingroup FileReaderIncludes 58 */ 59 SCIP_EXPORT 60 SCIP_RETCODE SCIPincludeReaderPip( 61 SCIP* scip /**< SCIP data structure */ 62 ); 63 64 /**@addtogroup FILEREADERS 65 * 66 * @{ 67 */ 68 69 /** reads problem from file */ 70 SCIP_EXPORT 71 SCIP_RETCODE SCIPreadPip( 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 */ 79 SCIP_EXPORT 80 SCIP_RETCODE SCIPwritePip( 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 107