Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

BCP_var_set Class Reference

#include <BCP_var.hpp>

Inheritance diagram for BCP_var_set:

BCP_vec< BCP_var * > List of all members.

Public Member Functions

Constructor and destructor
 BCP_var_set ()
 ~BCP_var_set ()
Modifying methods
void append (const BCP_vec< BCP_var * > &x)
void append (BCP_var_set::const_iterator first, BCP_var_set::const_iterator last)
void set_lb_ub (const BCP_vec< int > &pos, BCP_vec< double >::const_iterator bounds)
void set_lb_ub_st (const BCP_vec< BCP_obj_change > &vc)
void set_lb_ub_st (BCP_vec< int >::const_iterator pos, const BCP_vec< BCP_obj_change > &vc)
Methods related to deleting variables from the variable set
void deletable (const int bvarnum, BCP_vec< int > &collection)

Private Member Functions

Disabled methods
 BCP_var_set (const BCP_var_set &)
BCP_var_setoperator= (const BCP_var_set &)

Detailed Description

This class is just a collection of pointers to variables with a number of methods to manipulate these variables and/or select certain entries.

Definition at line 356 of file BCP_var.hpp.


Constructor & Destructor Documentation

BCP_var_set::BCP_var_set const BCP_var_set  )  [private]
 

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

BCP_var_set::BCP_var_set  )  [inline]
 

The default constructor creates a variable set with no variables in it.

Definition at line 371 of file BCP_var.hpp.

00371 {}

BCP_var_set::~BCP_var_set  )  [inline]
 

The destructor empties the variable set. NOTE: the destructor does NOT delete the variables the members of the variable set point to.

Definition at line 375 of file BCP_var.hpp.

00375 {}


Member Function Documentation

void BCP_var_set::append BCP_var_set::const_iterator  first,
BCP_var_set::const_iterator  last
[inline]
 

Append the variables in [first, last) to the end of the variable set.

Definition at line 387 of file BCP_var.hpp.

References BCP_vec< T >::append().

00388                                                      {
00389       BCP_vec<BCP_var*>::append(first, last);
00390    }

void BCP_var_set::append const BCP_vec< BCP_var * > &  x  )  [inline]
 

Append the variables in the vector x to the end of the variable set.

Reimplemented from BCP_vec< BCP_var * >.

Definition at line 382 of file BCP_var.hpp.

References BCP_vec< T >::append().

00382                                                   {
00383       BCP_vec<BCP_var*>::append(x);
00384    }

void BCP_var_set::deletable const int  bvarnum,
BCP_vec< int > &  collection
 

Collect the indices of the variables marked to be removed. Since core variables are never removed, we pass the number of core variables in the first argument to speed up things a little.

Definition at line 56 of file BCP_var.cpp.

References BCP_vec< T >::clear(), BCP_vec< BCP_var * >::end(), BCP_vec< BCP_var * >::entry(), BCP_vec< T >::reserve(), BCP_vec< BCP_var * >::size(), and BCP_vec< T >::unchecked_push_back().

00056                                                                  {
00057    collection.clear();
00058    collection.reserve(size() - bvarnum);
00059    iterator var = entry(bvarnum);
00060    for (int i = bvarnum; var != end(); ++var, ++i) {
00061       if ((*var)->is_to_be_removed())
00062          collection.unchecked_push_back(i);
00063    }
00064 }

BCP_var_set& BCP_var_set::operator= const BCP_var_set  )  [private]
 

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

void BCP_var_set::set_lb_ub const BCP_vec< int > &  pos,
BCP_vec< double >::const_iterator  bounds
 

Set the lower/upper bound pairs of the entries given by the contents of pos to the values in [bounds, bounds + pos. size()).

Definition at line 10 of file BCP_var.cpp.

References BCP_vec< T >::begin(), BCP_vec< T >::end(), and BCP_vec< BCP_var * >::operator[]().

00012 {
00013    BCP_vec<int>::const_iterator ii = indices.begin();
00014    BCP_vec<int>::const_iterator lastii = indices.end();
00015    for ( ; ii != lastii; ++ii){
00016       const double lb = *bounds;
00017       ++bounds;
00018       const double ub = *bounds;
00019       ++bounds;
00020       operator[](*ii)->change_bounds(lb, ub);
00021    }
00022 }

void BCP_var_set::set_lb_ub_st BCP_vec< int >::const_iterator  pos,
const BCP_vec< BCP_obj_change > &  vc
 

Set the lower/upper bound pairs and the stati of the entries given by the content of [pos, pos + cc. size()) to the triplets contained in cc.

Definition at line 42 of file BCP_var.cpp.

References BCP_vec< T >::begin(), BCP_vec< T >::end(), and BCP_vec< BCP_var * >::operator[]().

00043                                                             {
00044    BCP_vec<BCP_obj_change>::const_iterator chi = vc.begin();
00045    BCP_vec<BCP_obj_change>::const_iterator lastchi = vc.end();
00046    while (chi != lastchi){
00047       operator[](*pos)->change_lb_ub_st(*chi);
00048       ++pos;
00049       ++chi;
00050    }
00051 }

void BCP_var_set::set_lb_ub_st const BCP_vec< BCP_obj_change > &  vc  ) 
 

Set the lower/upper bound pairs and the stati of the first cc. size() entries to the triplets given in the vector. This method is invoked when the variable set is all the variables in the current formulation and we want to change the triplets for the core variables, which are at the beginning of that variable set.

Definition at line 27 of file BCP_var.cpp.

References BCP_vec< BCP_var * >::begin(), BCP_vec< T >::begin(), and BCP_vec< T >::end().

00028 {
00029    BCP_vec<BCP_obj_change>::const_iterator chi = vc.begin();
00030    BCP_vec<BCP_obj_change>::const_iterator lastchi = vc.end();
00031    iterator var = begin();
00032    while (chi != lastchi){
00033       (*var)->change_lb_ub_st(*chi);
00034       ++var;
00035       ++chi;
00036    }
00037 }


The documentation for this class was generated from the following files:
Generated on Wed Dec 3 14:32:42 2003 for BCP by doxygen 1.3.5