- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# OS_lp Class Reference

Class for operations at the node level. More...

`#include <OS_lp.hpp>`

Collaboration diagram for OS_lp:

[legend]
List of all members.

## Public Member Functions
virtual OsiSolverInterface * | initialize_solver_interface ()
| Called only once at the beginning, from the root node.
virtual void | initialize_new_search_tree_node (const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_vec< BCP_obj_status > &var_status, const BCP_vec< BCP_obj_status > &cut_status, BCP_vec< int > &var_changed_pos, BCP_vec< double > &var_new_bd, BCP_vec< int > &cut_changed_pos, BCP_vec< double > &cut_new_bd)
| Initialize data members at the start of processing a new subproblem.
virtual void | modify_lp_parameters (OsiSolverInterface *lp, bool in_strong_branching)
| Modify the parameters of the LP solver.
virtual void | display_lp_solution (const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const bool final_lp_solution)
| Cut generation.
virtual BCP_solution * | generate_heuristic_solution (const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
| Simple rounding heuristic.
virtual void | cuts_to_rows (const BCP_vec< BCP_var * > &vars, BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_row * > &rows, const BCP_lp_result &lpres, BCP_object_origin origin, bool allow_multiple)
| Describes how to get a row of the matrix from the representation of the cut.
virtual BCP_branching_decision | select_branching_candidates (const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_lp_var_pool &local_var_pool, const BCP_lp_cut_pool &local_cut_pool, BCP_vec< BCP_lp_branching_object * > &cands, bool force_branch=false)
| Called at the end of each iteration.
virtual void | set_user_data_for_children (BCP_presolved_lp_brobj *best, const int selected)
| Set up the user data for the children according to the chosen branching object.
virtual void | vars_to_cols (const BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_var * > &vars, BCP_vec< BCP_col * > &cols, const BCP_lp_result &lpres, BCP_object_origin origin, bool allow_multiple)
virtual void | process_lp_result (const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const double old_lower_bound, double &true_lower_bound, BCP_solution *&sol, BCP_vec< BCP_cut * > &new_cuts, BCP_vec< BCP_row * > &new_rows, BCP_vec< BCP_var * > &new_vars, BCP_vec< BCP_col * > &new_cols)
| Process the result of an iteration.
Constructors and destructors
| OS_lp ()
| Default constructor.
virtual | ~OS_lp ()
| Destructor.
Packing and unpacking methods
virtual void | unpack_module_data (BCP_buffer &buf)
| Unpack data sent from the tree manager.
## Private Attributes
OsiSolverInterface * | cg_lp
OS_prob * | os_prob
| Pointer on the description of the problem.
MY_user_data * | p_ud
| Pointer on the description of the user data.
int | in_strong
| in_strong = 1 if and only if in strong branching phase
double | EPS
| Hold the value of EPSILON of class OS_prob.
BCP_vec< BCP_cut * > | algo_cuts
| Hold pointers on generated algorithmic cuts.
BCP_vec< BCP_var * > | algo_vars
| Hold pointers on generated variables.
bool | generated_vars
bool | generated_cuts
std::vector< int > | violated_cuts
| Hold indices of violated indexed cuts.

## Detailed Description

Class for operations at the node level.

Definition at line 28 of file OS_lp.hpp.

## Constructor & Destructor Documentation

OS_lp::OS_lp | ( |  | ) | `[inline]`

Default constructor.

Definition at line 70 of file OS_lp.hpp.

virtual OS_lp::~OS_lp | ( |  | ) | `[inline, virtual]`

Destructor.

Definition at line 73 of file OS_lp.hpp.

## Member Function Documentation

void OS_lp::unpack_module_data | ( | BCP_buffer & | buf | ) | `[virtual]`

Unpack data sent from the tree manager.

we also have access to the osinstance object that was created in OS_tm the OS_tm tree manager sent us a pointer to this -- the osinstance is actually a memeber of OS_prob -- put in this class information we want access to

Definition at line 34 of file OS_lp.cpp.

References EPS, OS_prob::EPSILON, OSInstance::getVariableNumber(), os_prob, and OS_prob::osinstance.

OsiSolverInterface * OS_lp::initialize_solver_interface | ( |  | ) | `[virtual]`

Called only once at the beginning, from the root node.

Definition at line 55 of file OS_lp.cpp.

void OS_lp::initialize_new_search_tree_node | ( | const BCP_vec< BCP_var * > & | vars,
|  | const BCP_vec< BCP_cut * > & | cuts,
|  | const BCP_vec< BCP_obj_status > & | var_status,
|  | const BCP_vec< BCP_obj_status > & | cut_status,
|  | BCP_vec< int > & | var_changed_pos,
|  | BCP_vec< double > & | var_new_bd,
|  | BCP_vec< int > & | cut_changed_pos,
|  | BCP_vec< double > & | cut_new_bd |
| ) |  |  | `[virtual]`

Initialize data members at the start of processing a new subproblem.

Definition at line 63 of file OS_lp.cpp.

References in_strong, and MY_user_data::is_processed.

void OS_lp::modify_lp_parameters | ( | OsiSolverInterface * | lp,
|  | bool | in_strong_branching |
| ) |  |  | `[virtual]`

Modify the parameters of the LP solver.

Called at the beginning of the optimization of a node when the node LP is not yet solved.

Definition at line 111 of file OS_lp.cpp.

void OS_lp::display_lp_solution | ( | const BCP_lp_result & | lpres,
|  | const BCP_vec< BCP_var * > & | vars,
|  | const BCP_vec< BCP_cut * > & | cuts,
|  | const bool | final_lp_solution |
| ) |  |  | `[virtual]`

Cut generation.

Send to BCP the cuts generated in test_feasibility. Use this function to generate standard cuts (Knapsack covers, Lift-and-Project, odd holes, ...).

Definition at line 594 of file OS_lp.cpp.

BCP_solution * OS_lp::generate_heuristic_solution | ( | const BCP_lp_result & | lpres,
|  | const BCP_vec< BCP_var * > & | vars,
|  | const BCP_vec< BCP_cut * > & | cuts |
| ) |  |  | `[virtual]`

Simple rounding heuristic.

Definition at line 145 of file OS_lp.cpp.

void OS_lp::cuts_to_rows | ( | const BCP_vec< BCP_var * > & | vars,
|  | BCP_vec< BCP_cut * > & | cuts,
|  | BCP_vec< BCP_row * > & | rows,
|  | const BCP_lp_result & | lpres,
|  | BCP_object_origin | origin,
|  | bool | allow_multiple |
| ) |  |  | `[virtual]`

Describes how to get a row of the matrix from the representation of the cut.

Required method when indexed or algorithmic cuts are used.

Definition at line 286 of file OS_lp.cpp.

BCP_branching_decision OS_lp::select_branching_candidates | ( | const BCP_lp_result & | lpres,
|  | const BCP_vec< BCP_var * > & | vars,
|  | const BCP_vec< BCP_cut * > & | cuts,
|  | const BCP_lp_var_pool & | local_var_pool,
|  | const BCP_lp_cut_pool & | local_cut_pool,
|  | BCP_vec< BCP_lp_branching_object * > & | cands,
|  | bool | force_branch = `false` |
| ) |  |  | `[virtual]`

Called at the end of each iteration.

Possible return values are: BCP_DoNotBranch_Fathomed : The node should be fathomed without branching; BCP_DoNotBranch : BCP should continue to work on this node; BCP_DoBranch : Branching must be done. In this case the method returns the branching object candidates in one of the arguments.

Definition at line 154 of file OS_lp.cpp.

void OS_lp::set_user_data_for_children | ( | BCP_presolved_lp_brobj * | best,
|  | const int | selected |
| ) |  |  | `[virtual]`

Set up the user data for the children according to the chosen branching object.

Definition at line 245 of file OS_lp.cpp.

References real_user_data::card_set_zero, EPS, and MY_user_data::p_rud.

void OS_lp::vars_to_cols | ( | const BCP_vec< BCP_cut * > & | cuts,
|  | BCP_vec< BCP_var * > & | vars,
|  | BCP_vec< BCP_col * > & | cols,
|  | const BCP_lp_result & | lpres,
|  | BCP_object_origin | origin,
|  | bool | allow_multiple |
| ) |  |  | `[virtual]`

Definition at line 311 of file OS_lp.cpp.

void OS_lp::process_lp_result | ( | const BCP_lp_result & | lpres,
|  | const BCP_vec< BCP_var * > & | vars,
|  | const BCP_vec< BCP_cut * > & | cuts,
|  | const double | old_lower_bound,
|  | double & | true_lower_bound,
|  | BCP_solution *& | sol,
|  | BCP_vec< BCP_cut * > & | new_cuts,
|  | BCP_vec< BCP_row * > & | new_rows,
|  | BCP_vec< BCP_var * > & | new_vars,
|  | BCP_vec< BCP_col * > & | new_cols |
| ) |  |  | `[virtual]`

Process the result of an iteration.

This includes:

- computing a true lower bound on the subproblem.
  In case column generation is done the lower bound for the subproblem might not be the same as the objective value of the current LP relaxation. Here the user has an option to return a true lower bound.
- test feasibility of the solution (or generate a heuristic solution)
- generating cuts and/or variables

The reason for the existence of this method is that (especially when column generation is done) these tasks are so intertwined that it is much easier to execute them in one method instead of in several separate methods.

The default behavior is to do nothing and invoke the individual methods one-by-one.

Parameters:

  | lp_result | the result of the most recent LP optimization (IN)
  | vars | variables currently in the formulation (IN)
  | cuts | variables currently in the formulation (IN)
  | old_lower_bound | the previously known best lower bound (IN)
  | new_cuts | the vector of generated cuts (OUT)
  | new_rows | the correspontding rows(OUT)
  | new_vars | the vector of generated variables (OUT)
  | new_cols | the correspontding columns(OUT)

Cgl cut addition scope

Definition at line 339 of file OS_lp.cpp.

References algo_cuts, algo_vars, EPS, generated_cuts, and generated_vars.

## Member Data Documentation

OsiSolverInterface* OS_lp::cg_lp`[private]`

Definition at line 30 of file OS_lp.hpp.

OS_prob* OS_lp::os_prob`[private]`

Pointer on the description of the problem.

Definition at line 35 of file OS_lp.hpp.

Referenced by unpack_module_data().

MY_user_data* OS_lp::p_ud`[private]`

Pointer on the description of the user data.

Definition at line 38 of file OS_lp.hpp.

int OS_lp::in_strong`[private]`

in_strong = 1 if and only if in strong branching phase

Definition at line 41 of file OS_lp.hpp.

Referenced by initialize_new_search_tree_node().

double OS_lp::EPS`[private]`

Hold the value of EPSILON of class OS_prob.

Definition at line 44 of file OS_lp.hpp.

Referenced by process_lp_result(), set_user_data_for_children(), and unpack_module_data().

BCP_vec<BCP_cut*> OS_lp::algo_cuts`[private]`

Hold pointers on generated algorithmic cuts.

Definition at line 47 of file OS_lp.hpp.

Referenced by process_lp_result().

BCP_vec<BCP_var*> OS_lp::algo_vars`[private]`

Hold pointers on generated variables.

Definition at line 50 of file OS_lp.hpp.

Referenced by process_lp_result().

bool OS_lp::generated_vars`[private]`

Definition at line 53 of file OS_lp.hpp.

Referenced by process_lp_result().

bool OS_lp::generated_cuts`[private]`

Definition at line 56 of file OS_lp.hpp.

Referenced by process_lp_result().

std::vector<int> OS_lp::violated_cuts`[private]`

Hold indices of violated indexed cuts.

Definition at line 59 of file OS_lp.hpp.

The documentation for this class was generated from the following files:

- /home/coin/SVN-release/OS-2.3.5/ApplicationTemplates/branchCutPrice/include/OS_lp.hpp
- /home/coin/SVN-release/OS-2.3.5/ApplicationTemplates/branchCutPrice/LP/OS_lp.cpp