NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ set_timestep() [3/4]

template<typename T >
void cntr::herm_matrix_timestep< T >::set_timestep ( int  tstp,
herm_matrix< T > &  g1 
)

Sets all components of herm_matrix_timestep to the components of a given herm_matrix at time step tstp.

Purpose

Sets all components of the herm_matrix_timestep at time step tstp to the components of given herm_matrix. If tstp = -1, only the Matsubara component will be copied.

Parameters
tstp

The time step at which the components are set.

g1

The herm_matrix from which the time step is copied.

Definition at line 365 of file cntr_herm_matrix_timestep_impl.hpp.

References cntr::herm_matrix< T >::nt(), cntr::herm_matrix< T >::ntau(), and cntr::herm_matrix< T >::size1().

365  {
366  assert(tstp == tstp_);
367  assert(tstp >= -1 && tstp <= g1.nt() && "tstp >= -1 && tstp <= g1.nt()");
368  assert(g1.size1() == size1_ && "g1.size1() == size1_");
369  assert(g1.ntau() == ntau_ && "g1.ntau() == ntau_");
370  if (tstp == -1) {
371  memcpy(matptr(0), g1.matptr(0), sizeof(cplx) * (ntau_ + 1) * element_size_);
372  } else {
373  memcpy(retptr(0), g1.retptr(tstp, 0),
374  sizeof(cplx) * (tstp + 1) * element_size_);
375  memcpy(tvptr(0), g1.tvptr(tstp, 0),
376  sizeof(cplx) * (ntau_ + 1) * element_size_);
377  memcpy(lesptr(0), g1.lesptr(0, tstp),
378  sizeof(cplx) * (tstp + 1) * element_size_);
379  }
380 }
+ Here is the call graph for this function: