coin-Bcp
List of all members
BCP_var Class Referenceabstract

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]
Collaboration diagram for BCP_var:
Collaboration graph
[legend]

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. More...
 
virtual ~BCP_var ()
 The destructor is virtual so that the appropriate destructor is invoked for every variable. More...
 
Query methods
virtual BCP_object_t obj_type () const =0
 Return the type of the variable. More...
 
BCP_var_t var_type () const
 Return the integrality type of the variable. More...
 
double obj () const
 Return the objective coefficient. More...
 
double lb () const
 Return the lower bound. More...
 
double ub () const
 Return the upper bound. More...
 
int bcpind () const
 Return the internal index of the variable. More...
 
Query methods about the status of the variable
BCP_obj_status status () const
 Return the status of the variable. More...
 
bool dont_send_to_pool () const
 Return whether the variable should be sent to the Variable Pool process. More...
 
bool is_fixed () const
 Return whether the variable is fixed or not. More...
 
bool is_fixed_to_zero () const
 Return whether the variable is fixed to zero or not. More...
 
bool is_non_removable () const
 Return whether the variable is marked NotRemovable. More...
 
bool is_removable () const
 Return whether the variable is removable from the formulation at the time of the query. More...
 
bool is_to_be_removed () const
 Return whether the variable must be removed from the formulation. More...
 
Modifying methods
void test_inactive ()
 Test (and set) whether the var is fixed (inactive) More...
 
void set_var_type (const BCP_var_t type)
 Set the integrality type of the variable. More...
 
void set_obj (const double obj)
 Set the objective coefficient. More...
 
void set_lb (const double lb)
 Set the lower bound. More...
 
void set_ub (const double ub)
 Set the upper bound. More...
 
void set_lb_ub (const double lb, const double ub)
 Set both lower and upper bounds. More...
 
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. More...
 
void change_bounds (const double lb, const double ub)
 Change the lower and upper bounds to the given values. More...
 
void set_bcpind (const int bcpind)
 Set the internal index of the variable. More...
 
void set_bcpind_flip ()
 Flip the internal index of the variable to its negative. More...
 
Status modifying methods
void set_status (const BCP_obj_status status)
 Set the status of the variable. More...
 
void dont_send_to_pool (bool flag)
 Set/unset the flag controlling whether the variable could be sent to the Variable Pool process. More...
 
void make_active ()
 Mark the variable as active. More...
 
void make_non_removable ()
 Mark the variable as NotRemovable. More...
 
void make_to_be_removed ()
 Mark the variable as ToBeRemoved. More...
 
Display
void display (const double val) const
 Display the object type, internal index, and the value given in the argument. More...
 
- Public Member Functions inherited from Coin::ReferencedObject
 ReferencedObject ()
 
virtual ~ReferencedObject ()
 
int ReferenceCount () const
 
void AddRef () const
 
void ReleaseRef () const
 

Protected Attributes

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

Private Member Functions

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

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. More...
 
BCP_obj_status _status
 The status of the variable. More...
 

Detailed Description

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

Classes describing the three types of variables (core 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 28 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 71 of file BCP_var.hpp.

virtual BCP_var::~BCP_var ( )
inlinevirtual

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

Definition at line 77 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.

virtual BCP_object_t BCP_var::obj_type ( ) const
pure virtual

Return the type of the variable.

Implemented in BCP_var_algo, and BCP_var_core.

BCP_var_t BCP_var::var_type ( ) const
inline

Return the integrality type of the variable.

Definition at line 85 of file BCP_var.hpp.

References _var_type.

double BCP_var::obj ( ) const
inline

Return the objective coefficient.

Definition at line 87 of file BCP_var.hpp.

References _obj.

Referenced by BCP_solution_generic::add_entry(), and set_obj().

double BCP_var::lb ( ) const
inline

Return the lower bound.

Definition at line 89 of file BCP_var.hpp.

References _lb.

Referenced by change_bounds(), set_lb(), and set_lb_ub().

double BCP_var::ub ( ) const
inline

Return the upper bound.

Definition at line 91 of file BCP_var.hpp.

References _ub.

Referenced by change_bounds(), set_lb_ub(), and set_ub().

int BCP_var::bcpind ( ) const
inline

Return the internal index of the variable.

Definition at line 93 of file BCP_var.hpp.

References _bcpind.

Referenced by BCP_var_core::BCP_var_core(), and set_bcpind().

BCP_obj_status BCP_var::status ( ) const
inline

Return the status of the variable.

Definition at line 98 of file BCP_var.hpp.

References _status.

Referenced by BCP_var_core::BCP_var_core(), and set_status().

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 102 of file BCP_var.hpp.

References _status, and BCP_ObjDoNotSendToPool.

bool BCP_var::is_fixed ( ) const
inline

Return whether the variable is fixed or not.

Definition at line 106 of file BCP_var.hpp.

References _status, and BCP_ObjInactive.

bool BCP_var::is_fixed_to_zero ( ) const
inline

Return whether the variable is fixed to zero or not.

Definition at line 110 of file BCP_var.hpp.

References _lb, _status, and BCP_ObjInactive.

Referenced by is_removable().

bool BCP_var::is_non_removable ( ) const
inline

Return whether the variable is marked NotRemovable.

Examples of such variables include ???

Definition at line 115 of file BCP_var.hpp.

References _status, and BCP_ObjNotRemovable.

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 121 of file BCP_var.hpp.

References _status, BCP_ObjNotRemovable, and is_fixed_to_zero().

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 127 of file BCP_var.hpp.

References _status, and BCP_ObjToBeRemoved.

void BCP_var::test_inactive ( )
inline

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

Definition at line 136 of file BCP_var.hpp.

References _lb, _status, _ub, and BCP_ObjInactive.

Referenced by change_bounds(), change_lb_ub_st(), set_lb(), set_lb_ub(), and set_ub().

void BCP_var::set_var_type ( const BCP_var_t  type)
inline

Set the integrality type of the variable.

Definition at line 141 of file BCP_var.hpp.

References _var_type.

void BCP_var::set_obj ( const double  obj)
inline

Set the objective coefficient.

Definition at line 143 of file BCP_var.hpp.

References _obj, and obj().

Referenced by MKC_var::MKC_var().

void BCP_var::set_lb ( const double  lb)
inline

Set the lower bound.

Definition at line 145 of file BCP_var.hpp.

References _lb, lb(), and test_inactive().

void BCP_var::set_ub ( const double  ub)
inline

Set the upper bound.

Definition at line 150 of file BCP_var.hpp.

References _ub, test_inactive(), and ub().

void BCP_var::set_lb_ub ( const double  lb,
const double  ub 
)
inline

Set both lower and upper bounds.

Definition at line 155 of file BCP_var.hpp.

References _lb, _ub, lb(), test_inactive(), and ub().

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 163 of file BCP_var.hpp.

References _lb, _status, _ub, BCP_obj_change::lb, BCP_obj_change::stat, test_inactive(), and BCP_obj_change::ub.

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 170 of file BCP_var.hpp.

References _lb, _ub, lb(), test_inactive(), and ub().

void BCP_var::set_bcpind ( const int  bcpind)
inline

Set the internal index of the variable.

Definition at line 176 of file BCP_var.hpp.

References _bcpind, and bcpind().

Referenced by BCP_var_core::BCP_var_core().

void BCP_var::set_bcpind_flip ( )
inline

Flip the internal index of the variable to its negative.

Definition at line 178 of file BCP_var.hpp.

References _bcpind.

void BCP_var::set_status ( const BCP_obj_status  status)
inline

Set the status of the variable.

Definition at line 183 of file BCP_var.hpp.

References _status, and status().

Referenced by BCP_var_core::BCP_var_core().

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 186 of file BCP_var.hpp.

References _status, and BCP_ObjDoNotSendToPool.

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 195 of file BCP_var.hpp.

References _status, and BCP_ObjInactive.

void BCP_var::make_non_removable ( )
inline

Mark the variable as NotRemovable.

Definition at line 199 of file BCP_var.hpp.

References _status, BCP_ObjNotRemovable, and BCP_ObjToBeRemoved.

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 207 of file BCP_var.hpp.

References _status, and BCP_ObjToBeRemoved.

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 46 of file BCP_var.hpp.

Referenced by bcpind(), set_bcpind(), and set_bcpind_flip().

BCP_obj_status BCP_var::_status
private
BCP_var_t BCP_var::_var_type
protected

The integrality type of the variable.

Definition at line 55 of file BCP_var.hpp.

Referenced by set_var_type(), and var_type().

double BCP_var::_obj
protected

The objective coefficient.

Definition at line 57 of file BCP_var.hpp.

Referenced by obj(), and set_obj().

double BCP_var::_lb
protected

Lower bound on the value the variable can take.

Definition at line 59 of file BCP_var.hpp.

Referenced by change_bounds(), change_lb_ub_st(), is_fixed_to_zero(), lb(), set_lb(), set_lb_ub(), and test_inactive().

double BCP_var::_ub
protected

Upper bound on the value the variable can take.

Definition at line 61 of file BCP_var.hpp.

Referenced by change_bounds(), change_lb_ub_st(), set_lb_ub(), set_ub(), test_inactive(), and ub().


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