NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ set_matrixelement() [1/2]

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

Set the matrix element of \(C_{[i1,i2]}\) for each component from \( g_{[i1,i2]} \)

Purpose

Set the matrix element \(C_{[i1,i2]}\) for each component from \( g_{[i1,i2]} \). If \(t>-1\) then ret,les,tv components are set, otherwise mat. Works for scalar or square-matrix contour objects.

Parameters
i1

Row index of herm_matrix_timestep_view

i2

Column index of herm_matrix_timestep_view

g

The herm_matrix_timestep_view from which the matrix element element is given

j1

Row index of herm_matrix_timestep_view

j2

Column index of herm_matrix_timestep_view

Definition at line 1309 of file cntr_herm_matrix_timestep_view_impl.hpp.

References cntr::herm_matrix_timestep_view< T >::size2().

Referenced by cntr::herm_matrix_timestep< T >::set_matrixelement().

1310  {
1311  int i, sij = i1 * size2_ + i2, tij = j1 * g.size2() + j2;
1312  assert(tstp_==g.tstp_ && ntau_ == g.ntau_);
1313 
1314  assert(i1>=0 && i1 <=size1_ -1);
1315  assert(i2>=0 && i2 <=size2_ -1);
1316  assert(j1>=0 && j1 <=g.size1_-1);
1317  assert(j2>=0 && j2 <=g.size2_-1);
1318 
1319  if (tstp_ == -1) {
1320  for (i = 0; i <= ntau_; i++)
1321  matptr(i)[sij] = g.matptr(i)[tij];
1322  } else {
1323  for (i = 0; i <= tstp_; i++)
1324  retptr(i)[sij] = g.retptr(i)[tij];
1325  for (i = 0; i <= ntau_; i++)
1326  tvptr(i)[sij] = g.tvptr(i)[tij];
1327  for (i = 0; i <= tstp_; i++)
1328  lesptr(i)[sij] = g.lesptr(i)[tij];
1329  }
1330 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function: