Numerical vector. More...
#include <NumVec.hpp>
Public Member Functions | |
NumVec (Int m) | |
NumVec (Int m, bool owndata, F *data) | |
NumVec (const NumVec &C) | |
NumVec & | operator= (const NumVec &C) |
void | Resize (Int m) |
void | Clear () |
const F & | operator() (Int i) const |
F & | operator() (Int i) |
const F & | operator[] (Int i) const |
F & | operator[] (Int i) |
bool | IsOwnData () const |
F * | Data () const |
Int | m () const |
Int | ByteSize () const |
Protected Member Functions | |
void | allocate (F *data=NULL) |
Helper function allocating the memory pointed by the data_ attribute. | |
void | deallocate () |
Helper function freeing memory pointed by the data_ attribute. | |
Protected Attributes | |
Int | m_ |
The size of the vector. | |
bool | owndata_ |
Whether it owns the data. | |
F * | data_ |
The pointer for the actual data. | |
Int | bufsize_ |
The actual storage space allocated. | |
Numerical vector.
NumVec is a portable encapsulation of a pointer to represent a 1D vector. The main difference between NumVec<F> and std::vector<F> is that NumVec<F> allows the vector to not owning the data, by specifying (owndata_ == false).