NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ set_timestep() [4/4]

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

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

Purpose

Sets all components of the herm_matrix_timestep at time step tstp to the components of given herm_matrix_timestep. 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_timestep from which the time step is copied.

Definition at line 405 of file cntr_herm_matrix_timestep_impl.hpp.

References cntr::herm_matrix_timestep< T >::lesptr(), cntr::herm_matrix_timestep< T >::matptr(), cntr::herm_matrix_timestep< T >::ntau(), cntr::herm_matrix_timestep< T >::retptr(), cntr::herm_matrix_timestep< T >::size1(), cntr::herm_matrix_timestep< T >::tstp(), and cntr::herm_matrix_timestep< T >::tvptr().

405  {
406  assert(tstp == tstp_);
407  assert(tstp == g1.tstp());
408  assert(tstp >= -1 && tstp <= g1.tstp() && "tstp >= -1 && tstp <= g1.tstp()");
409  assert(g1.size1() == size1_ && "g1.size1() == size1_");
410  assert(g1.ntau() == ntau_ && "g1.ntau() == ntau_");
411  if (tstp == -1) {
412  memcpy(matptr(0), g1.matptr(0), sizeof(cplx) * (ntau_ + 1) * element_size_);
413  } else {
414  memcpy(retptr(0), g1.retptr(0),
415  sizeof(cplx) * (tstp + 1) * element_size_);
416  memcpy(tvptr(0), g1.tvptr(0),
417  sizeof(cplx) * (ntau_ + 1) * element_size_);
418  memcpy(lesptr(0), g1.lesptr(0),
419  sizeof(cplx) * (tstp + 1) * element_size_);
420  }
421 }
+ Here is the call graph for this function: