NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ set_timestep() [2/2]

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

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

Purpose

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

Parameters
tstp

[int] The time step at which the components are set.

timestep

[herm_matrix_timestep] The herm_matrix_timestep from which the time step is copied.

Definition at line 2137 of file cntr_herm_matrix_impl.hpp.

2138  {
2139  cplx *x = timestep.data_;
2140  assert(tstp >= -1 && tstp <= nt_ && "(tstp >= -1 && tstp <= nt_");
2141  assert(timestep.tstp_ == tstp && timestep.ntau_ == ntau_ &&
2142  timestep.size1_ == size1_ &&
2143  "timestep.tstp_ == tstp && timestep.ntau_ == ntau_ && timestep.size1_ == size1_");
2144  if (tstp == -1) {
2145  memcpy(mat_, x, sizeof(cplx) * (ntau_ + 1) * element_size_);
2146  } else {
2147  memcpy(retptr(tstp, 0), x, sizeof(cplx) * (tstp + 1) * element_size_);
2148  memcpy(tvptr(tstp, 0), x + (tstp + 1) * element_size_,
2149  sizeof(cplx) * (ntau_ + 1) * element_size_);
2150  memcpy(lesptr(0, tstp), x + (tstp + 1 + ntau_ + 1) * element_size_,
2151  sizeof(cplx) * (tstp + 1) * element_size_);
2152  }
2153 }
std::complex< T > cplx