NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ set_matrixelement() [1/2]

template<typename T >
template<class EigenMatrix >
void cntr::function< T >::set_matrixelement ( int  tstp,
int  i1,
int  i2,
EigenMatrix &  M,
int  j1,
int  j2 
)

Set a matrix element from an Eigen matrix

Purpose

Set a matrix element of the function object at all time steps from an Eigen matrix. The matrix element of the function at each time step would be set to the same matrix element of the Eigen matrix.

Parameters
tstp

time step of the matrix element to be set

i1

the first index of the matrix element to be set

i2

the second index of the matrix element to be set

M

the matrix used to set the value

j1

the first index of the matrix element used to set

j2

the second index of the matrix element used to set

Definition at line 590 of file cntr_function_impl.hpp.

590  {
591  assert(0<=i1 && i1<size1_ && 0<=i2 && i2<size2_);
592  assert(0<=j1 && j1<M.rows() && 0<=j2 && j2<M.cols());
593  cplx *ft;
594  ft=ptr(tstp);
595  ft[i1*size2_+i2]=M(j1,j2);
596 }
int size2_
Number of the rows in the Matrix form.
int size1_
Number of the colums in the Matrix form.
std::complex< T > cplx