1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /*                                                                           */
3 /*                  This file is part of the program and library             */
4 /*         SCIP --- Solving Constraint Integer Programs                      */
5 /*                                                                           */
6 /*    Copyright (C) 2002-2021 Konrad-Zuse-Zentrum                            */
7 /*                            fuer Informationstechnik Berlin                */
8 /*                                                                           */
9 /*  SCIP is distributed under the terms of the ZIB Academic License.         */
10 /*                                                                           */
11 /*  You should have received a copy of the ZIB Academic License              */
12 /*  along with SCIP; see the file COPYING. If not visit scipopt.org.         */
13 /*                                                                           */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file   reader_diff.h
17  * @ingroup FILEREADERS
18  * @brief  diff file reader
19  * @author Jakob Witzig
20  *
21  * This reader allows to parse a new objective function in the style of CPLEX .lp files.
22  *
23  * The lp format is defined within the CPLEX documentation.
24  *
25  * An example of a *.diff file looks like this:
26  *
27  *  Minimize
28  *    obj: - STM6 + STM7
29  *
30  * Here is the objective sense set to minimize the function -STM6 + STM7.
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef __SCIP_READER_DIFF_H__
36 #define __SCIP_READER_DIFF_H__
37 
38 #include "scip/def.h"
39 #include "scip/type_cons.h"
40 #include "scip/type_prob.h"
41 #include "scip/type_reader.h"
42 #include "scip/type_result.h"
43 #include "scip/type_retcode.h"
44 #include "scip/type_scip.h"
45 #include "scip/type_var.h"
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /** includes the diff file reader into SCIP
52  *
53  *  @ingroup FileReaderIncludes
54  */
55 SCIP_EXPORT
56 SCIP_RETCODE SCIPincludeReaderDiff(
57    SCIP*                 scip                /**< SCIP data structure */
58    );
59 
60 /**@addtogroup FILEREADERS
61  *
62  * @{
63  */
64 
65 /** reads problem from file */
66 SCIP_EXPORT
67 SCIP_RETCODE SCIPreadDiff(
68    SCIP*                 scip,               /**< SCIP data structure */
69    SCIP_READER*          reader,             /**< the file reader itself */
70    const char*           filename,           /**< full path and name of file to read, or NULL if stdin should be used */
71    SCIP_RESULT*          result              /**< pointer to store the result of the file reading call */
72    );
73 
74 /** writes problem to file */
75 SCIP_EXPORT
76 SCIP_RETCODE SCIPwriteDiff(
77    SCIP*                 scip,               /**< SCIP data structure */
78    FILE*                 file,               /**< output file, or NULL if standard output should be used */
79    const char*           name,               /**< problem name */
80    SCIP_Bool             transformed,        /**< TRUE iff problem is the transformed problem */
81    SCIP_OBJSENSE         objsense,           /**< objective sense */
82    SCIP_Real             objscale,           /**< scalar applied to objective function; external objective value is
83                                               * extobj = objsense * objscale * (intobj + objoffset) */
84    SCIP_Real             objoffset,          /**< objective offset from bound shifting and fixing */
85    SCIP_VAR**            vars,               /**< array with active variables ordered binary, integer, implicit, continuous */
86    int                   nvars,              /**< number of mutable variables in the problem */
87    int                   nbinvars,           /**< number of binary variables */
88    int                   nintvars,           /**< number of general integer variables */
89    int                   nimplvars,          /**< number of implicit integer variables */
90    int                   ncontvars,          /**< number of continuous variables */
91    SCIP_CONS**           conss,              /**< array with constraints of the problem */
92    int                   nconss,             /**< number of constraints in the problem */
93    SCIP_RESULT*          result              /**< pointer to store the result of the file writing call */
94    );
95 
96 /** @} */
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif
103