PEXSI
 All Classes Namespaces Files Functions Variables Friends Pages
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
PEXSI::NumVec< F > Class Template Reference

Numerical vector. More...

#include <numvec_decl.hpp>

Public Member Functions

 NumVec (Int m=0)
 
 NumVec (Int m, bool owndata, F *data)
 
 NumVec (const NumVec &C)
 
NumVecoperator= (const NumVec &C)
 
void Resize (Int m)
 
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
 

Public 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.
 

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.
 

Detailed Description

template<class F>
class PEXSI::NumVec< F >

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).


The documentation for this class was generated from the following files: