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

CoinWarmStartBasisDiff Class Reference

A `diff' between two CoinWarmStartBasis objects. More...

#include <CoinWarmStartBasis.hpp>

Inheritance diagram for CoinWarmStartBasisDiff:

CoinWarmStartDiff List of all members.

Public Member Functions

virtual CoinWarmStartDiffclone () const
 `Virtual constructor'

virtual CoinWarmStartBasisDiffoperator= (const CoinWarmStartBasisDiff &rhs)
 Assignment.

virtual ~CoinWarmStartBasisDiff ()
 Destructor.


Protected Member Functions

 CoinWarmStartBasisDiff ()
 Default constructor.

 CoinWarmStartBasisDiff (const CoinWarmStartBasisDiff &cwsbd)
 Copy constructor.


Private Member Functions

 CoinWarmStartBasisDiff (int sze, const unsigned int *const diffNdxs, const unsigned int *const diffVals)
 Standard constructor.


Private Attributes

int sze_
 Number of entries (and allocated capacity), in units of int.

unsigned int * diffNdxs_
 Array of diff indices.

unsigned int * diffVals_
 Array of diff values.


Friends

CoinWarmStartDiffCoinWarmStartBasis::generateDiff (const CoinWarmStart *const oldCWS) const
void CoinWarmStartBasis::applyDiff (const CoinWarmStartDiff *const diff)

Detailed Description

A `diff' between two CoinWarmStartBasis objects.

This class exists in order to hide from the world the details of calculating and representing a `diff' between two CoinWarmStartBasis objects. For convenience, assignment, cloning, and deletion are visible to the world, and default and copy constructors are made available to derived classes. Knowledge of the rest of this structure, and of generating and applying diffs, is restricted to the friend functions CoinWarmStartBasis::generateDiff() and CoinWarmStartBasis::applyDiff().

The actual data structure is a pair of unsigned int vectors, diffNdxs_ and diffVals_.

Todo:
This is a pretty generic structure, and vector diff is a pretty generic activity. We should be able to convert this to a template.

Using unsigned int as the data type for the diff vectors might help to contain the damage when this code is inevitably compiled for 64 bit architectures. But the notion of int as 4 bytes is hardwired into CoinWarmStartBasis, so changes are definitely required.

Definition at line 322 of file CoinWarmStartBasis.hpp.


Constructor & Destructor Documentation

CoinWarmStartBasisDiff::CoinWarmStartBasisDiff  )  [inline, protected]
 

Default constructor.

This is protected (rather than private) so that derived classes can see it when they make their default constructor protected or private.

Definition at line 347 of file CoinWarmStartBasis.hpp.

References diffNdxs_, diffVals_, and sze_.

Referenced by clone().

00347 : sze_(0), diffNdxs_(0), diffVals_(0) { } ;

CoinWarmStartBasisDiff::CoinWarmStartBasisDiff const CoinWarmStartBasisDiff cwsbd  )  [protected]
 

Copy constructor.

For convenience when copying objects containing CoinWarmStartBasisDiff objects. But consider whether you should be using clone() to retain polymorphism.

This is protected (rather than private) so that derived classes can see it when the make their copy constructor protected or private.

Definition at line 425 of file CoinWarmStartBasis.cpp.

00426   : sze_(rhs.sze_),
00427     diffNdxs_(0),
00428     diffVals_(0)
00429 { if (sze_ > 0)
00430   { diffNdxs_ = new unsigned int[sze_] ;
00431     memcpy(diffNdxs_,rhs.diffNdxs_,sze_*sizeof(unsigned int)) ;
00432     diffVals_ = new unsigned int[sze_] ;
00433     memcpy(diffVals_,rhs.diffVals_,sze_*sizeof(unsigned int)) ; }
00434 
00435   return ; }


The documentation for this class was generated from the following files:
Generated on Wed Dec 3 14:34:30 2003 for Coin by doxygen 1.3.5