Bcp 1.4.4
Loading...
Searching...
No Matches
BCP_lp.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_LP_H
4#define _BCP_LP_H
5
6#include <cfloat>
7
8#include "BCP_math.hpp"
9#include "BCP_enum.hpp"
11#include "BCP_vector.hpp"
12
13#include "BCP_lp_param.hpp"
14#include "BCP_parameters.hpp"
15
16#include "BCP_buffer.hpp"
17#include "BCP_process.hpp"
18
19//#############################################################################
20class OsiObject;
21
22class BCP_lp_user;
23class BCP_user_pack;
26
27class BCP_lp_result;
28
31
32class BCP_var;
33class BCP_cut;
34
35class BCP_col;
36class BCP_row;
37
38class BCP_solution;
39
40class BCP_lp_var_pool;
41class BCP_lp_cut_pool;
42
43class BCP_lp_node;
44class BCP_lp_parent;
45class CoinWarmStart;
46
47//#############################################################################
48
49// Everything in BCP_lp_prob is public. If the user wants to shoot herself in
50// the leg she can do it.
51
55
57public:
70
71public:
81
85 void pack(BCP_buffer& buf);
87 void unpack(BCP_buffer& buf);
89
91 void display() const;
92
95 void add(const BCP_lp_statistics& stat);
96};
97
101
102class BCP_lp_prob : public BCP_process {
103private:
107 BCP_lp_prob(const BCP_lp_prob&);
109 BCP_lp_prob& operator=(const BCP_lp_prob&);
111
112public:
116 BCP_lp_prob(int my_id, int parent);
118 virtual ~BCP_lp_prob();
120
121public:
122 //-------------------------------------------------------------------------
123 // The unpacking classes
126 //------------------------------------------------------------------------
127 // User provided members
141
147
148 //------------------------------------------------------------------------
149 // the description of the core
157
158 //------------------------------------------------------------------------
161 std::vector<OsiObject *> intAndSosObjects;
162
163 //------------------------------------------------------------------------
164 // the search tree node we are working on and its parent
176
177 //------------------------------------------------------------------------
178 // Info while processing a particular node. Need to be updated when
179 // starting a new node.
194
195 // The next/last index we can assign to a newly generated var/cut
205
206 //------------------------------------------------------------------------
207 // time measurements
215
216 //------------------------------------------------------------------------
217 // Internal members
218 //------------------------------------------------------------------------
224 int phase;
226 int no_more_cuts_cnt; // a counter for how many places we got to get
227 // NO_MORE_CUTS message to know for sure not to
228 // expect more.
230 int no_more_vars_cnt; // similar for vars
232
233 // message passing related fields
237 // int tree_manager;
241 //------------------------------------------------------------------------
242 // Results of BCP_lp_user::process_lp_result() are stored here
243 //------------------------------------------------------------------------
251
252 //------------------------------------------------------------------------ // end of data members
254
255public:
259 void pack_var(const BCP_var& var);
263 void pack_cut(const BCP_cut& cut);
267 //-------------------------------------------------------------------------
270 // member functions related to accessing the parameters
274 inline char
275 param(BCP_lp_par::chr_params key) const { return par.entry(key); }
277 inline int
278 param(BCP_lp_par::int_params key) const { return par.entry(key); }
280 inline double
281 param(BCP_lp_par::dbl_params key) const { return par.entry(key); }
283 inline const BCP_string&
284 param(BCP_lp_par::str_params key) const { return par.entry(key); }
286 inline const BCP_vec<BCP_string>&
287 param(BCP_lp_par::str_array_params key) const { return par.entry(key); }
289 inline double granularity() const {
291 }
292
293
294 //-------------------------------------------------------------------------
298 inline bool has_ub() const { return upper_bound < BCP_DBL_MAX / 10; }
300 inline double ub() const { return upper_bound; }
302 inline bool ub(double new_ub) {
303 if (new_ub < upper_bound){
304 upper_bound = new_ub;
305 return true;
306 }
307 return false;
308 }
309
310 inline bool over_ub(double lb) const {
311 return has_ub() && lb >= upper_bound - granularity();
312 }
313 // end of query methods
315 //-------------------------------------------------------------------------
316 virtual BCP_buffer& get_message_buffer() { return msg_buf; }
317 virtual void process_message();
318};
319
320#endif
#define BCP_DBL_MAX
Definition BCP_math.hpp:6
This class describes the message buffer used for all processes of BCP.
This class holds a column in a compressed form.
Abstract base class that defines members common to all types of cuts.
Definition BCP_cut.hpp:29
NO OLD DOC.
NO OLD DOC.
BCP_lp_statistics stat
Definition BCP_lp.hpp:213
int param(BCP_lp_par::int_params key) const
Definition BCP_lp.hpp:278
char param(BCP_lp_par::chr_params key) const
Definition BCP_lp.hpp:275
bool has_ub() const
Definition BCP_lp.hpp:298
int no_more_cuts_cnt
Definition BCP_lp.hpp:226
double ub() const
Definition BCP_lp.hpp:300
BCP_vec< BCP_cut * > new_cuts
Definition BCP_lp.hpp:245
BCP_vec< BCP_col * > new_cols
Definition BCP_lp.hpp:248
std::vector< OsiObject * > intAndSosObjects
Things that can be branched on.
Definition BCP_lp.hpp:161
double upper_bound
Definition BCP_lp.hpp:222
int last_cut_index
Definition BCP_lp.hpp:203
bool over_ub(double lb) const
Definition BCP_lp.hpp:310
int no_more_vars_cnt
Definition BCP_lp.hpp:230
BCP_problem_core * core
Definition BCP_lp.hpp:153
const BCP_string & param(BCP_lp_par::str_params key) const
Definition BCP_lp.hpp:284
int next_var_index
Definition BCP_lp.hpp:197
virtual ~BCP_lp_prob()
BCP_vec< BCP_row * > new_rows
Definition BCP_lp.hpp:246
BCP_solution * sol
Definition BCP_lp.hpp:249
BCP_lp_user * user
Definition BCP_lp.hpp:131
BCP_user_pack * packer
A class that holds the methods about how to pack things.
Definition BCP_lp.hpp:133
BCP_lp_prob(int my_id, int parent)
CoinWarmStart * warmstartRoot
Description of the warmstart info from the end of the root node.
Definition BCP_lp.hpp:174
BCP_vec< BCP_var * > new_vars
Definition BCP_lp.hpp:247
BCP_lp_parent * parent
Description of the parent of the current node.
Definition BCP_lp.hpp:170
int last_var_index
Definition BCP_lp.hpp:199
OsiSolverInterface * lp_solver
Definition BCP_lp.hpp:137
int var_bound_changes_since_logical_fixing
Definition BCP_lp.hpp:187
BCP_problem_core_change * core_as_change
Definition BCP_lp.hpp:155
BCP_vec< BCP_cut * > slack_pool
Definition BCP_lp.hpp:189
BCP_lp_result * lp_result
Definition BCP_lp.hpp:185
bool ub(double new_ub)
Definition BCP_lp.hpp:302
BCP_cut * unpack_cut()
OsiSolverInterface * master_lp
Definition BCP_lp.hpp:135
BCP_var * unpack_var()
double param(BCP_lp_par::dbl_params key) const
Definition BCP_lp.hpp:281
double new_true_lower_bound
Definition BCP_lp.hpp:250
BCP_lp_var_pool * local_var_pool
Definition BCP_lp.hpp:191
void pack_var(const BCP_var &var)
BCP_message_environment * msg_env
Definition BCP_lp.hpp:139
const BCP_vec< BCP_string > & param(BCP_lp_par::str_array_params key) const
Definition BCP_lp.hpp:287
BCP_parameter_set< BCP_lp_par > par
Definition BCP_lp.hpp:145
virtual BCP_buffer & get_message_buffer()
Definition BCP_lp.hpp:316
double start_time
Definition BCP_lp.hpp:211
virtual void process_message()
void pack_cut(const BCP_cut &cut)
BCP_lp_cut_pool * local_cut_pool
Definition BCP_lp.hpp:193
double granularity() const
Definition BCP_lp.hpp:289
bool user_has_lp_result_processing
Definition BCP_lp.hpp:244
BCP_lp_node * node
Description he current search tree node.
Definition BCP_lp.hpp:168
int next_cut_index
Definition BCP_lp.hpp:201
BCP_buffer msg_buf
Definition BCP_lp.hpp:239
This class holds the results after solving an LP relaxation.
NO OLD DOC.
Definition BCP_lp.hpp:56
void display() const
Print out the statistics.
void add(const BCP_lp_statistics &stat)
Add the argument statistics to this one.
void unpack(BCP_buffer &buf)
double time_heuristics
Definition BCP_lp.hpp:65
void pack(BCP_buffer &buf)
double time_cut_generation
Definition BCP_lp.hpp:61
double time_branching
Definition BCP_lp.hpp:69
BCP_lp_statistics()
The contsructor just zeros out every timing data.
Definition BCP_lp.hpp:73
double time_var_generation
Definition BCP_lp.hpp:63
double time_feas_testing
Definition BCP_lp.hpp:59
double time_lp_solving
Definition BCP_lp.hpp:67
The BCP_lp_user class is the base class from which the user can derive a problem specific class to be...
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.
This class describes changes in the core of the problem.
This class describes the core of the MIP problem, the variables/cuts in it as well as the matrix corr...
BCP_process(int self, int my_parent)
This class holds a row in a compressed form.
This is the abstract base class for a solution to a Mixed Integer Programming problem.
This class is a very simple impelementation of a constant length string.
Abstract base class that defines members common to all types of variables.
Definition BCP_var.hpp:28
The class BCP_vec serves the same purpose as the vector class in the standard template library.
dbl_params
Double parameters.
@ Granularity
The minimum difference between the objective value of any two feasible solution (with different objec...
str_params
String parameters.
int_params
Integer parameters.
chr_params
Character parameters.
str_array_params
There are no string array parameters.