vector of ints. More...
#include <VolVolume.h>
Public Member Functions | |
VOL_ivector (const int s) | |
Construct a vector of size s. | |
VOL_ivector () | |
Default constructor creates a vector of size 0. | |
VOL_ivector (const VOL_ivector &x) | |
Copy constructor makes a replica of x. | |
~VOL_ivector () | |
The destructor deletes the data array. | |
int | size () const |
Return the size of the vector. | |
int & | operator[] (const int i) |
Return a reference to the i -th entry. | |
int | operator[] (const int i) const |
Return the i -th entry. | |
void | clear () |
Delete the content of the vector and replace it with a vector of length 0. | |
void | allocate (const int s) |
delete the current vector and allocate space for a vector of size s . | |
void | swap (VOL_ivector &w) |
swaps the vector with w . | |
VOL_ivector & | operator= (const VOL_ivector &v) |
Copy w into the vector. | |
VOL_ivector & | operator= (const int w) |
Replace every entry in the vector with w . | |
Data Fields | |
int * | v |
The array holding the vector. | |
int | sz |
The size of the vector. |
vector of ints.
It's used to store indices, it has similar functions as VOL_dvector.
Note: If VOL_DEBUG
is defined
to be 1 then each time an entry is accessed in the vector the index of the entry is tested for nonnegativity and for being less than the size of the vector. It's good to turn this on while debugging, but in final runs it should be turned off (beause of the performance hit).
VOL_ivector::VOL_ivector | ( | const int | s | ) | [inline] |
VOL_ivector::VOL_ivector | ( | ) | [inline] |
Default constructor creates a vector of size 0.
VOL_ivector::VOL_ivector | ( | const VOL_ivector & | x | ) | [inline] |
VOL_ivector::~VOL_ivector | ( | ) | [inline] |
The destructor deletes the data array.
References v.
void VOL_ivector::allocate | ( | const int | s | ) | [inline] |
void VOL_ivector::clear | ( | ) | [inline] |
VOL_ivector & VOL_ivector::operator= | ( | const int | w | ) |
VOL_ivector & VOL_ivector::operator= | ( | const VOL_ivector & | v | ) |
int& VOL_ivector::operator[] | ( | const int | i | ) | [inline] |
int VOL_ivector::operator[] | ( | const int | i | ) | const [inline] |
int VOL_ivector::size | ( | ) | const [inline] |
Return the size of the vector.
References sz.
Referenced by UFL< vtype, adjlist_t >::heuristics(), operator=(), and UFL< vtype, adjlist_t >::solve_subproblem().
void VOL_ivector::swap | ( | VOL_ivector & | w | ) | [inline] |
int VOL_ivector::sz |
The size of the vector.
Referenced by allocate(), clear(), operator=(), operator[](), size(), swap(), and VOL_ivector().
int* VOL_ivector::v |
The array holding the vector.
Referenced by allocate(), clear(), operator=(), operator[](), UFL< vtype, adjlist_t >::solve_subproblem(), swap(), VOL_ivector(), and ~VOL_ivector().