#include <CoinWarmStartBasis.hpp>
Inheritance diagram for CoinWarmStartBasisDiff:
Public Member Functions | |
virtual CoinWarmStartDiff * | clone () const |
`Virtual constructor' | |
virtual CoinWarmStartBasisDiff & | operator= (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 | |
CoinWarmStartDiff * | CoinWarmStartBasis::generateDiff (const CoinWarmStart *const oldCWS) const |
void | CoinWarmStartBasis::applyDiff (const CoinWarmStartDiff *const diff) |
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_.
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.
|
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().
|
|
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 ; } |