NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ set_timestep() [1/2]

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

Sets all components of herm_matrix_timestep_view 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 675 of file cntr_herm_matrix_timestep_view_impl.hpp.

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

675  {
676  assert(tstp == tstp_);
677  assert(tstp >= -1 && tstp <= g1.nt() && "tstp >= -1 && tstp <= g1.nt()");
678  assert(g1.size1() == size1_ && "g1.size1() == size1_");
679  assert(g1.ntau() == ntau_ && "g1.ntau() == ntau_");
680  if (tstp == -1) {
681  memcpy(matptr(0), g1.matptr(0), sizeof(cplx) * (ntau_ + 1) * element_size_);
682  } else {
683  memcpy(retptr(0), g1.retptr(tstp, 0),
684  sizeof(cplx) * (tstp + 1) * element_size_);
685  memcpy(tvptr(0), g1.tvptr(tstp, 0),
686  sizeof(cplx) * (ntau_ + 1) * element_size_);
687  memcpy(lesptr(0), g1.lesptr(0, tstp),
688  sizeof(cplx) * (tstp + 1) * element_size_);
689  }
690 }
+ Here is the call graph for this function: