Bcp 1.4.4
Loading...
Searching...
No Matches
BCP_tm_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_TM_USER_FUN_H
4#define _BCP_TM_USER_FUN_H
5
6// This file is fully docified.
7
8#include "BCP_math.hpp"
9#include "BCP_enum.hpp"
11#include "BCP_vector.hpp"
12#include "BCP_string.hpp"
13#include "BCP_buffer.hpp"
14#include "BCP_solution.hpp"
15#include "BCP_warmstart.hpp"
16#include "BCP_var.hpp"
17#include "BCP_cut.hpp"
18#include "BCP_matrix.hpp"
19#include "BCP_tm_param.hpp"
20#include "BCP_tm_node.hpp"
21#include "BCP_enum_tm.hpp"
23#include "BCP_USER.hpp"
24
26
27//#############################################################################
28
57
59private:
60 mutable BCP_tm_prob * p;
61public:
69 void setTmProblemPointer(BCP_tm_prob * ptr) { p = ptr; }
71 BCP_tm_prob * getTmProblemPointer() const { return p; }
73
77 double upper_bound() const;
81 double lower_bound() const;
83
87 char get_param(const BCP_tm_par::chr_params key) const;
89 int get_param(const BCP_tm_par::int_params key) const;
91 double get_param(const BCP_tm_par::dbl_params key) const;
94
96 void set_param(const BCP_tm_par::chr_params key, const bool val);
98 void set_param(const BCP_tm_par::chr_params key, const char val);
100 void set_param(const BCP_tm_par::int_params key, const int val);
102 void set_param(const BCP_tm_par::dbl_params key, const double val);
104 void set_param(const BCP_tm_par::str_params key, const char * val);
106
107 //===========================================================================
110 BCP_tm_user() : p(0) {}
113 virtual ~BCP_tm_user() {}
115
116 //===========================================================================
117 // Here are the user defined functions. For each of them a default is given
118 // which can be overridden when the concrete user class is defined.
119 //===========================================================================
120
122
130 virtual void
132
140 virtual BCP_solution*
142
147 virtual bool
148 replace_solution(const BCP_solution* old_sol, const BCP_solution* new_sol);
149
151
152 //--------------------------------------------------------------------------
154 int process_id() const;
156 void
157 send_message(const int target, const BCP_buffer& buf);
159 void
160 broadcast_message(const BCP_process_t proc_type, const BCP_buffer& buf);
163 virtual void
165 //--------------------------------------------------------------------------
177 virtual void
180 BCP_lp_relax*& matrix);
181 //-------------------------------------------------------------------------
191 virtual void
193 BCP_vec<BCP_cut*>& added_cuts,
194 BCP_user_data*& user_data);
196
197 //--------------------------------------------------------------------------
199 virtual void
201
202 //--------------------------------------------------------------------------
207 virtual void
209 const BCP_tm_node& node);
210
211 //--------------------------------------------------------------------------
215 virtual void
217 const BCP_tm_node& node,
218 bool after_processing_node);
219
220 //--------------------------------------------------------------------------
222 virtual void
224
225 //---------------------------------------------------------------------------
230 virtual void
231 init_new_phase(int phase,
232 BCP_column_generation& colgen,
233 CoinSearchTreeBase*& candidates);
235
236 //---------------------------------------------------------------------------
247 virtual void
249 const bool new_solution);
251};
252
253//#############################################################################
254
255#endif
BCP_column_generation
This enumerative constant describes what to do when a search tree node becomes fathomable for the cur...
Definition BCP_enum.hpp:65
BCP_process_t
This enumerative constant describes the various process types.
This class describes the message buffer used for all processes of BCP.
An object of type BCP_lp_relax holds the description of an lp relaxation.
NO OLD DOC.
Definition BCP_lp.hpp:56
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.
NO OLD DOC.
Definition BCP_tm.hpp:136
void set_param(const BCP_tm_par::chr_params key, const char val)
virtual void init_new_phase(int phase, BCP_column_generation &colgen, CoinSearchTreeBase *&candidates)
Do whatever initialization is necessary before the phase-th phase.
virtual void initialize_core(BCP_vec< BCP_var_core * > &vars, BCP_vec< BCP_cut_core * > &cuts, BCP_lp_relax *&matrix)
Create the core of the problem by filling out the last three arguments.
virtual void process_message(BCP_buffer &buf)
Process a message that has been sent by another process' user part to this process' user part.
virtual BCP_solution * unpack_feasible_solution(BCP_buffer &buf)
Unpack a MIP feasible solution that was packed by the BCP_lp_user::pack_feasible_solution() method.
void set_param(const BCP_tm_par::chr_params key, const bool val)
char get_param(const BCP_tm_par::chr_params key) const
virtual void create_root(BCP_vec< BCP_var * > &added_vars, BCP_vec< BCP_cut * > &added_cuts, BCP_user_data *&user_data)
Create the set of extra variables and cuts that should be added to the formulation in the root node.
double lower_bound() const
Return a global lower bound.
double get_param(const BCP_tm_par::dbl_params key) const
void setTmProblemPointer(BCP_tm_prob *ptr)
Set the pointer.
virtual bool replace_solution(const BCP_solution *old_sol, const BCP_solution *new_sol)
Decide whether to replace old_sol with new_sol.
virtual void pack_module_data(BCP_buffer &buf, BCP_process_t ptype)
Pack the initial information (info that the user wants to send over) for the process specified by the...
void broadcast_message(const BCP_process_t proc_type, const BCP_buffer &buf)
Broadcast the message to all processes of the given type.
double upper_bound() const
Return what is the best known upper bound (might be BCP_DBL_MAX)
void set_param(const BCP_tm_par::str_params key, const char *val)
void send_message(const int target, const BCP_buffer &buf)
Send a message to a particular process.
void set_param(const BCP_tm_par::dbl_params key, const double val)
virtual void display_feasible_solution(const BCP_solution *sol)
Display a feasible solution.
virtual void display_final_information(const BCP_lp_statistics &lp_stat)
Display information after BCP finished processing the search tree.
virtual ~BCP_tm_user()
Being virtual, the destructor invokes the destructor for the real type of the object being deleted.
virtual void display_node_information(BCP_tree &search_tree, const BCP_tm_node &node)
Display user information just before a new node is sent to the LP or diving into a node is acknowledg...
void set_param(const BCP_tm_par::int_params key, const int val)
BCP_tm_prob * getTmProblemPointer() const
Get the pointer.
virtual void change_candidate_heap(CoinSearchTreeManager &candidates, const bool new_solution)
int process_id() const
What is the process id of the current process.
int get_param(const BCP_tm_par::int_params key) const
virtual void display_node_information(BCP_tree &search_tree, const BCP_tm_node &node, bool after_processing_node)
Display user information.
const BCP_string & get_param(const BCP_tm_par::str_params key) const
NO OLD DOC.
The class BCP_vec serves the same purpose as the vector class in the standard template library.
str_params
String parameters.
chr_params
Character parameters.
dbl_params
Double parameters.
int_params
Integer parameters.