NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ set_matrixelement() [1/6]

template<typename T >
void cntr::herm_matrix< T >::set_matrixelement ( int  tstp,
int  i1,
int  i2,
herm_matrix_timestep< T > &  g 
)

Sets given matrix elements of all components at time step tstp to the components of a given herm_matrix_timestep of a scaler type.

Purpose

Sets the (sub-) matrix elements (i1,i2) of all components at time step tstp to the components of a given herm_matrix_timestep of scaler type.

Parameters
tstp

The time step at which the components are set.

i1

First index for submatrix.

i2

Second index for submatrix.

g

The herm_matrix_timestep from which the time step is copied.

Definition at line 2222 of file cntr_herm_matrix_impl.hpp.

2223  {
2224  int i, sij = i1 * size2_ + i2;
2225  assert(tstp == g.tstp_ && tstp <= nt_);
2226  assert(0 <= i1 && i1 < size1_ && 0 <= i2 && i2 < size2_ && g.size1() == 1);
2227  if (tstp == -1) {
2228  for (i = 0; i <= ntau_; i++)
2229  matptr(i)[sij] = *(g.matptr(i));
2230  } else {
2231  for (i = 0; i <= tstp; i++)
2232  retptr(tstp, i)[sij] = *(g.retptr(i));
2233  for (i = 0; i <= ntau_; i++)
2234  tvptr(tstp, i)[sij] = *(g.tvptr(i));
2235  for (i = 0; i <= tstp; i++)
2236  lesptr(i, tstp)[sij] = *(g.lesptr(i));
2237  }
2238 }