46 #ifndef _PEXSI_NUMTNS_HPP_
47 #define _PEXSI_NUMTNS_HPP_
81 NumTns(Int m=0, Int n=0, Int p=0);
82 NumTns(Int m, Int n, Int p,
bool owndata, F* data);
86 void Resize(Int m, Int n, Int p);
87 const F& operator()(Int i, Int j, Int k)
const;
88 F& operator()(Int i, Int j, Int k);
89 F* Data()
const {
return data_; }
90 F* MatData (Int j)
const;
91 F* VecData (Int j, Int k)
const;
93 Int m()
const {
return m_; }
94 Int n()
const {
return n_; }
95 Int p()
const {
return p_; }
96 Int ByteSize()
const {
return p_*
m_*
n_*
sizeof(F);}
101 typedef NumTns<bool> BolNumTns;
102 typedef NumTns<Int> IntNumTns;
103 typedef NumTns<Real> DblNumTns;
104 typedef NumTns<Complex> CpxNumTns;
110 template <
class F>
inline void SetValue(NumTns<F>& T, F val);
113 template <
class F>
inline Real
Energy(
const NumTns<F>& T);
119 #endif // _PEXSI_NUMTNS_HPP_
Int n_
The size of second dimension.
Definition: NumTns.hpp:70
Int m_
The size of the first dimension.
Definition: NumTns.hpp:67
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: NumTns.hpp:76
void SetValue(NumMat< F > &M, F val)
SetValue sets a numerical matrix to a constant val.
Definition: NumMat_impl.hpp:137
Numerical tensor.
Definition: NumTns.hpp:63
Implementation of numerical tensor.
F * data_
The pointer for the actual data.
Definition: NumTns.hpp:79
Int p_
The size of third dimension.
Definition: NumTns.hpp:73