NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ incr_timestep() [4/4]

template<typename T >
void cntr::herm_matrix< T >::incr_timestep ( int  tstp,
herm_matrix< T > &  g 
)

Adds a herm_matrix with given weight to the herm_matrix at given time step.

Purpose

Performs the operation \(C \rightarrow C + g\), where \(C\) is the herm_matrix, \(g\) is a time slice taken from a herm_matrix The operation is performed at given time step tstp.

Parameters
tstp

[int] The time step where the herm_matrix is increased.

g

[herm_matrix] The herm_matrix \(g\) which is added to the herm_matrix at the time step.

Definition at line 2725 of file cntr_herm_matrix_impl.hpp.

2725  {
2726  int m;
2727  cplx *x, *x0;
2728  cplx alpha = cplx(1.0, 0.0);
2729  assert(tstp >= -1 && tstp <= nt_ && "tstp >= -1 && tstp <= nt_");
2730  assert(g.nt_ >= tstp && g.ntau_ == ntau_ && g.size1_ == size1_
2731  && "g.nt_ >= tstp && g.ntau_ == ntau_ && g.size1_ == size1_");
2732  if (tstp == -1) {
2733  x0 = matptr(0);
2734  x = g.matptr(0);
2735  for (m = 0; m <= ntau_; m++) {
2736  element_incr<T, LARGESIZE>(size1_, x0 + m * element_size_, alpha,
2737  x + m * element_size_);
2738  }
2739  } else {
2740  x0 = retptr(tstp, 0);
2741  x = g.retptr(tstp, 0);
2742  for (m = 0; m <= tstp; m++) {
2743  element_incr<T, LARGESIZE>(size1_, x0 + m * element_size_, alpha,
2744  x + m * element_size_);
2745  }
2746  x0 = tvptr(tstp, 0);
2747  x = g.tvptr(tstp, 0);
2748  for (m = 0; m <= ntau_; m++) {
2749  element_incr<T, LARGESIZE>(size1_, x0 + m * element_size_, alpha,
2750  x + m * element_size_);
2751  }
2752  x0 = lesptr(0, tstp);
2753  x = g.lesptr(0, tstp);
2754  for (m = 0; m <= tstp; m++) {
2755  element_incr<T, LARGESIZE>(size1_, x0 + m * element_size_, alpha,
2756  x + m * element_size_);
2757  }
2758  }
2759 }
std::complex< T > cplx