coin-Bcp
BCP_USER.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef _BCP_USER_H
4 #define _BCP_USER_H
5 
6 // This file is prepared for doxygen.
7 
8 #include "CoinSmartPtr.hpp"
9 #include "BCP_error.hpp"
10 #include "BCP_message_single.hpp"
11 #include "BCP_functions.hpp"
12 
13 class BCP_var_algo;
14 class BCP_cut_algo;
15 class BCP_warmstart;
16 
17 //#############################################################################
18 
20 public:
21  virtual ~BCP_user_data() {}
22 };
23 
24 //#############################################################################
25 
27 public:
28  virtual ~BCP_user_class() {}
29 };
30 
31 //#############################################################################
32 
49 public:
56 
57 public:
58  virtual ~BCP_user_pack() {}
59 
60  //-------------------------------------------------------------------------
62  virtual void
64  bool report_if_default = false)
65  {
66  if (report_if_default) {
67  printf("BCP_user_pack : default pack_warmstart() executed.\n");
68  }
69  BCP_pack_warmstart(ws, buf);
70  }
71 
73  virtual BCP_warmstart*
75  bool report_if_default = false)
76  {
77  if (report_if_default) {
78  printf("BCP_user_pack : default unpack_warmstart() executed.\n");
79  }
80  return BCP_unpack_warmstart(buf);
81  }
82 
83  //-------------------------------------------------------------------------
85  virtual void
87  {
88  throw BCP_fatal_error("\
89 BCP_user_pack::pack_var_algo() invoked but not overridden!\n");
90  }
91 
94  {
95  throw BCP_fatal_error("\
96 BCP_user_pack::unpack_var_algo() invoked but not overridden!\n");
97  return 0; // to satisfy aCC on HP-UX
98  }
99 
100  //-------------------------------------------------------------------------
102  virtual void pack_cut_algo(const BCP_cut_algo* cut, BCP_buffer& buf)
103  {
104  throw BCP_fatal_error("\
105 BCP_user_pack::pack_cut_algo() invoked but not overridden!\n");
106  }
107 
110  {
111  throw BCP_fatal_error("\
112 BCP_user_pack::unpack_cut_algo() invoked but not overridden!\n");
113  return 0; // to satisfy aCC on HP-UX
114  }
115 
116  //-------------------------------------------------------------------------
118  virtual void
120  {
121  throw BCP_fatal_error("\
122 BCP_user_pack::pack_user_data() invoked but not overridden!\n");
123  }
124 
127  {
128  throw BCP_fatal_error("\
129 BCP_user_pack::unpack_user_data() invoked but not overridden!\n");
130  }
131 };
132 
133 //#############################################################################
134 
135 class BCP_tm_user;
136 class BCP_ts_user;
137 class BCP_lp_user;
138 class BCP_vg_user;
139 class BCP_cg_user;
140 class BCP_vp_user;
141 class BCP_cp_user;
142 
143 class BCP_tm_prob;
144 class BCP_ts_prob;
145 class BCP_lp_prob;
146 class BCP_vg_prob;
147 class BCP_cg_prob;
148 class BCP_vp_prob;
149 class BCP_cp_prob;
150 
151 class BCP_proc_id;
153 
161 public:
165  virtual ~USER_initialize() {}
168  //--------------------------------------------------------------------------
175  virtual BCP_message_environment * msgenv_init(int argc, char* argv[]);
178  //--------------------------------------------------------------------------
186  virtual BCP_tm_user * tm_init(BCP_tm_prob& p,
188  const int argnum,
189  const char * const * arglist) {
190  throw BCP_fatal_error("USER_initialize::tm_init() missing.\n");
191  return 0; // to satisfy aCC on HP-UX
192  }
195  // If the user does not need any info in the TS for (un)packing
196  // cuts/vars/user_data, then a NULL is fine
197  return 0;
198  }
201  throw BCP_fatal_error("USER_initialize::lp_init() missing.\n");
202  return 0; // to satisfy aCC on HP-UX
203  }
206  throw BCP_fatal_error("USER_initialize::vg_init() missing.\n");
207  return 0; // to satisfy aCC on HP-UX
208  }
211  throw BCP_fatal_error("USER_initialize::cg_init() missing.\n");
212  return 0; // to satisfy aCC on HP-UX
213  }
215  virtual BCP_vp_user * vp_init(BCP_vp_prob& p) {
216  throw BCP_fatal_error("USER_initialize::vp_init() missing.\n");
217  return 0; // to satisfy aCC on HP-UX
218  }
220  virtual BCP_cp_user * cp_init(BCP_cp_prob& p) {
221  throw BCP_fatal_error("USER_initialize::cp_init() missing.\n");
222  return 0; // to satisfy aCC on HP-UX
223  }
226  return NULL;
227  }
229 };
230 
231 //#############################################################################
232 
239 int bcp_main(int argc, char* argv[], USER_initialize* user_init);
240 
241 #endif
void BCP_pack_warmstart(const BCP_warmstart *ws, BCP_buffer &buf)
This is an abstract base class that describes the message passing environment.
Definition: BCP_message.hpp:30
virtual BCP_cut_algo * unpack_cut_algo(BCP_buffer &buf)
Unpack an algorithmic cut.
Definition: BCP_USER.hpp:109
virtual BCP_user_data * unpack_user_data(BCP_buffer &buf)
Unpack an user data.
Definition: BCP_USER.hpp:126
This is the class from which the user should derive her own algorithmic cuts.
Definition: BCP_cut.hpp:242
virtual BCP_user_pack * packer_init(BCP_user_class *p)
Definition: BCP_USER.hpp:225
This class is the central class of the Cut Generator process.
Definition: BCP_cg.hpp:32
NO OLD DOC.
Definition: BCP_lp.hpp:102
The BCP_vg_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_vg_user.hpp:51
virtual BCP_warmstart * unpack_warmstart(BCP_buffer &buf, bool report_if_default=false)
Unpack warmstarting information.
Definition: BCP_USER.hpp:74
Warmstarting information for the LP solver.
virtual BCP_ts_user * ts_init(BCP_ts_prob &p)
Definition: BCP_USER.hpp:194
The BCP_lp_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_lp_user.hpp:75
int bcp_main(int argc, char *argv[], USER_initialize *user_init)
This is the function the user must invoke when (s)he is ready to turn contrl over to BCP...
virtual void pack_warmstart(const BCP_warmstart *ws, BCP_buffer &buf, bool report_if_default=false)
Pack warmstarting information.
Definition: BCP_USER.hpp:63
virtual void pack_cut_algo(const BCP_cut_algo *cut, BCP_buffer &buf)
Pack an algorithmic cut.
Definition: BCP_USER.hpp:102
ReferencedObject class.
This class is an abstract base class for the initializer class the user has to provide.
Definition: BCP_USER.hpp:160
BCP_user_class * user_class
A pointer ot the usr class of the process from which the methods of this class are invoked from...
Definition: BCP_USER.hpp:55
NO OLD DOC.
Definition: BCP_tm.hpp:136
The BCP_cg_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_cg_user.hpp:50
virtual ~BCP_user_pack()
Definition: BCP_USER.hpp:58
virtual BCP_vg_user * vg_init(BCP_vg_prob &p)
Definition: BCP_USER.hpp:205
virtual BCP_cp_user * cp_init(BCP_cp_prob &p)
Definition: BCP_USER.hpp:220
virtual ~USER_initialize()
virtual destructor
Definition: BCP_USER.hpp:165
Currently there isn't any error handling in BCP.
Definition: BCP_error.hpp:20
virtual ~BCP_user_data()
Definition: BCP_USER.hpp:21
virtual BCP_cg_user * cg_init(BCP_cg_prob &p)
Definition: BCP_USER.hpp:210
virtual BCP_tm_user * tm_init(BCP_tm_prob &p, const int argnum, const char *const *arglist)
Definition: BCP_USER.hpp:187
virtual BCP_var_algo * unpack_var_algo(BCP_buffer &buf)
Unpack an algorithmic variable.
Definition: BCP_USER.hpp:93
This is the class from which the user should derive her own algorithmic variables.
Definition: BCP_var.hpp:277
virtual BCP_message_environment * msgenv_init(int argc, char *argv[])
Create a message passing environment.
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
virtual void pack_var_algo(const BCP_var_algo *var, BCP_buffer &buf)
Pack an algorithmic variable.
Definition: BCP_USER.hpp:86
virtual BCP_lp_user * lp_init(BCP_lp_prob &p)
Definition: BCP_USER.hpp:200
BCP_warmstart * BCP_unpack_warmstart(BCP_buffer &buf)
virtual BCP_vp_user * vp_init(BCP_vp_prob &p)
Definition: BCP_USER.hpp:215
The BCP_tm_user class is the base class from which the user can derive a problem specific class to be...
Definition: BCP_tm_user.hpp:58
This class is the central class of the Variable Generator process.
Definition: BCP_vg.hpp:32
virtual ~BCP_user_class()
Definition: BCP_USER.hpp:28
virtual void pack_user_data(const BCP_user_data *ud, BCP_buffer &buf)
Pack an user data.
Definition: BCP_USER.hpp:119