NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ set_matrixelement() [4/6]

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

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

Purpose

Sets the (sub-) matrix elements (i1,i2) of all components at time step tstp to matrix elements (j1,j2) of the corresponding componentat time step tstp of a given herm_matrix of matrix 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 from which the time step is copied.

j1

First index for submatrix of g.

j2

Second index for submatrix of g.

Definition at line 2365 of file cntr_herm_matrix_impl.hpp.

2366  {
2367  int i, sij = i1 * size2_ + i2, tij = j1 * g.size2() + j2;
2368  assert(tstp <= g.nt_ && tstp <= nt_ && "tstp <= g.nt_ && tstp <= nt_");
2369  assert(0 <= i1 && i1 < size1_ && 0 <= i2 && i2 < size2_
2370  && "0 <= i1 && i1 < size1_ && 0 <= i2 && i2 < size2_");
2371  assert(0 <= j1 && j1 < g.size1() && 0 <= j2 && j2 < g.size2()
2372  && "0 <= j1 && j1 < g.size1() && 0 <= j2 && j2 < g.size2()");
2373  if (tstp == -1) {
2374  for (i = 0; i <= ntau_; i++)
2375  matptr(i)[sij] = g.matptr(i)[tij];
2376  } else {
2377  for (i = 0; i <= tstp; i++)
2378  retptr(tstp, i)[sij] = g.retptr(tstp, i)[tij];
2379  for (i = 0; i <= ntau_; i++)
2380  tvptr(tstp, i)[sij] = g.tvptr(tstp, i)[tij];
2381  for (i = 0; i <= tstp; i++)
2382  lesptr(i, tstp)[sij] = g.lesptr(i, tstp)[tij];
2383  }
2384 }