vector of ints. More...
#include <VolVolume.hpp>
Public Member Functions | |
VOL_ivector (const int s) | |
Construct a vector of size s. More... | |
VOL_ivector () | |
Default constructor creates a vector of size 0. More... | |
VOL_ivector (const VOL_ivector &x) | |
Copy constructor makes a replica of x. More... | |
~VOL_ivector () | |
The destructor deletes the data array. More... | |
int | size () const |
Return the size of the vector. More... | |
int & | operator[] (const int i) |
Return a reference to the i -th entry. More... | |
int | operator[] (const int i) const |
Return the i -th entry. More... | |
void | clear () |
Delete the content of the vector and replace it with a vector of length 0. More... | |
void | allocate (const int s) |
delete the current vector and allocate space for a vector of size s . More... | |
void | swap (VOL_ivector &w) |
swaps the vector with w . More... | |
VOL_ivector & | operator= (const VOL_ivector &v) |
Copy w into the vector. More... | |
VOL_ivector & | operator= (const int w) |
Replace every entry in the vector with w . More... | |
Public Attributes | |
int * | v |
The array holding the vector. More... | |
int | sz |
The size of the vector. More... | |
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).
Definition at line 242 of file VolVolume.hpp.
|
inline |
Construct a vector of size s.
The content of the vector is undefined.
Definition at line 250 of file VolVolume.hpp.
|
inline |
Default constructor creates a vector of size 0.
Definition at line 255 of file VolVolume.hpp.
|
inline |
Copy constructor makes a replica of x.
Definition at line 257 of file VolVolume.hpp.
|
inline |
The destructor deletes the data array.
Definition at line 265 of file VolVolume.hpp.
|
inline |
Return the size of the vector.
Definition at line 270 of file VolVolume.hpp.
|
inline |
Return a reference to the i
-th entry.
Definition at line 272 of file VolVolume.hpp.
|
inline |
Return the i
-th entry.
Definition at line 278 of file VolVolume.hpp.
|
inline |
Delete the content of the vector and replace it with a vector of length 0.
Definition at line 285 of file VolVolume.hpp.
|
inline |
delete the current vector and allocate space for a vector of size s
.
Definition at line 293 of file VolVolume.hpp.
|
inline |
swaps the vector with w
.
Definition at line 300 of file VolVolume.hpp.
VOL_ivector& VOL_ivector::operator= | ( | const VOL_ivector & | v | ) |
Copy w
into the vector.
VOL_ivector& VOL_ivector::operator= | ( | const int | w | ) |
Replace every entry in the vector with w
.
int* VOL_ivector::v |
The array holding the vector.
Definition at line 245 of file VolVolume.hpp.
int VOL_ivector::sz |
The size of the vector.
Definition at line 247 of file VolVolume.hpp.