vector of doubles. More...
#include <VolVolume.hpp>
Public Member Functions | |
VOL_dvector (const int s) | |
Construct a vector of size s. More... | |
VOL_dvector () | |
Default constructor creates a vector of size 0. More... | |
VOL_dvector (const VOL_dvector &x) | |
Copy constructor makes a replica of x. More... | |
~VOL_dvector () | |
The destructor deletes the data array. More... | |
int | size () const |
Return the size of the vector. More... | |
double & | operator[] (const int i) |
Return a reference to the i -th entry. More... | |
double | 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 | cc (const double gamma, const VOL_dvector &w) |
Convex combination. More... | |
void | allocate (const int s) |
delete the current vector and allocate space for a vector of size s . More... | |
void | swap (VOL_dvector &w) |
swaps the vector with w . More... | |
VOL_dvector & | operator= (const VOL_dvector &w) |
Copy w into the vector. More... | |
VOL_dvector & | operator= (const double w) |
Replace every entry in the vector with w . More... | |
Public Attributes | |
double * | v |
The array holding the vector. More... | |
int | sz |
The size of the vector. More... | |
vector of doubles.
It is used for most vector operations.
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 148 of file VolVolume.hpp.
|
inline |
Construct a vector of size s.
The content of the vector is undefined.
Definition at line 157 of file VolVolume.hpp.
|
inline |
Default constructor creates a vector of size 0.
Definition at line 162 of file VolVolume.hpp.
|
inline |
Copy constructor makes a replica of x.
Definition at line 164 of file VolVolume.hpp.
|
inline |
The destructor deletes the data array.
Definition at line 172 of file VolVolume.hpp.
|
inline |
Return the size of the vector.
Definition at line 175 of file VolVolume.hpp.
|
inline |
Return a reference to the i
-th entry.
Definition at line 178 of file VolVolume.hpp.
|
inline |
Return the i
-th entry.
Definition at line 184 of file VolVolume.hpp.
|
inline |
Delete the content of the vector and replace it with a vector of length 0.
Definition at line 191 of file VolVolume.hpp.
|
inline |
Convex combination.
Replace the current vector v
with v = (1-gamma) v + gamma w
.
Definition at line 198 of file VolVolume.hpp.
|
inline |
delete the current vector and allocate space for a vector of size s
.
Definition at line 214 of file VolVolume.hpp.
|
inline |
swaps the vector with w
.
Definition at line 221 of file VolVolume.hpp.
VOL_dvector& VOL_dvector::operator= | ( | const VOL_dvector & | w | ) |
Copy w
into the vector.
VOL_dvector& VOL_dvector::operator= | ( | const double | w | ) |
Replace every entry in the vector with w
.
double* VOL_dvector::v |
The array holding the vector.
Definition at line 151 of file VolVolume.hpp.
int VOL_dvector::sz |
The size of the vector.
Definition at line 153 of file VolVolume.hpp.