coin-Bcp
BB_packer.hpp
Go to the documentation of this file.
1 // Last edit: 5/20/07
2 //
3 // Name: BB_packer.hpp
4 // Author: Francois Margot
5 // Tepper School of Business
6 // Carnegie Mellon University, Pittsburgh, PA 15213
7 // email: fmargot@andrew.cmu.edu
8 // Date: 5/18/07
9 //-----------------------------------------------------------------------------
10 // Copyright (C) 2007, Francois Margot, IBM and others. All Rights Reserved.
11 
12 #ifndef _BB_PACKER_H
13 #define _BB_PACKER_H
14 
15 #include "BCP_USER.hpp"
16 
17 class BCP_buffer;
18 class BB_user_data;
19 
22 class BB_packer : public BCP_user_pack {
23 public:
24 
25  //-------------------------------------------------------------------------
27  virtual void
29  bool report_if_default = false)
30  {
31  if (report_if_default) {
32  printf("BCP_user_pack : default pack_warmstart() executed.\n");
33  }
34  BCP_pack_warmstart(ws, buf);
35  }
36 
38  virtual BCP_warmstart*
40  bool report_if_default = false)
41  {
42  if (report_if_default) {
43  printf("BCP_user_pack : default unpack_warmstart() executed.\n");
44  }
45  return BCP_unpack_warmstart(buf);
46  }
47 
48  //-------------------------------------------------------------------------
50  virtual void
52  {
53  throw BCP_fatal_error("\
54 BCP_user_pack::pack_var_algo() invoked but not overridden!\n");
55  }
56 
59  {
60  throw BCP_fatal_error("\
61 BCP_user_pack::unpack_var_algo() invoked but not overridden!\n");
62  return 0; // to satisfy aCC on HP-UX
63  }
64 
65  //-------------------------------------------------------------------------
67  virtual void pack_cut_algo(const BCP_cut_algo* cut, BCP_buffer& buf);
68 
71 
72  //-------------------------------------------------------------------------
74  virtual void pack_user_data(const BCP_user_data* ud, BCP_buffer& buf);
75 
78 };
79 
80 
81 #endif
82 
83 
void BCP_pack_warmstart(const BCP_warmstart *ws, BCP_buffer &buf)
This is the class from which the user should derive her own algorithmic cuts.
Definition: BCP_cut.hpp:242
virtual BCP_user_data * unpack_user_data(BCP_buffer &buf)
Unpack an user data.
virtual void pack_warmstart(const BCP_warmstart *ws, BCP_buffer &buf, bool report_if_default=false)
Pack warmstarting information.
Definition: BB_packer.hpp:28
Warmstarting information for the LP solver.
virtual void pack_var_algo(const BCP_var_algo *var, BCP_buffer &buf)
Pack an algorithmic variable.
Definition: BB_packer.hpp:51
Class taking care of packing/unpacking.
Definition: BB_packer.hpp:22
virtual BCP_cut_algo * unpack_cut_algo(BCP_buffer &buf)
Unpack an algorithmic cut.
Currently there isn't any error handling in BCP.
Definition: BCP_error.hpp:20
virtual void pack_cut_algo(const BCP_cut_algo *cut, BCP_buffer &buf)
Pack an algorithmic cut.
This is the class from which the user should derive her own algorithmic variables.
Definition: BCP_var.hpp:277
This class describes the message buffer used for all processes of BCP.
Definition: BCP_buffer.hpp:39
BCP_warmstart * BCP_unpack_warmstart(BCP_buffer &buf)
virtual void pack_user_data(const BCP_user_data *ud, BCP_buffer &buf)
Pack an user data.
virtual BCP_var_algo * unpack_var_algo(BCP_buffer &buf)
Unpack an algorithmic variable.
Definition: BB_packer.hpp:58
virtual BCP_warmstart * unpack_warmstart(BCP_buffer &buf, bool report_if_default=false)
Unpack warmstarting information.
Definition: BB_packer.hpp:39