NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ get_matrixelement()

template<typename T >
void cntr::function< T >::get_matrixelement ( int  i1,
int  i2,
function< T > &  g 
)

Get a matrix element of the function object

Purpose

Get 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 will be stored in another function object.

Parameters
i1

the first index of the matrix element to be set

i2

the second index of the matrix element to be set

g

the function object that the matrix element will be stored. If it is matrix-valued, only one matrix element will be changed.

Definition at line 620 of file cntr_function_impl.hpp.

References cntr::function< T >::nt_, and cntr::function< T >::ptr().

621 {
622  assert(this -> nt_ == g.nt_);
623  assert(i1 <= this -> size1_);
624  assert(i2 <= this -> size2_);
625  cplx *target_position, *my_data;
626  for(int tstp = -1; tstp <= nt_; tstp++)
627  {
628  my_data = this -> ptr(tstp) + i1 * size2_ + i2;
629  target_position = g.ptr(tstp);
630  element_set <T, 1> (1, target_position, my_data);
631  //*target_position = *my_data;
632  }
633 }
int size2_
Number of the rows in the Matrix form.
int size1_
Number of the colums in the Matrix form.
std::complex< T > cplx
int nt_
Maximum number of the time steps.
+ Here is the call graph for this function: