10template <
typename REAL,
typename Device = base_device::DEVICE_CPU>
15 using resmem_var_op = base_device::memory::resize_memory_op_mt<REAL, Device>;
16 using delmem_var_op = base_device::memory::delete_memory_op_mt<REAL, Device>;
70template <
typename REAL,
typename Device>
71REAL
vTMv(
const REAL* v,
const REAL* M,
const int n)
74 base_device::DEVICE_CPU* cpu_ctx = {};
76 const char normal =
'N';
82 ModuleBase::gemv_op<REAL, Device>()(normal, n, n, &one, M, n, v, inc, &zero, y, inc);
84 REAL* dot_device =
nullptr;
base_device::memory::resize_memory_op< REAL, Device > resmem_var_op
Definition sto_che.h:18
std::unique_ptr< REAL, delmem_var_deleter > spolyv
[Device] coefficients of Chebyshev expansion
Definition sto_che.h:48
base_device::memory::delete_memory_op< REAL, Device > delmem_var_op
Definition sto_che.h:19
StoChe(const StoChe &)=delete
Device * ctx
Definition sto_che.h:59
base_device::memory::synchronize_memory_op< REAL, base_device::DEVICE_CPU, Device > syncmem_var_d2h_op
Definition sto_che.h:21
REAL emin_sto
minimum energy for normalization
Definition sto_che.h:56
std::vector< REAL > spolyv_cpu
[CPU] coefficients of Chebyshev expansion (method==1 only)
Definition sto_che.h:49
REAL emax_sto
maximum energy for normalization
Definition sto_che.h:55
int nche
order of Chebyshev expansion
Definition sto_che.h:47
std::unique_ptr< ModuleBase::Chebyshev< REAL, Device > > p_che
Chebyshev expansion. Stores the plan of FFTW and should be initialized at the beginning of the calcul...
Definition sto_che.h:53
StoChe(StoChe &&) noexcept=default
int method_sto
method for the stochastic calculation
Definition sto_che.h:50
void init(const int &nche, const int &method, const REAL &emax_sto, const REAL &emin_sto)
(Re)allocate Chebyshev expansion buffers. Safe to call multiple times.
Definition sto_che.cpp:7
StoChe & operator=(const StoChe &)=delete
Definition clebsch_gordan_coeff.cpp:8
REAL vTMv(const REAL *v, const REAL *M, const int n)
calculate v^T*M*v
Definition sto_che.h:71
Definition math_kernel_op.h:254
deleter for device-side spolyv buffer
Definition sto_che.h:25
void operator()(REAL *p) const
Definition sto_che.h:26
Definition memory_op.h:115
Definition memory_op.h:17
Definition memory_op.h:61
T type
Definition tensor_types.h:76
#define private
Definition test_io_sys_var.cpp:11