Bcp 1.4.4
Loading...
Searching...
No Matches
BCP_tmstorage.hpp
Go to the documentation of this file.
1// Copyright (C) 2007, International Business Machines
2// Corporation and others. All Rights Reserved.
3#ifndef _BCP_TMSTORAGE_H
4#define _BCP_TMSTORAGE_H
5
6#include <map>
7
9#include "BCP_buffer.hpp"
10#include "BCP_message.hpp"
11#include "BCP_parameters.hpp"
12#include "BCP_process.hpp"
13#include "BCP_USER.hpp"
14#include "BCP_problem_core.hpp"
15
16//#############################################################################
17
18class BCP_var_algo;
19class BCP_cut_algo;
20
21class BCP_node_change;
22
23//#############################################################################
24
25class BCP_ts_prob;
26class BCP_ts_user;
27
28//#############################################################################
29
62
63//#############################################################################
64
71
72//#############################################################################
73
74class BCP_ts_prob : public BCP_process {
75private:
81 BCP_ts_prob& operator=(const BCP_ts_prob&);
84public:
102 std::map<int, BCP_ts_node_data*> nodes; // *FIXME*: maybe hash_map better ?
104 std::map<int, BCP_var_algo*> vars; // *FIXME*: maybe hash_map better ?
106 std::map<int, BCP_cut_algo*> cuts; // *FIXME*: maybe hash_map better ?
107
108public:
110 BCP_ts_prob(int my_id, int parent) :
111 BCP_process(my_id, parent),
112 user(0),
113 msg_env(0),
114 core(new BCP_problem_core) {}
116 virtual ~BCP_ts_prob();
117
118public:
119 virtual BCP_buffer& get_message_buffer() { return msg_buf; }
120 virtual void process_message();
121};
122
123//#############################################################################
124
126private:
127 BCP_ts_prob * p;
128public:
136 void setTsProblemPointer(BCP_ts_prob * ptr) { p = ptr; }
143 inline char get_param(const BCP_ts_par::chr_params key) const{
144 return p->par.entry(key); }
145 inline int get_param(const BCP_ts_par::int_params key) const{
146 return p->par.entry(key); }
147 inline double get_param(const BCP_ts_par::dbl_params key) const{
148 return p->par.entry(key); }
149 inline const BCP_string& get_param(const BCP_ts_par::str_params key) const{
150 return p->par.entry(key); }
151
152 inline void set_param(const BCP_ts_par::chr_params key, const bool val) {
153 p->par.set_entry(key, val); }
154 inline void set_param(const BCP_ts_par::chr_params key, const char val) {
155 p->par.set_entry(key, val); }
156 inline void set_param(const BCP_ts_par::int_params key, const int val) {
157 p->par.set_entry(key, val); }
158 inline void set_param(const BCP_ts_par::dbl_params key, const double val) {
159 p->par.set_entry(key, val); }
160 inline void set_param(const BCP_ts_par::str_params key, const char * val) {
161 p->par.set_entry(key, val); }
162
163 //=========================================================================
166 BCP_ts_user() : p(0) {}
169 virtual ~BCP_ts_user() {}
172 //=========================================================================
173 // Here are the user defined functions. For each of them a default is
174 // given which can be overridden when the concrete user class is defined.
175 //=========================================================================
176
183 virtual void
185};
186
187#endif
188
This class describes the message buffer used for all processes of BCP.
This is the class from which the user should derive her own algorithmic cuts.
Definition BCP_cut.hpp:242
This is an abstract base class that describes the message passing environment.
This is the class serves as a holder for a set of parameters.
char entry(const chr_params key) const
void set_entry(const chr_params key, const char val)
This class describes the core of the MIP problem, the variables/cuts in it as well as the matrix corr...
This class is a very simple impelementation of a constant length string.
BCP_buffer msg_buf
BCP_problem_core * core
std::map< int, BCP_ts_node_data * > nodes
BCP_message_environment * msg_env
BCP_parameter_set< BCP_ts_par > par
BCP_ts_prob(int my_id, int parent)
virtual BCP_buffer & get_message_buffer()
std::map< int, BCP_var_algo * > vars
BCP_vec< int > indices
a list of indices of nodes/vars/cuts that are requested/tobe deleted
std::map< int, BCP_cut_algo * > cuts
BCP_user_pack * packer
BCP_ts_user * user
BCP_vec< int > positions
positions in the TM of requested nodes/vars/cuts
virtual ~BCP_ts_prob()
virtual void process_message()
void set_param(const BCP_ts_par::str_params key, const char *val)
void set_param(const BCP_ts_par::chr_params key, const bool val)
BCP_ts_prob * getTsProblemPointer()
Get the pointer.
void set_param(const BCP_ts_par::int_params key, const int val)
void setTsProblemPointer(BCP_ts_prob *ptr)
Set the pointer.
int get_param(const BCP_ts_par::int_params key) const
virtual void unpack_module_data(BCP_buffer &buf)
Unpack the initial information sent to the LP process by the Tree Manager.
virtual ~BCP_ts_user()
Being virtual, the destructor invokes the destructor for the real type of the object being deleted.
void set_param(const BCP_ts_par::chr_params key, const char val)
const BCP_string & get_param(const BCP_ts_par::str_params key) const
void set_param(const BCP_ts_par::dbl_params key, const double val)
double get_param(const BCP_ts_par::dbl_params key) const
char get_param(const BCP_ts_par::chr_params key) const
This is the class from which the user should derive her own algorithmic variables.
Definition BCP_var.hpp:277
The class BCP_vec serves the same purpose as the vector class in the standard template library.
Same as BCP_tm_node_data, just there's no need to use smart pointers in this process.
BCP_node_change * _desc
BCP_user_data * _user
@ MaxHeapSize
The maximum size of the memory heap the TS can use.