Scippy

SCIP

Solving Constraint Integer Programs

reader_diff.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_diff.h
26 * @ingroup FILEREADERS
27 * @brief diff file reader
28 * @author Jakob Witzig
29 *
30 * This reader allows to parse a new objective function in the style of CPLEX .lp files.
31 *
32 * The lp format is defined within the CPLEX documentation.
33 *
34 * An example of a *.diff file looks like this:
35 *
36 * Minimize
37 * obj: - STM6 + STM7
38 *
39 * Here is the objective sense set to minimize the function -STM6 + STM7.
40 */
41
42/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
43
44#ifndef __SCIP_READER_DIFF_H__
45#define __SCIP_READER_DIFF_H__
46
47#include "scip/def.h"
48#include "scip/type_cons.h"
49#include "scip/type_prob.h"
50#include "scip/type_reader.h"
51#include "scip/type_result.h"
52#include "scip/type_retcode.h"
53#include "scip/type_scip.h"
54#include "scip/type_var.h"
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
60/** includes the diff file reader into SCIP
61 *
62 * @ingroup FileReaderIncludes
63 */
64SCIP_EXPORT
66 SCIP* scip /**< SCIP data structure */
67 );
68
69/**@addtogroup FILEREADERS
70 *
71 * @{
72 */
73
74/** reads problem from file */
75SCIP_EXPORT
77 SCIP* scip, /**< SCIP data structure */
78 SCIP_READER* reader, /**< the file reader itself */
79 const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
80 SCIP_RESULT* result /**< pointer to store the result of the file reading call */
81 );
82
83/** writes problem to file */
84SCIP_EXPORT
86 SCIP* scip, /**< SCIP data structure */
87 FILE* file, /**< output file, or NULL if standard output should be used */
88 const char* name, /**< problem name */
89 SCIP_Bool transformed, /**< TRUE iff problem is the transformed problem */
90 SCIP_OBJSENSE objsense, /**< objective sense */
91 SCIP_Real objscale, /**< scalar applied to objective function; external objective value is
92 * extobj = objsense * objscale * (intobj + objoffset) */
93 SCIP_Real objoffset, /**< objective offset from bound shifting and fixing */
94 SCIP_VAR** vars, /**< array with active variables ordered binary, integer, implicit, continuous */
95 int nvars, /**< number of mutable variables in the problem */
96 int nbinvars, /**< number of binary variables */
97 int nintvars, /**< number of general integer variables */
98 int nimplvars, /**< number of implicit integer variables */
99 int ncontvars, /**< number of continuous variables */
100 SCIP_CONS** conss, /**< array with constraints of the problem */
101 int nconss, /**< number of constraints in the problem */
102 SCIP_RESULT* result /**< pointer to store the result of the file writing call */
103 );
104
105/** @} */
106
107#ifdef __cplusplus
108}
109#endif
110
111#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:172
SCIP_RETCODE SCIPwriteDiff(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)
SCIP_RETCODE SCIPreadDiff(SCIP *scip, SCIP_READER *reader, const char *filename, SCIP_RESULT *result)
Definition: reader_diff.c:1012
SCIP_RETCODE SCIPincludeReaderDiff(SCIP *scip)
Definition: reader_diff.c:993
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