46 #ifndef _NUMVEC_DECL_HPP_
47 #define _NUMVEC_DECL_HPP_
85 NumVec(Int m,
bool owndata, F* data);
91 void Resize ( Int m );
93 const F& operator()(Int i)
const;
95 const F& operator[](Int i)
const;
98 bool IsOwnData()
const {
return owndata_; }
99 F* Data()
const {
return data_; }
100 Int m ()
const {
return m_; }
104 typedef NumVec<bool> BolNumVec;
105 typedef NumVec<Int> IntNumVec;
106 typedef NumVec<Real> DblNumVec;
107 typedef NumVec<Complex> CpxNumVec;
114 template <
class F>
inline void SetValue( NumVec<F>& vec, F val );
117 template <
class F>
inline Real
Energy(
const NumVec<F>& vec );
122 #endif // _NUMVEC_DECL_HPP_
Numerical vector.
Definition: numvec_decl.hpp:61
void allocate(F *data=NULL)
Helper function allocating the memory pointed by the data_ attribute.
Definition: numvec_impl.hpp:209
void deallocate()
Helper function freeing memory pointed by the data_ attribute.
Definition: numvec_impl.hpp:219
Real Energy(const NumMat< F > &M)
Energy computes the L2 norm of a matrix (treated as a vector).
Definition: nummat_impl.hpp:70
bool owndata_
Whether it owns the data.
Definition: numvec_decl.hpp:76
void SetValue(NumMat< F > &M, F val)
SetValue sets a numerical matrix to a constant val.
Definition: nummat_impl.hpp:61
F * data_
The pointer for the actual data.
Definition: numvec_decl.hpp:79
Int bufsize_
The actual storage space allocated.
Definition: numvec_decl.hpp:82
Int m_
The size of the vector.
Definition: numvec_decl.hpp:73