BCP_var Class Reference

Abstract base class that defines members common to all types of variables. More...

#include <BCP_var.hpp>

Inheritance diagram for BCP_var:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Constructor and destructor

Note that there is no default constructor.

There is no such thing as "default variable".



 BCP_var (const BCP_var_t var_type, const double obj, const double lb, const double ub)
 The constructor sets the internal index of the variable to zero and the other data members to the given arguments.
virtual ~BCP_var ()
 The destructor is virtual so that the appropriate destructor is invoked for every variable.
Query methods



virtual BCP_object_t obj_type () const =0
 Return the type of the variable.
BCP_var_t var_type () const
 Return the integrality type of the variable.
double obj () const
 Return the objective coefficient.
double lb () const
 Return the lower bound.
double ub () const
 Return the upper bound.
int bcpind () const
 Return the internal index of the variable.
Query methods about the status of the variable



BCP_obj_status status () const
 Return the status of the variable.
bool dont_send_to_pool () const
 Return whether the variable should be sent to the Variable Pool process.
bool is_fixed () const
 Return whether the variable is fixed or not.
bool is_fixed_to_zero () const
 Return whether the variable is fixed to zero or not.
bool is_non_removable () const
 Return whether the variable is marked NotRemovable.
bool is_removable () const
 Return whether the variable is removable from the formulation at the time of the query.
bool is_to_be_removed () const
 Return whether the variable must be removed from the formulation.
Modifying methods



void test_inactive ()
 Test (and set) whether the var is fixed (inactive).
void set_var_type (const BCP_var_t type)
 Set the integrality type of the variable.
void set_obj (const double obj)
 Set the objective coefficient.
void set_lb (const double lb)
 Set the lower bound.
void set_ub (const double ub)
 Set the upper bound.
void change_lb_ub_st (const BCP_obj_change &change)
 Set the lower/upper bounds and the status of the variable simultaneously to the values given in the data members of the argument.
void change_bounds (const double lb, const double ub)
 Change the lower and upper bounds to the given values.
void set_bcpind (const int bcpind)
 Set the internal index of the variable.
Status modifying methods



void set_status (const BCP_obj_status status)
 Set the status of the variable.
void dont_send_to_pool (bool flag)
 Set/unset the flag controlling whether the variable could be sent to the Variable Pool process.
void make_active ()
 Mark the variable as active.
void make_non_removable ()
 Mark the variable as NotRemovable.
void make_to_be_removed ()
 Mark the variable as ToBeRemoved.
Display



void display (const double val) const
 Display the object type, internal index, and the value given in the argument.

Protected Attributes

Protected data members



BCP_var_t _var_type
 The integrality type of the variable.
double _obj
 The objective coefficient.
double _lb
 Lower bound on the value the variable can take.
double _ub
 Upper bound on the value the variable can take.

Private Member Functions

Disabled methods



 BCP_var ()
 The default constructor is declared but not defined to disable it.
 BCP_var (const BCP_var &)
 The copy constructor is declared but not defined to disable it.
BCP_varoperator= (const BCP_var &)
 The assignment operator is declared but not defined to disable it.

Private Attributes

Private data members

These are used only by BCP, the user need not worry about them.



int _bcpind
 The internal, unique index of the variable.
BCP_obj_status _status
 The status of the variable.

Detailed Description

Abstract base class that defines members common to all types of variables.

Classes describing the three types of variables (core , indexed and algorithmic ) are derived from this class. No object of type BCP_var can exist (having purely virtual members in the class enforces this restriction).

Definition at line 27 of file BCP_var.hpp.


Constructor & Destructor Documentation

BCP_var::BCP_var (  )  [private]

The default constructor is declared but not defined to disable it.

(Just to make certain that the compiler doesn't generate it.)

BCP_var::BCP_var ( const BCP_var  )  [private]

The copy constructor is declared but not defined to disable it.

BCP_var::BCP_var ( const BCP_var_t  var_type,
const double  obj,
const double  lb,
const double  ub 
) [inline]

The constructor sets the internal index of the variable to zero and the other data members to the given arguments.

Definition at line 70 of file BCP_var.hpp.

virtual BCP_var::~BCP_var (  )  [inline, virtual]

The destructor is virtual so that the appropriate destructor is invoked for every variable.

Definition at line 76 of file BCP_var.hpp.


Member Function Documentation

BCP_var& BCP_var::operator= ( const BCP_var  )  [private]

The assignment operator is declared but not defined to disable it.

Reimplemented in BCP_var_core, BCP_var_indexed, and BCP_var_algo.

virtual BCP_object_t BCP_var::obj_type (  )  const [pure virtual]

Return the type of the variable.

Implemented in BCP_var_core, BCP_var_indexed, and BCP_var_algo.

BCP_var_t BCP_var::var_type (  )  const [inline]

Return the integrality type of the variable.

Definition at line 84 of file BCP_var.hpp.

double BCP_var::obj (  )  const [inline]

Return the objective coefficient.

Definition at line 86 of file BCP_var.hpp.

double BCP_var::lb (  )  const [inline]

Return the lower bound.

Definition at line 88 of file BCP_var.hpp.

double BCP_var::ub (  )  const [inline]

Return the upper bound.

Definition at line 90 of file BCP_var.hpp.

int BCP_var::bcpind (  )  const [inline]

Return the internal index of the variable.

Definition at line 92 of file BCP_var.hpp.

BCP_obj_status BCP_var::status (  )  const [inline]

Return the status of the variable.

Definition at line 97 of file BCP_var.hpp.

bool BCP_var::dont_send_to_pool (  )  const [inline]

Return whether the variable should be sent to the Variable Pool process.

(Assuming that it stays in the formulation long enough to qualify to be sent to the Variable Pool at all.

Definition at line 101 of file BCP_var.hpp.

bool BCP_var::is_fixed (  )  const [inline]

Return whether the variable is fixed or not.

Definition at line 105 of file BCP_var.hpp.

bool BCP_var::is_fixed_to_zero (  )  const [inline]

Return whether the variable is fixed to zero or not.

Definition at line 109 of file BCP_var.hpp.

bool BCP_var::is_non_removable (  )  const [inline]

Return whether the variable is marked NotRemovable.

Examples of such variables include ???

Definition at line 114 of file BCP_var.hpp.

bool BCP_var::is_removable (  )  const [inline]

Return whether the variable is removable from the formulation at the time of the query.

(It is if it is not non_removable and it is fixed to zero.)

Definition at line 120 of file BCP_var.hpp.

bool BCP_var::is_to_be_removed (  )  const [inline]

Return whether the variable must be removed from the formulation.

There are very few circumstances when this flag is set; all of them are completely internal to BCP.

Definition at line 126 of file BCP_var.hpp.

void BCP_var::test_inactive (  )  [inline]

Test (and set) whether the var is fixed (inactive).

Definition at line 135 of file BCP_var.hpp.

void BCP_var::set_var_type ( const BCP_var_t  type  )  [inline]

Set the integrality type of the variable.

Definition at line 140 of file BCP_var.hpp.

void BCP_var::set_obj ( const double  obj  )  [inline]

Set the objective coefficient.

Definition at line 142 of file BCP_var.hpp.

void BCP_var::set_lb ( const double  lb  )  [inline]

Set the lower bound.

Definition at line 144 of file BCP_var.hpp.

void BCP_var::set_ub ( const double  ub  )  [inline]

Set the upper bound.

Definition at line 149 of file BCP_var.hpp.

void BCP_var::change_lb_ub_st ( const BCP_obj_change change  )  [inline]

Set the lower/upper bounds and the status of the variable simultaneously to the values given in the data members of the argument.

Definition at line 156 of file BCP_var.hpp.

void BCP_var::change_bounds ( const double  lb,
const double  ub 
) [inline]

Change the lower and upper bounds to the given values.

Definition at line 163 of file BCP_var.hpp.

void BCP_var::set_bcpind ( const int  bcpind  )  [inline]

Set the internal index of the variable.

Definition at line 169 of file BCP_var.hpp.

void BCP_var::set_status ( const BCP_obj_status  status  )  [inline]

Set the status of the variable.

Definition at line 174 of file BCP_var.hpp.

void BCP_var::dont_send_to_pool ( bool  flag  )  [inline]

Set/unset the flag controlling whether the variable could be sent to the Variable Pool process.

Definition at line 177 of file BCP_var.hpp.

void BCP_var::make_active (  )  [inline]

Mark the variable as active.

Note that when this method is invoked the lp formulation must be modified as well: the original bounds of the variable must be reset.

Definition at line 186 of file BCP_var.hpp.

void BCP_var::make_non_removable (  )  [inline]

Mark the variable as NotRemovable.

Definition at line 190 of file BCP_var.hpp.

void BCP_var::make_to_be_removed (  )  [inline]

Mark the variable as ToBeRemoved.

It will actually be removed immediately after all variables that have to be marked this way are marked.

Definition at line 198 of file BCP_var.hpp.

void BCP_var::display ( const double  val  )  const

Display the object type, internal index, and the value given in the argument.

(This value is usually the variable's value in an LP solution.)


Member Data Documentation

int BCP_var::_bcpind [private]

The internal, unique index of the variable.

Definition at line 45 of file BCP_var.hpp.

The status of the variable.

Definition at line 47 of file BCP_var.hpp.

The integrality type of the variable.

Definition at line 54 of file BCP_var.hpp.

double BCP_var::_obj [protected]

The objective coefficient.

Definition at line 56 of file BCP_var.hpp.

double BCP_var::_lb [protected]

Lower bound on the value the variable can take.

Definition at line 58 of file BCP_var.hpp.

double BCP_var::_ub [protected]

Upper bound on the value the variable can take.

Definition at line 60 of file BCP_var.hpp.


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

Generated on 15 Mar 2015 for Coin-All by  doxygen 1.6.1