46 #ifndef _PEXSI_NUMVEC_HPP_
47 #define _PEXSI_NUMVEC_HPP_
83 NumVec(Int m,
bool owndata, F* data);
89 void Resize ( Int m );
91 const F& operator()(Int i)
const;
93 const F& operator[](Int i)
const;
96 bool IsOwnData()
const {
return owndata_; }
97 F* Data()
const {
return data_; }
98 Int m ()
const {
return m_; }
99 Int ByteSize()
const {
return m_*
sizeof(F);}
103 typedef NumVec<bool> BolNumVec;
104 typedef NumVec<Int> IntNumVec;
105 typedef NumVec<Real> DblNumVec;
106 typedef NumVec<Complex> CpxNumVec;
113 template <
class F>
inline void SetValue( NumVec<F>& vec, F val );
116 template <
class F>
inline Real
Energy(
const NumVec<F>& vec );
123 #endif // _PEXSI_NUMVEC_HPP_
Numerical vector.
Definition: NumVec.hpp:60
void allocate(F *data=NULL)
Helper function allocating the memory pointed by the data_ attribute.
Definition: NumVec_impl.hpp:205
void deallocate()
Helper function freeing memory pointed by the data_ attribute.
Definition: NumVec_impl.hpp:215
Real Energy(const NumMat< F > &M)
Energy computes the L2 norm of a matrix (treated as a vector).
Definition: NumMat_impl.hpp:142
bool owndata_
Whether it owns the data.
Definition: NumVec.hpp:74
void SetValue(NumMat< F > &M, F val)
SetValue sets a numerical matrix to a constant val.
Definition: NumMat_impl.hpp:137
Implementation of Numerical Vector.
F * data_
The pointer for the actual data.
Definition: NumVec.hpp:77
Int bufsize_
The actual storage space allocated.
Definition: NumVec.hpp:80
Int m_
The size of the vector.
Definition: NumVec.hpp:71