CoinUtils 2.11.4
Loading...
Searching...
No Matches
Coin_C_defines.h
Go to the documentation of this file.
1/* $Id$ */
2/*
3 Copyright (C) 2002, 2003 International Business Machines Corporation
4 and others. All Rights Reserved.
5
6 This code is licensed under the terms of the Eclipse Public License (EPL).
7*/
8#ifndef CoinCDefine_H
9#define CoinCDefine_H
10
15#if defined(CLP_EXTERN_C)
16#define COIN_EXTERN_C
17#define COIN_NO_SBB
18#define COIN_NO_CBC
19#endif
20#if defined(SBB_EXTERN_C)
21#define COIN_EXTERN_C
22#define COIN_NO_CLP
23#endif
24#if defined(CBC_EXTERN_C)
25#define COIN_EXTERN_C
26#define COIN_NO_CLP
27#endif
28/* We need to allow for Microsoft */
29#ifndef COINLIBAPI
30
31#if defined(CBCCINTERFACEDLL_EXPORTS) || defined(CLPMSDLL)
32#if defined(COIN_EXTERN_C)
33#define COINLIBAPI __declspec(dllexport)
34#else
35#define COINLIBAPI __declspec(dllexport)
36#endif
37#define COINLINKAGE __stdcall
38#define COINLINKAGE_CB __cdecl
39#else
40#if defined(COIN_EXTERN_C)
41#define COINLIBAPI extern "C"
42#else
43#define COINLIBAPI
44#endif
45#define COINLINKAGE
46#define COINLINKAGE_CB
47#endif
48
49#endif
51#if defined(CLP_EXTERN_C)
52/* Real typedef for structure */
53class CMessageHandler;
54typedef struct {
55 ClpSimplex *model_;
56 CMessageHandler *handler_;
58#else
59typedef void Clp_Simplex;
60#endif
61
62#ifndef COIN_NO_CLP
65#if COIN_BIG_INDEX == 0
66typedef void(COINLINKAGE_CB *clp_callback)(Clp_Simplex *model, int msgno, int ndouble,
67 const double *dvec, int nint, const int *ivec,
68 int nchar, char **cvec);
69#elif COIN_BIG_INDEX == 1
70typedef void(COINLINKAGE_CB *clp_callback)(Clp_Simplex *model, int msgno, int ndouble,
71 const double *dvec, int nint, const long *ivec,
72 int nchar, char **cvec);
73#else
74typedef void(COINLINKAGE_CB *clp_callback)(Clp_Simplex *model, int msgno, int ndouble,
75 const double *dvec, int nint, const long long *ivec,
76 int nchar, char **cvec);
77#endif
78#endif
80#if defined(SBB_EXTERN_C)
81/* Real typedef for structure */
82class Sbb_MessageHandler;
83typedef struct {
84 OsiClpSolverInterface *solver_;
85 SbbModel *model_;
86 Sbb_MessageHandler *handler_;
87 char *information_;
88} Sbb_Model;
89#else
90typedef void Sbb_Model;
91#endif
92#if defined(CBC_EXTERN_C)
93/* Real typedef for structure */
94class Cbc_MessageHandler;
95typedef struct {
96 OsiClpSolverInterface *solver_;
97 CbcModel *model_;
98 CbcSolverUsefulData *cbcData;
99 Cbc_MessageHandler *handler_;
100 std::vector< std::string > cmdargs_;
101 char relax_;
102
103 // cache for columns
104 int colSpace;
105 int nCols;
106 int cNameSpace;
107 int *cNameStart;
108 char *cInt;
109 char *cNames;
110 double *cLB;
111 double *cUB;
112 double *cObj;
113} Cbc_Model;
114#else
115typedef void Cbc_Model;
116#endif
117#ifndef COIN_NO_SBB
120typedef void(COINLINKAGE_CB *sbb_callback)(Sbb_Model *model, int msgno, int ndouble,
121 const double *dvec, int nint, const int *ivec,
122 int nchar, char **cvec);
123
124typedef void(COINLINKAGE_CB *cbc_callback)(Cbc_Model *model, int msgno, int ndouble,
125 const double *dvec, int nint, const int *ivec,
126 int nchar, char **cvec);
127
133typedef void(COINLINKAGE_CB *cbc_cut_callback)(void *osiSolver, void *osiCuts, void *appdata);
134#endif
135#if COIN_BIG_INDEX == 0
136typedef int CoinBigIndex;
137#elif COIN_BIG_INDEX == 1
138typedef long CoinBigIndex;
139#else
140typedef long long CoinBigIndex;
141#endif
142/* just in case used somewhere */
143#undef COIN_NO_CLP
144#undef COIN_NO_SBB
145#undef COIN_NO_CBC
146#endif
147
148/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
149*/
void(COINLINKAGE_CB * cbc_cut_callback)(void *osiSolver, void *osiCuts, void *appdata)
typedef for cbc cut callback osiSolver needs to be an OsiSolverInterface object, osiCuts is an OsiCut...
void(COINLINKAGE_CB * cbc_callback)(Cbc_Model *model, int msgno, int ndouble, const double *dvec, int nint, const int *ivec, int nchar, char **cvec)
int CoinBigIndex
void Cbc_Model
void Clp_Simplex
User does not need to see structure of model but C++ code does.
void(COINLINKAGE_CB * sbb_callback)(Sbb_Model *model, int msgno, int ndouble, const double *dvec, int nint, const int *ivec, int nchar, char **cvec)
typedef for user call back.
void(COINLINKAGE_CB * clp_callback)(Clp_Simplex *model, int msgno, int ndouble, const double *dvec, int nint, const int *ivec, int nchar, char **cvec)
typedef for user call back.
#define COINLINKAGE_CB
void Sbb_Model
User does not need to see structure of model but C++ code does.