NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ incr_timestep() [3/4]

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

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

Purpose

Performs the operation \(C \rightarrow C + \alpha g\), where \(C\) is the herm_matrix, \(g\) is a time slice taken from a herm_matrix and \(\alpha\) is a complex weight. 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.

alpha

[complex<T>] The weight in front of \(g\).

Definition at line 2669 of file cntr_herm_matrix_impl.hpp.

2670  {
2671  int m;
2672  cplx *x, *x0;
2673  assert(tstp >= -1 && tstp <= nt_ && "tstp >= -1 && tstp <= nt_");
2674  assert(g.nt_ >= tstp && g.ntau_ == ntau_ && g.size1_ == size1_
2675  && "g.nt_ >= tstp && g.ntau_ == ntau_ && g.size1_ == size1_");
2676  if (tstp == -1) {
2677  x0 = matptr(0);
2678  x = g.matptr(0);
2679  for (m = 0; m <= ntau_; m++) {
2680  element_incr<T, LARGESIZE>(size1_, x0 + m * element_size_, alpha,
2681  x + m * element_size_);
2682  }
2683  } else {
2684  x0 = retptr(tstp, 0);
2685  x = g.retptr(tstp, 0);
2686  for (m = 0; m <= tstp; m++) {
2687  element_incr<T, LARGESIZE>(size1_, x0 + m * element_size_, alpha,
2688  x + m * element_size_);
2689  }
2690  x0 = tvptr(tstp, 0);
2691  x = g.tvptr(tstp, 0);
2692  for (m = 0; m <= ntau_; m++) {
2693  element_incr<T, LARGESIZE>(size1_, x0 + m * element_size_, alpha,
2694  x + m * element_size_);
2695  }
2696  x0 = lesptr(0, tstp);
2697  x = g.lesptr(0, tstp);
2698  for (m = 0; m <= tstp; m++) {
2699  element_incr<T, LARGESIZE>(size1_, x0 + m * element_size_, alpha,
2700  x + m * element_size_);
2701  }
2702  }
2703 }
std::complex< T > cplx